Fix cast-to-size context-determined sizing, bug828.
This commit is contained in:
parent
b73edc0564
commit
bfbca34eb0
2
Changes
2
Changes
|
|
@ -7,6 +7,8 @@ indicates the contributor was also the author of the fix; Thanks!
|
||||||
|
|
||||||
**** Fix generate unrolling with function call, bug830. [Steven Slatter]
|
**** Fix generate unrolling with function call, bug830. [Steven Slatter]
|
||||||
|
|
||||||
|
**** Fix cast-to-size context-determined sizing, bug828. [Geoff Barrett]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 3.864 2014-09-21
|
* Verilator 3.864 2014-09-21
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -931,7 +931,7 @@ private:
|
||||||
: nodep->findBitDType(width, width, underDtp->numeric()));
|
: nodep->findBitDType(width, width, underDtp->numeric()));
|
||||||
nodep->dtypep(newDtp);
|
nodep->dtypep(newDtp);
|
||||||
// We ignore warnings as that is sort of the point of a cast
|
// We ignore warnings as that is sort of the point of a cast
|
||||||
iterateCheck(nodep,"Cast LHS",nodep->lhsp(),SELF,FINAL,newDtp,EXTEND_EXP,false);
|
iterateCheck(nodep,"Cast LHS",nodep->lhsp(),CONTEXT,FINAL,newDtp,EXTEND_EXP,false);
|
||||||
}
|
}
|
||||||
if (vup->c()->final()) {
|
if (vup->c()->final()) {
|
||||||
// CastSize not needed once sizes determined
|
// CastSize not needed once sizes determined
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
reg [5:0] w6_u;
|
reg [5:0] w6_u;
|
||||||
reg [15:0] w16a_u;
|
reg [15:0] w16a_u;
|
||||||
reg [15:0] w16_u;
|
reg [15:0] w16_u;
|
||||||
|
reg [31:0] w32_u;
|
||||||
real r;
|
real r;
|
||||||
|
|
||||||
reg signed [4:0] bug754_a;
|
reg signed [4:0] bug754_a;
|
||||||
|
|
@ -162,6 +163,16 @@
|
||||||
w4_u = (w4_u >> w4_u) ^~ (w4_u >> w4_u);
|
w4_u = (w4_u >> w4_u) ^~ (w4_u >> w4_u);
|
||||||
`checkh(w4_u, 4'b1111);
|
`checkh(w4_u, 4'b1111);
|
||||||
|
|
||||||
|
// bug828
|
||||||
|
// verilator lint_off WIDTH
|
||||||
|
w32_u = 32'(signed'({4'b0001,5'b10000}) << 3);
|
||||||
|
`checkh(w32_u, 32'h0000_0180);
|
||||||
|
w32_u = 32'(signed'({4'b0011,5'b10000}) << 3);
|
||||||
|
`checkh(w32_u, 32'h0000_0380);
|
||||||
|
// verilator lint_on WIDTH
|
||||||
|
w32_u = 32'(signed'({4'b0011,5'b10000})) << 3; // Check no width warning
|
||||||
|
`checkh(w32_u, 32'h0000_0380);
|
||||||
|
|
||||||
if (fail) $stop;
|
if (fail) $stop;
|
||||||
$write("*-* All Finished *-*\n");
|
$write("*-* All Finished *-*\n");
|
||||||
$finish;
|
$finish;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue