fix double multipack conversion of Exprs in LHSs

This commit is contained in:
Zachary Snow
2020-03-24 22:02:38 -04:00
parent 78f3db8803
commit e7381c4db2
3 changed files with 36 additions and 7 deletions
+12
View File
@@ -0,0 +1,12 @@
module top;
logic [3:0][7:0] arr;
logic [3:0][1:0] idx;
assign idx = { 2'b01, 2'b11, 2'b00, 2'b10 };
initial begin
arr[idx[0]] = 8'hDE;
arr[idx[1]] = 8'hAD;
arr[idx[2]] = 8'hBE;
arr[idx[3]] = 8'hEF;
$display("%h", arr);
end
endmodule
+12
View File
@@ -0,0 +1,12 @@
module top;
reg [31:0] arr;
wire [7:0] idx;
assign idx = { 2'b01, 2'b11, 2'b00, 2'b10 };
initial begin
arr[idx[0 * 2 +: 2] * 8 +: 8] = 8'hDE;
arr[idx[1 * 2 +: 2] * 8 +: 8] = 8'hAD;
arr[idx[2 * 2 +: 2] * 8 +: 8] = 8'hBE;
arr[idx[3 * 2 +: 2] * 8 +: 8] = 8'hEF;
$display("%h", arr);
end
endmodule