From ce5c4ca8ba52b7d55918df4c7885d994fe68d7ab Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 13 Dec 2014 19:50:33 +0000 Subject: [PATCH] Fix for br967 - allow real value for repeat statement loop length. --- elaborate.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/elaborate.cc b/elaborate.cc index 95005c140..809ad68f3 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -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;