aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-12-07 05:34:25 +0100
committerTristan Gingold <tgingold@free.fr>2017-12-07 05:34:25 +0100
commit15f7bb4666a446f6cd6bc3fd9cc3dab27747cf15 (patch)
tree39ea98738b030cfdf74718533a5fea709814ef03 /src
parent42641daafe6c448c24c6781e0c9876db8d377017 (diff)
downloadghdl-15f7bb4666a446f6cd6bc3fd9cc3dab27747cf15.tar.gz
ghdl-15f7bb4666a446f6cd6bc3fd9cc3dab27747cf15.tar.bz2
ghdl-15f7bb4666a446f6cd6bc3fd9cc3dab27747cf15.zip
simul: handle generic-mapped packages.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/simul-elaboration.adb15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/vhdl/simulate/simul-elaboration.adb b/src/vhdl/simulate/simul-elaboration.adb
index 586549b5c..52024833b 100644
--- a/src/vhdl/simulate/simul-elaboration.adb
+++ b/src/vhdl/simulate/simul-elaboration.adb
@@ -378,6 +378,7 @@ package body Simul.Elaboration is
is
Package_Info : constant Sim_Info_Acc := Get_Info (Decl);
Instance : Block_Instance_Acc;
+ Hdr : Iir;
begin
if Block /= Global_Instances then
-- Packages in library unit can be elaborated in a different order.
@@ -395,12 +396,18 @@ package body Simul.Elaboration is
"elaborating %n", (1 => +Decl));
end if;
- if Get_Kind (Decl) = Iir_Kind_Package_Instantiation_Declaration then
- Elaborate_Generic_Clause (Instance, Get_Generic_Chain (Decl));
+ case Iir_Kinds_Package_Declaration (Get_Kind (Decl)) is
+ when Iir_Kind_Package_Instantiation_Declaration =>
+ Hdr := Decl;
+ when Iir_Kind_Package_Declaration =>
+ Hdr := Get_Package_Header (Decl);
+ end case;
+ if Hdr /= Null_Iir then
+ Elaborate_Generic_Clause (Instance, Get_Generic_Chain (Hdr));
Elaborate_Generic_Map_Aspect
(Instance, Instance,
- Get_Generic_Chain (Decl),
- Get_Generic_Map_Aspect_Chain (Decl));
+ Get_Generic_Chain (Hdr),
+ Get_Generic_Map_Aspect_Chain (Hdr));
end if;
-- Elaborate objects declarations.