Archived
1
0

update and debug testbench

This commit is contained in:
Erick
2022-03-04 01:38:36 +01:00
parent 9c4b6b7ce4
commit d65b968e96
11 changed files with 208 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
'include "cpu/alu/halfadder.sv"
module halfadder_tb();
reg ta,tb;
wire t_sum, t_carry;
halfadder dut(t_sum, t_carry, ta, tb);
initial begin
ta = 0; tb = 0;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
#5 ta = 1; tb = 0;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
#5 ta = 0; tb = 1;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
#5 ta = 1; tb = 1;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
end
endmodule