Correctly handle negative genvar values.

During expression elaboration, genvar values were being erroneously
cast to unsigned values when creating a verinum for use in expression
evaluation.
This commit is contained in:
Martin Whitaker 2013-01-11 22:18:02 +00:00 committed by Cary R
parent f682d9cad1
commit 45bb1313e7
1 changed files with 1 additions and 0 deletions

View File

@ -2711,6 +2711,7 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
<< " is genvar with value " << scope->genvar_tmp_val
<< "." << endl;
verinum val (scope->genvar_tmp_val, expr_wid);
val.has_sign(true);
NetEConst*tmp = new NetEConst(val);
tmp->set_line(*this);
return tmp;