V0.9:Don't pad a real argument to a user task.

The compiler was incorrectly padding real arguments to tasks if they were
assigned to vectored arguments greater than 1 bit wide. This was asserting
for some cases and generating incorrect code for others.
This commit is contained in:
Cary R 2011-12-05 19:06:06 -08:00
parent c60877999c
commit 0fa7764eac
1 changed files with 8 additions and 4 deletions

View File

@ -2790,11 +2790,15 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const
des->errors += 1;
continue;
}
if (wid > rv->expr_width()) {
rv->set_width(wid);
rv = pad_to_width(rv, wid, *this);
/* Don't pad real values, they will be converted in the
* assignment below. */
if (rv->expr_type() != IVL_VT_REAL) {
if (wid > rv->expr_width()) {
rv->set_width(wid);
rv = pad_to_width(rv, wid, *this);
}
ivl_assert(*this, rv->expr_width() >= wid);
}
ivl_assert(*this, rv->expr_width() >= wid);
NetAssign*pr = new NetAssign(lv, rv);
block->append(pr);