diff options
| author | uvok | 2026-01-02 19:36:30 +0100 |
|---|---|---|
| committer | uvok | 2026-01-02 19:36:30 +0100 |
| commit | 6c1db8cded8b8bb1c4d31a840f7dd9dddb8bbf7d (patch) | |
| tree | e8bb18228b55baf35dd540cd6e607857e9ecbaef /nandgame/counter_tb.sv | |
| parent | e49b8a787f72daa3d08e278a9c32663c16531827 (diff) | |
Rename variables to be more clear, document
Diffstat (limited to 'nandgame/counter_tb.sv')
| -rw-r--r-- | nandgame/counter_tb.sv | 40 |
1 files changed, 20 insertions, 20 deletions
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(); |
