summaryrefslogtreecommitdiff
path: root/nandgame/arith_unit_tb.sv
diff options
context:
space:
mode:
authoruvok2026-01-02 19:36:30 +0100
committeruvok2026-01-02 19:36:30 +0100
commit6c1db8cded8b8bb1c4d31a840f7dd9dddb8bbf7d (patch)
treee8bb18228b55baf35dd540cd6e607857e9ecbaef /nandgame/arith_unit_tb.sv
parente49b8a787f72daa3d08e278a9c32663c16531827 (diff)
Rename variables to be more clear, document
Diffstat (limited to 'nandgame/arith_unit_tb.sv')
-rw-r--r--nandgame/arith_unit_tb.sv64
1 files changed, 32 insertions, 32 deletions
diff --git a/nandgame/arith_unit_tb.sv b/nandgame/arith_unit_tb.sv
index 917a113..4c2a588 100644
--- a/nandgame/arith_unit_tb.sv
+++ b/nandgame/arith_unit_tb.sv
@@ -4,16 +4,16 @@
module arith_unit_tb;
-logic [15:0] in1;
-logic [15:0] in2;
-ArithCode opcode;
-logic [15:0] result;
+logic [15:0] tst_in1;
+logic [15:0] tst_in2;
+ArithCode tst_opcode;
+logic [15:0] tst_result;
arith_unit uut (
- .X(in1),
- .Y(in2),
- .operation(opcode),
- .RES(result)
+ .X_in(tst_in1),
+ .Y_in(tst_in2),
+ .arith_operation_in(tst_opcode),
+ .result_out(tst_result)
);
string filename;
@@ -28,41 +28,41 @@ initial begin
end
initial begin
- in1 = 13;
- in2 = 17;
- opcode = ARITH_PLUS;
+ tst_in1 = 13;
+ tst_in2 = 17;
+ tst_opcode = ARITH_PLUS;
#1
- assert(result == 30);
+ assert(tst_result == 30);
#1
- in1 = 12;
- in2 = 4;
- opcode = ARITH_MINUS;
+ tst_in1 = 12;
+ tst_in2 = 4;
+ tst_opcode = ARITH_MINUS;
#1
- assert(result == 8);
+ assert(tst_result == 8);
#1
- in1 = 12;
- in2 = 13;
- opcode = ARITH_MINUS;
+ tst_in1 = 12;
+ tst_in2 = 13;
+ tst_opcode = ARITH_MINUS;
#1
- assert(result == 16'hffff);
+ assert(tst_result == 16'hffff);
#1
- in1 = 13;
- in2 = 17;
- opcode = ARITH_INC;
+ tst_in1 = 13;
+ tst_in2 = 17;
+ tst_opcode = ARITH_INC;
#1
- assert(result == 14);
+ assert(tst_result == 14);
#1
- in1 = 13;
- in2 = 17;
- opcode = ARITH_DEC;
+ tst_in1 = 13;
+ tst_in2 = 17;
+ tst_opcode = ARITH_DEC;
#1
- assert(result == 12);
+ assert(tst_result == 12);
#1
- in1 = 0;
- in2 = 17;
- opcode = ARITH_DEC;
+ tst_in1 = 0;
+ tst_in2 = 17;
+ tst_opcode = ARITH_DEC;
#1
- assert(result == 16'hffff);
+ assert(tst_result == 16'hffff);
#1
$finish();
end