diff --git a/elaborate.cc b/elaborate.cc index fe6f2f46b..abc12b2ca 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -1711,7 +1711,7 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const netlist. The compound statement is exactly equivalent. */ if (delay || event_) { - unsigned wid = lv->lwidth(); + unsigned wid = count_lval_width(lv); rv->set_width(wid); rv = pad_to_width(rv, wid); diff --git a/set_width.cc b/set_width.cc index 8b3257340..4aecfc849 100644 --- a/set_width.cc +++ b/set_width.cc @@ -413,8 +413,10 @@ bool NetETernary::set_width(unsigned w, bool last_chance) */ bool NetEUFunc::set_width(unsigned wid, bool) { - expr_width(wid); - return true; + if (result_sig_->expr_width() == wid) + return true; + else + return false; } bool NetEUnary::set_width(unsigned w, bool) diff --git a/tgt-stub/expression.c b/tgt-stub/expression.c index fe197c30a..500a82bab 100644 --- a/tgt-stub/expression.c +++ b/tgt-stub/expression.c @@ -82,8 +82,9 @@ static void show_function_call(ivl_expr_t net, unsigned ind) const char*vt = vt_type_string(net); unsigned idx; - fprintf(out, "%*s<%s %s function %s with %u arguments>\n", ind, "", - vt, sign, ivl_scope_name(def), ivl_expr_parms(net)); + fprintf(out, "%*s<%s %s function %s with %u arguments (width=%u)>\n", + ind, "", vt, sign, ivl_scope_name(def), ivl_expr_parms(net), + ivl_expr_width(net)); for (idx = 0 ; idx < ivl_expr_parms(net) ; idx += 1) show_expression(ivl_expr_parm(net,idx), ind+4);