From 6c1db8cded8b8bb1c4d31a840f7dd9dddb8bbf7d Mon Sep 17 00:00:00 2001 From: uvok Date: Fri, 2 Jan 2026 19:36:30 +0100 Subject: Rename variables to be more clear, document --- nandgame/counter_tb.sv | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'nandgame/counter_tb.sv') diff --git a/nandgame/counter_tb.sv b/nandgame/counter_tb.sv index a7fab85..1603a31 100644 --- a/nandgame/counter_tb.sv +++ b/nandgame/counter_tb.sv @@ -2,14 +2,14 @@ module counter_tb; -logic clk_i, store; -logic [15:0] in, res; +logic tst_clk, tst_store_X; +logic [15:0] tst_in_X, tst_result; counter uut ( - .cl(clk_i), - .X(in), - .count(res), - .st(store) + .clk_in(tst_clk), + .X_in(tst_in_X), + .counter_out(tst_result), + .st_store_X_in(tst_store_X) ); string filename; @@ -20,27 +20,27 @@ initial begin filename="counter.lxt2"; `endif $dumpfile(filename); $dumpvars(); - clk_i = 0; - store = 0; - in = 0; + tst_clk = 0; + tst_store_X = 0; + tst_in_X = 0; end -always #10 clk_i = ~clk_i; +always #10 tst_clk = ~tst_clk; initial begin #200 - @(posedge clk_i); - store = 1; - in = 16'd834; + @(posedge tst_clk); + tst_store_X = 1; + tst_in_X = 16'd834; repeat(3) begin - @(posedge clk_i); - assert (res == 834) - else $error("Expected 834, got %d", res); + @(posedge tst_clk); + assert (tst_result == 834) + else $error("Expected 834, got %d", tst_result); end - store = 0; - @(posedge clk_i); - assert (res == 835) - else $error("Expected 835, got %d", res); + tst_store_X = 0; + @(posedge tst_clk); + assert (tst_result == 835) + else $error("Expected 835, got %d", tst_result); #30 $finish(); -- cgit v1.2.3