mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-08 04:20:49 +02:00
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:
+5
-3
@@ -1954,9 +1954,11 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
|
||||
|
||||
} else {
|
||||
unsigned wid = count_lval_width(lv);
|
||||
rv->set_width(wid);
|
||||
rv = pad_to_width(rv, wid);
|
||||
assert(rv->expr_width() >= wid);
|
||||
if (wid > rv->expr_width()) {
|
||||
rv->set_width(wid);
|
||||
rv = pad_to_width(rv, wid);
|
||||
}
|
||||
ivl_assert(*this, rv->expr_width() >= wid);
|
||||
}
|
||||
|
||||
NetAssign*cur = new NetAssign(lv, rv);
|
||||
|
||||
Reference in New Issue
Block a user