Elaborate system elab tasks in gen blocks

This commit is contained in:
Cary R 2023-12-28 15:06:20 -08:00
parent 7fb1cabdbb
commit cc829031ff
4 changed files with 35 additions and 18 deletions

View File

@ -6821,26 +6821,29 @@ bool PGenerate::elaborate_direct_(Design*des, NetScope*container) const
bool PGenerate::elaborate_(Design*des, NetScope*scope) const bool PGenerate::elaborate_(Design*des, NetScope*scope) const
{ {
elaborate_functions(des, scope, funcs); // Elaborate the elaboration tasks.
elaborate_tasks(des, scope, tasks); bool result_flag = true;
for (const auto et : elab_tasks) {
typedef list<PGate*>::const_iterator gates_it_t; result_flag &= et->elaborate_elab(des, scope);
for (gates_it_t cur = gates.begin() ; cur != gates.end() ; ++ cur ) // Only elaborate until a fatal elab task.
(*cur)->elaborate(des, scope); if (!result_flag) break;
elaborate_var_inits_(des, scope);
typedef list<PProcess*>::const_iterator proc_it_t;
for (proc_it_t cur = behaviors.begin(); cur != behaviors.end(); ++ cur )
(*cur)->elaborate(des, scope);
typedef list<PGenerate*>::const_iterator generate_it_t;
for (generate_it_t cur = generate_schemes.begin()
; cur != generate_schemes.end() ; ++ cur ) {
(*cur)->elaborate(des, scope);
} }
return true; // If there are no fatal elab tasks then elaborate the rest.
if (result_flag) {
elaborate_functions(des, scope, funcs);
elaborate_tasks(des, scope, tasks);
for (const auto gt : gates) gt->elaborate(des, scope);
elaborate_var_inits_(des, scope);
for (const auto bh : behaviors) bh->elaborate(des, scope);
for (const auto gs : generate_schemes) gs->elaborate(des, scope);
}
return result_flag;
} }
bool PScope::elaborate_behaviors_(Design*des, NetScope*scope) const bool PScope::elaborate_behaviors_(Design*des, NetScope*scope) const

View File

@ -0,0 +1,8 @@
module test;
if (1) begin
$error("This is before the fatal so it should display.");
$fatal(0, "This should be a fatal elaboration error.");
$error("This should not display since is after the fatal.");
end
initial $fatal(0, "FAILED elaboration assertion.");
endmodule

View File

@ -24,6 +24,7 @@ br_gh383d vvp_tests/br_gh383d.json
br_gh440 vvp_tests/br_gh440.json br_gh440 vvp_tests/br_gh440.json
br_gh939 vvp_tests/br_gh939.json br_gh939 vvp_tests/br_gh939.json
br_gh1018 vvp_tests/br_gh1018.json br_gh1018 vvp_tests/br_gh1018.json
br_gh1029 vvp_tests/br_gh1029.json
ca_time_real` vvp_tests/ca_time_real.json ca_time_real` vvp_tests/ca_time_real.json
case1 vvp_tests/case1.json case1 vvp_tests/case1.json
case2 vvp_tests/case2.json case2 vvp_tests/case2.json

View File

@ -0,0 +1,5 @@
{
"type" : "CE",
"source" : "br_gh1029.v",
"iverilog-args" : [ "-g2009" ]
}