From 3b91a227913d63d553c23328aef494ffb81d780d Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Mon, 22 Nov 2010 18:55:27 -0800 Subject: [PATCH] Get the width of an enumeration name right during elaboration. --- elab_scope.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elab_scope.cc b/elab_scope.cc index 7c5f93194..4ebde70e5 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -237,7 +237,9 @@ static void elaborate_scope_enumeration(Design*des, NetScope*scope, if (cur->parm) { // There is an explicit value. elaborate/evaluate // the value and assign it to the enumeration name. - NetExpr*val = elab_and_eval(des, scope, cur->parm, -1); + NetExpr*val = elab_and_eval(des, scope, cur->parm, + use_enum->base_width(), + use_enum->base_width()); NetEConst*val_const = dynamic_cast (val); if (val_const == 0) { cerr << "<>:0: error: Enumeration expression is not constant." << endl;