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/cond_check_tb.sv | |
| parent | e49b8a787f72daa3d08e278a9c32663c16531827 (diff) | |
Rename variables to be more clear, document
Diffstat (limited to 'nandgame/cond_check_tb.sv')
| -rw-r--r-- | nandgame/cond_check_tb.sv | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/nandgame/cond_check_tb.sv b/nandgame/cond_check_tb.sv index a7a22dc..e38bd44 100644 --- a/nandgame/cond_check_tb.sv +++ b/nandgame/cond_check_tb.sv @@ -4,16 +4,16 @@ module cond_check_tb; -logic [15:0] in1; -logic ltz, gtz, eqz; -logic res; +logic [15:0] tst_in1; +logic tst_check_ltz, tst_check_gtz, tst_check_eqz; +logic tst_result; cond_check uut ( - .X(in1), - .ltz(ltz), - .gtz(gtz), - .eqz(eqz), - .res(res) + .X_in(tst_in1), + .check_ltz_in(tst_check_ltz), + .check_gtz_in(tst_check_gtz), + .check_eqz_in(tst_check_eqz), + .result_out(tst_result) ); string filename; @@ -29,88 +29,88 @@ end bit exp_res; initial begin - eqz = 0; gtz = 0; ltz = 0; in1 = 0; + tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 0; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 0; ltz = 1; in1 = 0; + tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 1; tst_in1 = 0; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 1; ltz = 0; in1 = 0; + tst_check_eqz = 0; tst_check_gtz = 1; tst_check_ltz = 0; tst_in1 = 0; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 1; gtz = 0; ltz = 0; in1 = 0; + tst_check_eqz = 1; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 0; #1 exp_res = 1; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 0; ltz = 0; in1 = 1; + tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 1; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 0; ltz = 1; in1 = 1; + tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 1; tst_in1 = 1; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 1; ltz = 0; in1 = 1; + tst_check_eqz = 0; tst_check_gtz = 1; tst_check_ltz = 0; tst_in1 = 1; #1 exp_res = 1; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 1; gtz = 0; ltz = 0; in1 = 1; + tst_check_eqz = 1; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = 1; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 0; ltz = 0; in1 = -1; + tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = -1; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 0; ltz = 1; in1 = -1; + tst_check_eqz = 0; tst_check_gtz = 0; tst_check_ltz = 1; tst_in1 = -1; #1 exp_res = 1; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 0; gtz = 1; ltz = 0; in1 = -1; + tst_check_eqz = 0; tst_check_gtz = 1; tst_check_ltz = 0; tst_in1 = -1; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 - eqz = 1; gtz = 0; ltz = 0; in1 = -1; + tst_check_eqz = 1; tst_check_gtz = 0; tst_check_ltz = 0; tst_in1 = -1; #1 exp_res = 0; - assert(res == exp_res) - else $error("Expected %d, but got %d", exp_res, res); + assert(tst_result == exp_res) + else $error("Expected %d, but got %d", exp_res, tst_result); #1 $finish(); |
