Fix not in array context on non-power-of-two slices, msg2946.
This commit is contained in:
parent
a2c1b7f827
commit
d43e9aa2c5
2
Changes
2
Changes
|
|
@ -8,6 +8,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||||
|
|
||||||
**** Fix not reporting some duplicate signals/ports, bug1462. [Peter Gerst]
|
**** Fix not reporting some duplicate signals/ports, bug1462. [Peter Gerst]
|
||||||
|
|
||||||
|
**** Fix not in array context on non-power-of-two slices, msg2946. [Yu Sheng Lin]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 4.016 2016-06-16
|
* Verilator 4.016 2016-06-16
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,8 @@ private:
|
||||||
condp->deleteTree();
|
condp->deleteTree();
|
||||||
}
|
}
|
||||||
else if (!lvalue
|
else if (!lvalue
|
||||||
&& !VN_IS(nodep->backp(), ArraySel)) { // Too complicated and slow if mid-multidimension
|
// Making a scalar would break if we're making an array
|
||||||
|
&& !VN_IS(nodep->dtypep()->skipRefp(), NodeArrayDType)) {
|
||||||
// ARRAYSEL(...) -> COND(LT(bit<maxbit), ARRAYSEL(...), {width{1'bx}})
|
// ARRAYSEL(...) -> COND(LT(bit<maxbit), ARRAYSEL(...), {width{1'bx}})
|
||||||
AstNRelinker replaceHandle;
|
AstNRelinker replaceHandle;
|
||||||
nodep->unlinkFrBack(&replaceHandle);
|
nodep->unlinkFrBack(&replaceHandle);
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,8 @@ module t (/*AUTOARG*/
|
||||||
int A [7][1], B [8][1];
|
int A [7][1], B [8][1];
|
||||||
int a [1], b [1];
|
int a [1], b [1];
|
||||||
always_ff @(posedge clk) begin
|
always_ff @(posedge clk) begin
|
||||||
`ifdef verilator // msg2946
|
|
||||||
`define WORK_AROUND
|
|
||||||
`endif
|
|
||||||
`ifdef WORK_AROUND
|
|
||||||
a <= A[0];
|
|
||||||
b <= B[crc[2:0]];
|
|
||||||
`else
|
|
||||||
a <= A[crc[2:0]];
|
a <= A[crc[2:0]];
|
||||||
b <= B[0];
|
b <= B[crc[2:0]];
|
||||||
`endif
|
|
||||||
end
|
end
|
||||||
wire [63:0] result = {a[0], b[0]};
|
wire [63:0] result = {a[0], b[0]};
|
||||||
|
|
||||||
|
|
@ -67,7 +59,7 @@ module t (/*AUTOARG*/
|
||||||
$write("[%0t] cyc==%0d crc=%x sum=%x\n",$time, cyc, crc, sum);
|
$write("[%0t] cyc==%0d crc=%x sum=%x\n",$time, cyc, crc, sum);
|
||||||
if (crc !== 64'hc77bb9b3784ea091) $stop;
|
if (crc !== 64'hc77bb9b3784ea091) $stop;
|
||||||
// What checksum will we end up with (above print should match)
|
// What checksum will we end up with (above print should match)
|
||||||
`define EXPECTED_SUM 64'had01cfb7e84da129
|
`define EXPECTED_SUM 64'h619f75c3a6d948bd
|
||||||
if (sum !== `EXPECTED_SUM) $stop;
|
if (sum !== `EXPECTED_SUM) $stop;
|
||||||
$write("*-* All Finished *-*\n");
|
$write("*-* All Finished *-*\n");
|
||||||
$finish;
|
$finish;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue