3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-30 07:53:16 +00:00

Another bugfix in mem2reg code

This commit is contained in:
Clifford Wolf 2016-08-21 13:23:58 +02:00
parent dbdd8927e7
commit 82a4a0230f
4 changed files with 53 additions and 7 deletions

View file

@ -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