Fixed timing in testbench for branch iteration.

This commit is contained in:
riley committed 2026-10-16 12:51:21 +11:00
1 parent 59f7f372f6
commit 2f652705cc
1 file changed
+6 -1
+6 -1
View File
@@ -28,7 +28,7 @@ module mips_tb();
#2;
rst = 0;
#2;
$dumpfile("output.vcd");
$dumpvars(0, clk);
$dumpvars(1, CPU.REGS);
@@ -82,11 +82,16 @@ module mips_tb();
`TEST_CHECK(CPU.REGS.regs[21] == $unsigned(CPU.REGS.regs[12]) < $unsigned(CPU.REGS.regs[14]));
// Check loop branching
#2;
for (integer N = 1; N < 11; ++N) begin
#2;
`TEST_CHECK(CPU.REGS.regs[8] == 32'(N));
#2;
`TEST_CHECK(CPU.REGS.regs[22] == $unsigned(CPU.REGS.regs[8]) < $unsigned(CPU.REGS.regs[13]));
if (N < 10)
#2;
#2;
end
// Final state check