From 83f07243e90f7fd60516738f42a79d9f7cc01736 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 5 Dec 2017 18:35:17 +0100 Subject: simul: fix elaboration check for package. --- src/vhdl/simulate/simul-elaboration.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vhdl/simulate/simul-elaboration.adb b/src/vhdl/simulate/simul-elaboration.adb index 55e40bfa9..7547b3782 100644 --- a/src/vhdl/simulate/simul-elaboration.adb +++ b/src/vhdl/simulate/simul-elaboration.adb @@ -379,10 +379,14 @@ package body Simul.Elaboration is Package_Info : constant Sim_Info_Acc := Get_Info (Decl); Instance : Block_Instance_Acc; begin + if Block /= Global_Instances then + -- Packages in library unit can be elaborated in a different order. + Create_Object (Block, Package_Info.Pkg_Slot); + end if; + Instance := Create_Block_Instance (Block, Decl, Decl); pragma Assert (Block.Block_Scope = Package_Info.Pkg_Parent); - pragma Assert (Block.Objects (Package_Info.Pkg_Slot) = null); Block.Objects (Package_Info.Pkg_Slot) := Create_Instance_Value (Instance); -- cgit v1.2.3