Pad the R-value of a for loop initial assign like other assigns.

The for loop initial value R-value was not being padded correctly.
This code is a copy of the code used in a regular assignment.
This commit is contained in:
Cary R 2008-03-25 14:06:16 -07:00 committed by Stephen Williams
parent 12f8af645f
commit 7bc9742710
1 changed files with 9 additions and 0 deletions

View File

@ -2943,6 +2943,15 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const
assert(etmp->expr_width() >= lv->lwidth());
}
/* Based on the specific type of the l-value, do cleanup
processing on the r-value. */
if (etmp->expr_type() != IVL_VT_REAL) {
unsigned wid = count_lval_width(lv);
etmp->set_width(wid);
etmp = pad_to_width(etmp, wid);
assert(etmp->expr_width() >= wid);
}
NetAssign*init = new NetAssign(lv, etmp);
init->set_line(*this);