forked from github/verilator
Fix X shift issue, bug772.
This commit is contained in:
parent
dcf351f847
commit
91e706ec1f
2
Changes
2
Changes
@ -9,7 +9,7 @@ indicates the contributor was also the author of the fix; Thanks!
|
||||
|
||||
*** Support SV 2012 package import before port list.
|
||||
|
||||
**** Fix huge shifts to zero with -Wno-WIDTH, bug765, bug766, bug768. [Clifford Wolf]
|
||||
**** Fix shift corner issues, bug765, bug766, bug768, bug772. [Clifford Wolf]
|
||||
|
||||
**** Fix gate primitives with arrays and non-arrayed pins.
|
||||
|
||||
|
@ -274,6 +274,8 @@ private:
|
||||
// We can only get rid of a<<b>>c or a<<b<<c, with constant b & c
|
||||
// because bits may be masked in that process, or (b+c) may exceed the word width.
|
||||
if (!(nodep->rhsp()->castConst() && lhsp->rhsp()->castConst())) return false;
|
||||
if (nodep->rhsp()->castConst()->num().isFourState()
|
||||
|| lhsp->rhsp()->castConst()->num().isFourState()) return false;
|
||||
if (nodep->width()!=lhsp->width()) return false;
|
||||
if (nodep->width()!=lhsp->lhsp()->width()) return false;
|
||||
return true;
|
||||
|
@ -133,6 +133,12 @@
|
||||
w4_u = $signed(5'd1 > w4_s-w4_s);
|
||||
`checkh(w4_u, 4'b1111);
|
||||
|
||||
// bug772
|
||||
w4_s = w4_u << 1 <<< 0/0;
|
||||
`ifndef VERILATOR // In v4 can't check value as not 4-state
|
||||
`checkh(w4_s, 4'bxxxx);
|
||||
`endif
|
||||
|
||||
if (fail) $stop;
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
|
Loading…
Reference in New Issue
Block a user