From f3cb18343a77391a2c48fd21210e84773a059846 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Thu, 16 Oct 2008 08:47:11 -0700 Subject: [PATCH] Conditional test width Add the test_width call for PCondit expr_ Very similar to commit 5fdd9d8339b5960904f75d5ff9439b4711e37755 --- elaborate.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/elaborate.cc b/elaborate.cc index e86f79ef3..19e6d5894 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -2238,6 +2238,16 @@ NetProc* PCondit::elaborate(Design*des, NetScope*scope) const cerr << get_fileline() << ": debug: Elaborate condition statement" << " with conditional: " << *expr_ << endl; + // Run a test-width on the shift amount so that its types are + // worked out for elaboration later on. + ivl_variable_type_t rtype = IVL_VT_NO_TYPE; + bool rflag = false; + unsigned expr_wid = expr_->test_width(des, scope, 0, 0, rtype, rflag); + if (debug_elaborate) + cerr << get_fileline() << ": debug: Test width of condition expression" + << " returns wid=" << expr_wid << ", type=" << rtype + << ", flag=" << rflag << endl; + // Elaborate and try to evaluate the conditional expression. NetExpr*expr = elab_and_eval(des, scope, expr_, -1); if (expr == 0) {