aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-01 18:37:47 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-01 18:37:47 +0100
commit4ac2b03fb79b40080dd3ae22788e543245eb0c28 (patch)
treeab1de633317dbb0f9c94e6545cdbc4bf7f759651
parentb1542388032e3a1e4bdfdfe0ff42a2c8caad4e33 (diff)
downloadghdl-4ac2b03fb79b40080dd3ae22788e543245eb0c28.tar.gz
ghdl-4ac2b03fb79b40080dd3ae22788e543245eb0c28.tar.bz2
ghdl-4ac2b03fb79b40080dd3ae22788e543245eb0c28.zip
simul: handle nested packages
-rw-r--r--src/simul/simul-vhdl_elab.adb6
-rw-r--r--src/synth/elab-vhdl_decls.adb10
-rw-r--r--src/synth/elab-vhdl_insts.ads4
3 files changed, 19 insertions, 1 deletions
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);