aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/simple/mem2reg.v8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/simple/mem2reg.v b/tests/simple/mem2reg.v
index 40f490b75..b1ab04d62 100644
--- a/tests/simple/mem2reg.v
+++ b/tests/simple/mem2reg.v
@@ -19,9 +19,9 @@ endmodule
// ------------------------------------------------------
-module mem2reg_test2(clk, mode, addr, data);
+module mem2reg_test2(clk, reset, mode, addr, data);
-input clk, mode;
+input clk, reset, mode;
input [2:0] addr;
output [3:0] data;
@@ -33,6 +33,10 @@ assign data = mem[addr];
integer i;
always @(posedge clk) begin
+ if (reset) begin
+ for (i=0; i<8; i=i+1)
+ mem[i] <= i;
+ end else
if (mode) begin
for (i=0; i<8; i=i+1)
mem[i] <= mem[i]+1;