diff options
author | Clifford Wolf <clifford@clifford.at> | 2016-08-21 13:23:58 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2016-08-21 13:23:58 +0200 |
commit | 82a4a0230feedd994546ad57a1f4ae79b8f80136 (patch) | |
tree | 070e0753a17f8e146c6a6c40ad2bb9a4e556ad5e /tests/simple | |
parent | dbdd8927e78622885bc85c429e783b89b2d3022d (diff) | |
download | yosys-82a4a0230feedd994546ad57a1f4ae79b8f80136.tar.gz yosys-82a4a0230feedd994546ad57a1f4ae79b8f80136.tar.bz2 yosys-82a4a0230feedd994546ad57a1f4ae79b8f80136.zip |
Another bugfix in mem2reg code
Diffstat (limited to 'tests/simple')
-rw-r--r-- | tests/simple/mem2reg.v | 22 |
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 + |