Fix for br967 - allow real value for repeat statement loop length.

This commit is contained in:
Martin Whitaker 2014-12-13 19:50:33 +00:00
parent 6aa8e49b09
commit ce5c4ca8ba
1 changed files with 4 additions and 0 deletions

View File

@ -5013,6 +5013,10 @@ NetProc* PRepeat::elaborate(Design*des, NetScope*scope) const
des->errors += 1;
return 0;
}
// If the expression is real, convert to an integer. 64 bits
// should be more enough for any real use case.
if (expr->expr_type() == IVL_VT_REAL)
expr = cast_to_int4(expr, 64);
NetProc*stat = statement_->elaborate(des, scope);
if (stat == 0) return 0;