From 0fa7764eac284101f782b5ad15d07cb4619379cf Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 5 Dec 2011 19:06:06 -0800 Subject: [PATCH] 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. --- elaborate.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index d77b9274f..1d36a80c7 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -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);