diff options
| author | uvok | 2026-01-02 20:30:57 +0100 |
|---|---|---|
| committer | uvok | 2026-01-02 20:30:57 +0100 |
| commit | 10021fb57a6f924a85142c58372df7ad8a2970bf (patch) | |
| tree | d01ddaef4f0a67317e6e2d779b980775709f5be1 /nandgame/instruction_decode_tb.sv | |
| parent | 6c1db8cded8b8bb1c4d31a840f7dd9dddb8bbf7d (diff) | |
id testbench
Diffstat (limited to 'nandgame/instruction_decode_tb.sv')
| -rw-r--r-- | nandgame/instruction_decode_tb.sv | 16 |
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 |
