ivl: $ivlh_to_unsigned() also tests its argument width.

This commit is contained in:
Maciej Suminski 2015-03-27 20:39:58 +01:00
parent d5ffb55bfd
commit 83d721232d
1 changed files with 3 additions and 1 deletions

View File

@ -1078,7 +1078,7 @@ unsigned PECallFunction::test_width_sfunc_(Design*des, NetScope*scope,
if (name=="$ivlh_to_unsigned") {
ivl_assert(*this, parms_.size() == 2);
// The Icarus Verilog specific $ivl_unsigned() system
// The Icarus Verilog specific $ivlh_to_unsigned() system
// task takes a second argument which is the output
// size. This can be an arbitrary constant function.
PExpr*pexpr = parms_[1];
@ -1100,6 +1100,8 @@ unsigned PECallFunction::test_width_sfunc_(Design*des, NetScope*scope,
bool rc = eval_as_long(value, nexpr);
ivl_assert(*this, rc && value>=0);
parms_[0]->test_width(des, scope, mode);
expr_width_ = value;
signed_flag_= false;
return expr_width_;