aboutsummaryrefslogtreecommitdiffstats
path: root/tests/simple
diff options
context:
space:
mode:
Diffstat (limited to 'tests/simple')
-rw-r--r--tests/simple/mem2reg.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/simple/mem2reg.v b/tests/simple/mem2reg.v
index b1ab04d62..23094c10a 100644
--- a/tests/simple/mem2reg.v
+++ b/tests/simple/mem2reg.v
@@ -59,3 +59,25 @@ always @(posedge clk)
assign dout_b = dint_c[3];
endmodule
+// ------------------------------------------------------
+
+module mem2reg_test4(result1, result2, result3);
+ output signed [9:0] result1;
+ output signed [9:0] result2;
+ output signed [9:0] result3;
+
+ wire signed [9:0] intermediate [0:3];
+
+ function integer depth2Index;
+ input integer depth;
+ depth2Index = depth;
+ endfunction
+
+ assign intermediate[depth2Index(1)] = 1;
+ assign intermediate[depth2Index(2)] = 2;
+ assign intermediate[3] = 3;
+ assign result1 = intermediate[1];
+ assign result2 = intermediate[depth2Index(2)];
+ assign result3 = intermediate[depth2Index(3)];
+endmodule
+