Fix width of localparam created from genvar when using -gstrict-expr-width.

(cherry picked from commit c4883da334)
This commit is contained in:
Martin Whitaker 2020-10-01 11:33:24 +01:00
parent 84b4ebee0c
commit 59b67b69f6
1 changed files with 5 additions and 1 deletions

View File

@ -966,7 +966,11 @@ bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
// block. Code within this scope thus has access to the
// genvar as a constant.
{
verinum genvar_verinum(genvar);
verinum genvar_verinum;
if (gn_strict_expr_width_flag)
genvar_verinum = verinum(genvar, integer_width);
else
genvar_verinum = verinum(genvar);
genvar_verinum.has_sign(true);
NetEConstParam*gp = new NetEConstParam(scope,
loop_index,