From 10021fb57a6f924a85142c58372df7ad8a2970bf Mon Sep 17 00:00:00 2001 From: uvok Date: Fri, 2 Jan 2026 20:30:57 +0100 Subject: id testbench --- nandgame/instruction_decode_tb.sv | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'nandgame') 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 -- cgit v1.2.3