aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-05 08:00:01 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-05 22:19:10 +0100
commit52668283c49c40190f68d1ea225ee3496d44d58e (patch)
tree9cbf3040ce08580314b2696a4fb0214353759874 /src
parent26b0d55583c1454ad32d17d262d2b4577d0bf6c5 (diff)
downloadghdl-52668283c49c40190f68d1ea225ee3496d44d58e.tar.gz
ghdl-52668283c49c40190f68d1ea225ee3496d44d58e.tar.bz2
ghdl-52668283c49c40190f68d1ea225ee3496d44d58e.zip
synth: handle generic mapped packages
Diffstat (limited to 'src')
-rw-r--r--src/synth/elab-vhdl_annotations.adb3
-rw-r--r--src/synth/elab-vhdl_insts.adb9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/synth/elab-vhdl_annotations.adb b/src/synth/elab-vhdl_annotations.adb
index d5eb0eb63..9475ac940 100644
--- a/src/synth/elab-vhdl_annotations.adb
+++ b/src/synth/elab-vhdl_annotations.adb
@@ -372,7 +372,8 @@ package body Elab.Vhdl_Annotations is
-- Create an info on the interface_type_definition.
-- This is needed for a generic type in an entity, as the
-- nodes are not instantiated.
- Create_Object_Info (Block_Info, Get_Type (Decl));
+ Create_Object_Info
+ (Block_Info, Get_Interface_Type_Definition (Decl));
when Iir_Kinds_Interface_Subprogram_Declaration =>
-- Macro-expanded
null;
diff --git a/src/synth/elab-vhdl_insts.adb b/src/synth/elab-vhdl_insts.adb
index c1c8fe371..48893f38b 100644
--- a/src/synth/elab-vhdl_insts.adb
+++ b/src/synth/elab-vhdl_insts.adb
@@ -171,7 +171,7 @@ package body Elab.Vhdl_Insts is
end if;
Act_Typ := Unshare (Act_Typ, Instance_Pool);
Create_Subtype_Object
- (Sub_Inst, Get_Type (Inter), Act_Typ);
+ (Sub_Inst, Get_Interface_Type_Definition (Inter), Act_Typ);
Release_Expr_Pool (Marker);
end;
@@ -193,6 +193,7 @@ package body Elab.Vhdl_Insts is
procedure Elab_Package_Declaration
(Parent_Inst : Synth_Instance_Acc; Pkg : Node)
is
+ Header : constant Node := Get_Package_Header (Pkg);
Syn_Inst : Synth_Instance_Acc;
begin
if Is_Uninstantiated_Package (Pkg) then
@@ -202,6 +203,12 @@ package body Elab.Vhdl_Insts is
Syn_Inst := Create_Package_Instance (Parent_Inst, Pkg);
+ if Header /= Null_Node then
+ Elab_Generics_Association
+ (Syn_Inst, Parent_Inst,
+ Get_Generic_Chain (Header), Get_Generic_Map_Aspect_Chain (Header));
+ end if;
+
Elab_Declarations (Syn_Inst, Get_Declaration_Chain (Pkg));
if Pkg = Vhdl.Std_Package.Standard_Package then
Elab_Convertible_Declarations (Syn_Inst);