Fix elaboration order in generate blocks.
Currently, localparam declarations inside generate blocks are elaborated after any nested generate constructs are elaborated. This prevents the localparams being used by the nested constructs. Reversing the elaboration order fixes this bug.
This commit is contained in:
parent
f36faa8ab3
commit
0d0e6d7845
|
|
@ -1091,6 +1091,12 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope)
|
||||||
scope->add_genvar((*cur).first, (*cur).second);
|
scope->add_genvar((*cur).first, (*cur).second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scan the localparams in this scope, and store the information
|
||||||
|
// needed to evaluate the parameter expressions. The expressions
|
||||||
|
// will be evaluated later, once all parameter overrides for this
|
||||||
|
// module have been done.
|
||||||
|
collect_scope_localparams_(des, scope, localparams);
|
||||||
|
|
||||||
// Scan the generated scope for nested generate schemes,
|
// Scan the generated scope for nested generate schemes,
|
||||||
// and *generate* new scopes, which is slightly different
|
// and *generate* new scopes, which is slightly different
|
||||||
// from simple elaboration.
|
// from simple elaboration.
|
||||||
|
|
@ -1101,12 +1107,6 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope)
|
||||||
(*cur) -> generate_scope(des, scope);
|
(*cur) -> generate_scope(des, scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan the localparams in this scope, and store the information
|
|
||||||
// needed to evaluate the parameter expressions. The expressions
|
|
||||||
// will be evaluated later, once all parameter overrides for this
|
|
||||||
// module have been done.
|
|
||||||
collect_scope_localparams_(des, scope, localparams);
|
|
||||||
|
|
||||||
// Scan through all the task and function declarations in this
|
// Scan through all the task and function declarations in this
|
||||||
// scope.
|
// scope.
|
||||||
elaborate_scope_tasks(des, scope, tasks);
|
elaborate_scope_tasks(des, scope, tasks);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue