From 421810c715dc3370815f5362ade1b2d1a5632747 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 1 Feb 2023 21:16:12 +0100 Subject: translate: improve support for Flag_Elaboration --- src/vhdl/translate/trans-chap2.adb | 10 +++++++++- src/vhdl/translate/trans-chap9.adb | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb index 27e556609..2aac3e4f3 100644 --- a/src/vhdl/translate/trans-chap2.adb +++ b/src/vhdl/translate/trans-chap2.adb @@ -1011,6 +1011,10 @@ package body Trans.Chap2 is Final : Boolean; Constr : O_Assoc_List; begin + if not Flag_Elaboration and not Is_Nested then + return; + end if; + if not Is_Nested then Start_Subprogram_Body (Info.Package_Elab_Spec_Subprg); Push_Local_Factory; @@ -1044,7 +1048,7 @@ package body Trans.Chap2 is Chap4.Elab_Declaration_Chain (Spec, Final); pragma Unreferenced (Final); - if not Is_Nested then + if not Is_Nested and then Flag_Elaboration then Close_Temp; Subprgs.Finish_Subprg_Instance_Use (Info.Package_Elab_Spec_Instance); @@ -1067,6 +1071,10 @@ package body Trans.Chap2 is return; end if; + if not Flag_Elaboration and not Is_Nested_Package (Spec) then + return; + end if; + if Is_Spec_Decl and then Is_Uninstantiated_Package (Spec) then Set_Scope_Via_Field (Info.Package_Spec_Scope, Info.Package_Spec_Field, diff --git a/src/vhdl/translate/trans-chap9.adb b/src/vhdl/translate/trans-chap9.adb index b1c7205a7..4e5b54023 100644 --- a/src/vhdl/translate/trans-chap9.adb +++ b/src/vhdl/translate/trans-chap9.adb @@ -400,7 +400,7 @@ package body Trans.Chap9 is New_Lit (Ghdl_Index_0)), New_Lit (Std_Boolean_True_Node)); - -- Set flase to the other states. + -- Set false to the other states. New_Assign_Stmt (New_Obj (Var_I), New_Lit (Ghdl_Index_1)); Start_Loop_Stmt (Label); Gen_Exit_When -- cgit v1.2.3