From 4ac2b03fb79b40080dd3ae22788e543245eb0c28 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 1 Jan 2023 18:37:47 +0100 Subject: simul: handle nested packages --- src/simul/simul-vhdl_elab.adb | 6 +++++- src/synth/elab-vhdl_decls.adb | 10 ++++++++++ src/synth/elab-vhdl_insts.ads | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/simul/simul-vhdl_elab.adb b/src/simul/simul-vhdl_elab.adb index 3f4d0af4f..8ac6c65cf 100644 --- a/src/simul/simul-vhdl_elab.adb +++ b/src/simul/simul-vhdl_elab.adb @@ -444,9 +444,13 @@ package body Simul.Vhdl_Elab is | Iir_Kind_Group_Declaration => null; - when Iir_Kind_Package_Instantiation_Declaration => + when Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Package_Declaration => -- TODO: signals in package ? null; + when Iir_Kind_Package_Body => + null; + when others => Error_Kind ("gather_processes_decl", Decl); end case; diff --git a/src/synth/elab-vhdl_decls.adb b/src/synth/elab-vhdl_decls.adb index 111e8f667..33aa08560 100644 --- a/src/synth/elab-vhdl_decls.adb +++ b/src/synth/elab-vhdl_decls.adb @@ -313,8 +313,18 @@ 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_Package_Declaration => + Vhdl_Insts.Elab_Package_Declaration (Syn_Inst, Decl); + when Iir_Kind_Package_Body => + declare + Spec : constant Node := Get_Package (Decl); + begin + Vhdl_Insts.Elab_Package_Body (Syn_Inst, Spec, Decl); + end; + 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 f0004cc35..7e64bb944 100644 --- a/src/synth/elab-vhdl_insts.ads +++ b/src/synth/elab-vhdl_insts.ads @@ -33,6 +33,10 @@ package Elab.Vhdl_Insts is Inter_Chain : Node; Assoc_Chain : Node); + procedure Elab_Package_Declaration + (Parent_Inst : Synth_Instance_Acc; Pkg : Node); + procedure Elab_Package_Body + (Parent_Inst : Synth_Instance_Acc; Pkg : Node; Bod : Node); procedure Elab_Package_Instantiation (Parent_Inst : Synth_Instance_Acc; Pkg : Node); -- cgit v1.2.3