summaryrefslogtreecommitdiff
path: root/nandgame/cond_check_tb.sv
diff options
context:
space:
mode:
Diffstat (limited to 'nandgame/cond_check_tb.sv')
-rw-r--r--nandgame/cond_check_tb.sv88
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();