From 7d6b391572e5ce694558ce663853664d03b70805 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sat, 13 Sep 2008 17:40:19 -0700 Subject: [PATCH] In continuous assignment, r-value is sized or lossless, never self determined. The r-value expression takes on at least the width of the l-value. If there is a sized width greater then the l-value width, take that on instead. But if the r-value is unsized, there are unsized sub-expressions that cause the expression as a whole to be unlimited width, so elaborate and evalulate the r-value as lossless. --- elaborate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elaborate.cc b/elaborate.cc index a2cb6e6c0..4e5b40220 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -110,7 +110,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const << ", unsized_flag=" << (unsized_flag?"true":"false") << endl; } - int expr_wid = unsized_flag? -1 : (int) use_width; + int expr_wid = unsized_flag? -2 : (int) use_width; NetExpr*rval_expr = elab_and_eval(des, scope, pin(1), expr_wid, lval->vector_width());