mirror of
https://github.com/verilator/verilator.git
synced 2025-04-05 12:12:39 +00:00
Fix shift width extension, broke recent commit, bug754.
This commit is contained in:
parent
adb39ceb98
commit
b631b5927b
@ -8,7 +8,7 @@ use strict;
|
||||
#======================================================================
|
||||
# main
|
||||
|
||||
eval `modulecmd perl add synopsys-vcs`;
|
||||
eval `modulecmd perl add synopsys-vcs_mx`;
|
||||
exec('vcs',@ARGV);
|
||||
|
||||
#######################################################################
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user