summaryrefslogtreecommitdiff
path: root/nandgame/logic_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/logic_unit_tb.sv
parente49b8a787f72daa3d08e278a9c32663c16531827 (diff)
Rename variables to be more clear, document
Diffstat (limited to 'nandgame/logic_unit_tb.sv')
-rw-r--r--nandgame/logic_unit_tb.sv45
1 files changed, 22 insertions, 23 deletions
diff --git a/nandgame/logic_unit_tb.sv b/nandgame/logic_unit_tb.sv
index 3f50ce2..95211c1 100644
--- a/nandgame/logic_unit_tb.sv
+++ b/nandgame/logic_unit_tb.sv
@@ -4,16 +4,15 @@
module logic_unit_tb;
-logic [15:0] in1;
-logic [15:0] in2;
-LogicCode opcode;
-logic [15:0] result;
+logic [15:0] tst_in1, tst_in2;
+LogicCode tst_opcode;
+logic [15:0] tst_result;
logic_unit uut (
- .X(in1),
- .Y(in2),
- .operation(opcode),
- .RES(result)
+ .X_in(tst_in1),
+ .Y_in(tst_in2),
+ .logic_operation_in(tst_opcode),
+ .result_out(tst_result)
);
string filename;
@@ -28,28 +27,28 @@ initial begin
end
initial begin
- in1 = 16'b1010;
- in2 = 16'b1100;
- opcode = LOGIC_AND;
+ tst_in1 = 16'b1010;
+ tst_in2 = 16'b1100;
+ tst_opcode = LOGIC_AND;
#1
- assert(result == 16'b1000);
+ assert(tst_result == 16'b1000);
#1
- in1 = 16'b1010;
- in2 = 16'b1100;
- opcode = LOGIC_OR;
+ tst_in1 = 16'b1010;
+ tst_in2 = 16'b1100;
+ tst_opcode = LOGIC_OR;
#1
- assert(result == 16'b1110);
+ assert(tst_result == 16'b1110);
#1
- in1 = 16'b1010;
- in2 = 16'b1100;
- opcode = LOGIC_XOR;
+ tst_in1 = 16'b1010;
+ tst_in2 = 16'b1100;
+ tst_opcode = LOGIC_XOR;
#1
- assert(result == 16'b0110);
+ assert(tst_result == 16'b0110);
#1
- in1 = 16'b1010101010101010;
- opcode = LOGIC_NEGT;
+ tst_in1 = 16'b1010101010101010;
+ tst_opcode = LOGIC_NEGT;
#1
- assert(result == 16'b0101010101010101);
+ assert(tst_result == 16'b0101010101010101);
#1
$finish();
end