From 7bc974271055f73d158e2aa1be991b894f347702 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 25 Mar 2008 14:06:16 -0700 Subject: [PATCH] Pad the R-value of a for loop initial assign like other assigns. The for loop initial value R-value was not being padded correctly. This code is a copy of the code used in a regular assignment. --- elaborate.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/elaborate.cc b/elaborate.cc index 4467b2d3a..ca957bc68 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -2943,6 +2943,15 @@ NetProc* PForStatement::elaborate(Design*des, NetScope*scope) const assert(etmp->expr_width() >= lv->lwidth()); } + /* Based on the specific type of the l-value, do cleanup + processing on the r-value. */ + if (etmp->expr_type() != IVL_VT_REAL) { + unsigned wid = count_lval_width(lv); + etmp->set_width(wid); + etmp = pad_to_width(etmp, wid); + assert(etmp->expr_width() >= wid); + } + NetAssign*init = new NetAssign(lv, etmp); init->set_line(*this);