Fix shift width extension, broke recent commit, bug754.

This commit is contained in:
Wilson Snyder 2014-04-30 22:47:01 -04:00
parent adb39ceb98
commit b631b5927b
3 changed files with 9 additions and 3 deletions

View File

@ -8,7 +8,7 @@ use strict;
#======================================================================
# main
eval `modulecmd perl add synopsys-vcs`;
eval `modulecmd perl add synopsys-vcs_mx`;
exec('vcs',@ARGV);
#######################################################################

View File

@ -2231,14 +2231,14 @@ private:
}
AstNodeBiop* iterate_shift_final(AstNodeBiop* nodep, AstNUser* vup) {
// Nodep maybe edited
if (vup->c()->prelim()) {
if (vup->c()->final()) {
// ShiftRS converts to ShiftR, but not vice-versa
if (nodep->castShiftRS()) {
if (AstNodeBiop* newp=replaceWithUOrSVersion(nodep, nodep->isSigned())) { nodep=NULL;
nodep = newp; // Process new node instead
}
}
AstNodeDType* expDTypep = nodep->dtypep();
AstNodeDType* expDTypep = vup->c()->dtypeOverridep(nodep->dtypep());
AstNodeDType* subDTypep = expDTypep;
nodep->dtypeFrom(expDTypep);
iterateCheck(nodep,"LHS",nodep->lhsp(),CONTEXT,FINAL,subDTypep,EXTEND_EXP);

View File

@ -91,6 +91,12 @@ module t (/*AUTOARG*/);
w4_u = 5'b10000 / 5'b00100;
`checkh(w4_u, 4'b0100);
// bug754
w5_u = 4'sb0010 << -2'sd1; // << 3
`checkh(w5_u, 5'b10000); // VCS E-2014.03 bug
w5_u = 4'sb1000 << 0; // Sign extends
`checkh(w5_u, 5'b11000);
// Reals do not propagate to children
r = 1.0 + ( 1 + (1 / 2));
`checkf(r, 2.0);