summaryrefslogtreecommitdiff
path: root/nandgame/comb_mem_tb.sv
diff options
context:
space:
mode:
Diffstat (limited to 'nandgame/comb_mem_tb.sv')
-rw-r--r--nandgame/comb_mem_tb.sv52
1 files changed, 26 insertions, 26 deletions
diff --git a/nandgame/comb_mem_tb.sv b/nandgame/comb_mem_tb.sv
index 66a5e64..a5646b8 100644
--- a/nandgame/comb_mem_tb.sv
+++ b/nandgame/comb_mem_tb.sv
@@ -2,20 +2,20 @@
module comb_mem_tb;
-reg clk_i;
-logic wa, wd, wpa;
-logic [15:0] o_a, o_d, o_pa;
-logic [15:0] X;
+reg tst_clk;
+logic tst_write_A, tst_write_D, tst_write_pA;
+logic [15:0] tst_reg_A, tst_reg_D, tst_reg_pA;
+logic [15:0] tst_X;
comb_mem uut (
- .cl(clk_i),
- .a_i(wa),
- .d_i(wd),
- .pa_i(wpa),
- .A_o(o_a),
- .D_o(o_d),
- .pA_o(o_pa),
- .X(X)
+ .clk_in(tst_clk),
+ .store_to_a_in(tst_write_A),
+ .store_to_d_in(tst_write_D),
+ .store_to_pa_in(tst_write_pA),
+ .reg_A_out(tst_reg_A),
+ .reg_D_out(tst_reg_D),
+ .reg_pA_out(tst_reg_pA),
+ .X_in(tst_X)
);
string filename;
@@ -27,25 +27,25 @@ initial begin
`endif
$dumpfile(filename);
$dumpvars();
- clk_i = 0;
- wa = 0; wd = 0; wpa = 0;
- X = 16'h55;
+ tst_clk = 0;
+ tst_write_A = 0; tst_write_D = 0; tst_write_pA = 0;
+ tst_X = 16'h55;
end
-always #10 clk_i = ~clk_i;
+always #10 tst_clk = ~tst_clk;
initial begin
- repeat(3) @(posedge clk_i);
- wa = 1;
- repeat(3) @(posedge clk_i);
- wa = 0;
- wd = 1;
- repeat(3) @(posedge clk_i);
- wd = 0;
- wpa = 1;
- X = 16'haa;
- repeat(3) @(posedge clk_i);
+ repeat(3) @(posedge tst_clk);
+ tst_write_A = 1;
+ repeat(3) @(posedge tst_clk);
+ tst_write_A = 0;
+ tst_write_D = 1;
+ repeat(3) @(posedge tst_clk);
+ tst_write_D = 0;
+ tst_write_pA = 1;
+ tst_X = 16'haa;
+ repeat(3) @(posedge tst_clk);
$finish();
end