From d4c62309eb176f7e19b86b058b3afec5ff023ed9 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Tue, 9 Dec 2008 21:52:15 -0800 Subject: [PATCH] Treat assignment into a task port exactly like blocking assignment. Reuse the code that the blocking assignment uses. This fixes makes the task port input assignment work better. --- elaborate.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index 5162e34d9..61a2a6ef9 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -2558,14 +2558,15 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const NetAssign_*lv = new NetAssign_(port); unsigned wid = count_lval_width(lv); + ivl_variable_type_t lv_type = lv->expr_type(); - ivl_variable_type_t tmp_type = IVL_VT_NO_TYPE; - bool flag = false; - parms_[idx]->test_width(des, scope, 0, wid, tmp_type, flag); + NetExpr*rv = elaborate_rval_expr(des, scope, lv_type, wid, parms_[idx]); + if (wid > rv->expr_width()) { + rv->set_width(wid); + rv = pad_to_width(rv, wid, *this); + } + ivl_assert(*this, rv->expr_width() >= wid); - NetExpr*rv = elab_and_eval(des, scope, parms_[idx], wid); - rv->set_width(wid); - rv = pad_to_width(rv, wid, *this); NetAssign*pr = new NetAssign(lv, rv); block->append(pr); }