Do not MSB extend constants that already have a defined width.
During elaboration certain constants were getting extended with the MSB. This patch makes that happen only if the constant does not have a length. At this point most should have a length so effectively every unsigned value is extended with 0.
This commit is contained in:
parent
ca49d7efa4
commit
3765f5f421
|
|
@ -267,10 +267,10 @@ bool NetEConst::set_width(unsigned w, bool last_chance)
|
|||
if (value_.has_sign()) {
|
||||
pad = value_.get(value_.len()-1);
|
||||
|
||||
} else if (value_.len() == 0) {
|
||||
pad = verinum::V0;
|
||||
|
||||
} else switch (value_.get(value_.len()-1)) {
|
||||
/* It appears that you always have a defined length here,
|
||||
* so this logic may be in error. */
|
||||
} else if (value_.len() != 0 && !value_.has_len())
|
||||
switch (value_.get(value_.len()-1)) {
|
||||
case verinum::V1:
|
||||
case verinum::V0:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue