summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nandgame/instruction_decode_tb.sv16
1 files changed, 10 insertions, 6 deletions
diff --git a/nandgame/instruction_decode_tb.sv b/nandgame/instruction_decode_tb.sv
index 8f5cfc6..b272f13 100644
--- a/nandgame/instruction_decode_tb.sv
+++ b/nandgame/instruction_decode_tb.sv
@@ -29,18 +29,22 @@ initial begin
$dumpfile(filename); $dumpvars();
end
+`define TB_CHECK(result, expected) assert(result == expected) else $error("Expected %x, got %x", expected, result);
+
initial begin
- #10
+ #1
tst_instruction = 0;
tst_data_A = 0;
tst_data_D = 0;
tst_data_pA = 0;
+
+ #1
+ `TB_CHECK(tst_result, 0);
+ `TB_CHECK(tst_destination_A, 1);
+ `TB_CHECK(tst_destination_D, 0);
+ `TB_CHECK(tst_destination_pA, 0);
+ `TB_CHECK(tst_should_jump, 0);
#1
- assert(tst_result==0);
- assert(tst_destination_A == 0);
- assert(tst_destination_D == 0);
- assert(tst_destination_pA == 0);
- assert(tst_should_jump == 0);
$finish();
end