Don't try to shrink a valid r-vlaue width.
In assignments, the expression width may be defined by the width of operands, and not that of the l-value. Choose whichever is creater and set (or pad) the expression to that width.
This commit is contained in:
parent
cc9e3d1536
commit
5cfe47da2b
|
|
@ -1954,9 +1954,11 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
} else {
|
||||
unsigned wid = count_lval_width(lv);
|
||||
if (wid > rv->expr_width()) {
|
||||
rv->set_width(wid);
|
||||
rv = pad_to_width(rv, wid);
|
||||
assert(rv->expr_width() >= wid);
|
||||
}
|
||||
ivl_assert(*this, rv->expr_width() >= wid);
|
||||
}
|
||||
|
||||
NetAssign*cur = new NetAssign(lv, rv);
|
||||
|
|
|
|||
Loading…
Reference in New Issue