diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-01-03 18:10:28 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-01-03 18:10:28 +0100 |
commit | f0dbb54419b7b6cbc8548ed4702ff057942c4cb3 (patch) | |
tree | e897f8557c7b0236f3b63cbb51676ab6c7d4efed /src/synth | |
parent | 8d512a44b79e8ef25183a4a06c5f6dfd0361d13b (diff) | |
download | ghdl-f0dbb54419b7b6cbc8548ed4702ff057942c4cb3.tar.gz ghdl-f0dbb54419b7b6cbc8548ed4702ff057942c4cb3.tar.bz2 ghdl-f0dbb54419b7b6cbc8548ed4702ff057942c4cb3.zip |
synth: handle package instantiation in declarations. Fix #1938
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/elab-vhdl_context.adb | 2 | ||||
-rw-r--r-- | src/synth/elab-vhdl_decls.adb | 3 | ||||
-rw-r--r-- | src/synth/elab-vhdl_insts.ads | 3 | ||||
-rw-r--r-- | src/synth/synth-vhdl_decls.adb | 5 |
4 files changed, 12 insertions, 1 deletions
diff --git a/src/synth/elab-vhdl_context.adb b/src/synth/elab-vhdl_context.adb index 8bf97e0c4..97a849d21 100644 --- a/src/synth/elab-vhdl_context.adb +++ b/src/synth/elab-vhdl_context.adb @@ -371,7 +371,7 @@ package body Elab.Vhdl_Context is null; else pragma Assert (Syn_Inst.Up_Block /= null); - Create_Object (Syn_Inst, Info.Slot, 1); + Create_Object (Syn_Inst, Info.Pkg_Slot, 1); end if; Syn_Inst.Objects (Info.Pkg_Slot) := (Kind => Obj_Instance, I_Inst => Inst); diff --git a/src/synth/elab-vhdl_decls.adb b/src/synth/elab-vhdl_decls.adb index 6c4091afd..f8a82be14 100644 --- a/src/synth/elab-vhdl_decls.adb +++ b/src/synth/elab-vhdl_decls.adb @@ -25,6 +25,7 @@ with Elab.Vhdl_Types; use Elab.Vhdl_Types; with Elab.Vhdl_Files; with Elab.Vhdl_Errors; use Elab.Vhdl_Errors; with Elab.Vhdl_Expr; use Elab.Vhdl_Expr; +with Elab.Vhdl_Insts; package body Elab.Vhdl_Decls is procedure Elab_Subprogram_Declaration @@ -260,6 +261,8 @@ package body Elab.Vhdl_Decls is null; when Iir_Kind_File_Declaration => Elab_File_Declaration (Syn_Inst, Decl); + when Iir_Kind_Package_Instantiation_Declaration => + Vhdl_Insts.Elab_Package_Instantiation (Syn_Inst, Decl); when Iir_Kind_Protected_Type_Body => null; when Iir_Kind_Psl_Default_Clock => diff --git a/src/synth/elab-vhdl_insts.ads b/src/synth/elab-vhdl_insts.ads index b85b3d23a..c7392685e 100644 --- a/src/synth/elab-vhdl_insts.ads +++ b/src/synth/elab-vhdl_insts.ads @@ -23,6 +23,9 @@ with Elab.Vhdl_Context; use Elab.Vhdl_Context; package Elab.Vhdl_Insts is function Elab_Top_Unit (Config : Node) return Synth_Instance_Acc; + procedure Elab_Package_Instantiation + (Parent_Inst : Synth_Instance_Acc; Pkg : Node); + procedure Elab_Component_Instantiation_Statement (Syn_Inst : Synth_Instance_Acc; Stmt : Node); procedure Elab_Design_Instantiation_Statement diff --git a/src/synth/synth-vhdl_decls.adb b/src/synth/synth-vhdl_decls.adb index 4265c1072..29b8b455a 100644 --- a/src/synth/synth-vhdl_decls.adb +++ b/src/synth/synth-vhdl_decls.adb @@ -738,6 +738,9 @@ package body Synth.Vhdl_Decls is when Iir_Kind_Signal_Attribute_Declaration => -- Not supported by synthesis. null; + when Iir_Kind_Package_Instantiation_Declaration => + -- TODO: also finalize ? + null; when others => Vhdl.Errors.Error_Kind ("finalize_declaration", Decl); end case; @@ -786,6 +789,8 @@ package body Synth.Vhdl_Decls is Synth_Concurrent_Object_Alias_Declaration (Syn_Inst, Decl); when Iir_Kind_Attribute_Specification => Synth_Concurrent_Attribute_Specification (Syn_Inst, Decl); + when Iir_Kind_Package_Instantiation_Declaration => + Synth_Package_Instantiation (Syn_Inst, Decl); when others => Vhdl.Errors.Error_Kind ("synth_concurrent_declaration", Decl); end case; |