From 9ee3c82ab5a0b59eef5c91181dd282e7f5bcac61 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 4 Dec 2017 03:39:59 +0100 Subject: simul: WIP for nested packages. --- src/vhdl/simulate/simul-elaboration.adb | 2 +- src/vhdl/simulate/simul-execution.adb | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/simulate/simul-elaboration.adb b/src/vhdl/simulate/simul-elaboration.adb index bd4d3f875..9b0061822 100644 --- a/src/vhdl/simulate/simul-elaboration.adb +++ b/src/vhdl/simulate/simul-elaboration.adb @@ -2749,7 +2749,7 @@ package body Simul.Elaboration is Instance := Create_Block_Instance (Parent_Instance, Arch, Stmt); Instance.Block_Scope := Get_Info (Entity); - Instance.Up_Block := null; -- Packages_Instance; + Instance.Up_Block := Global_Instances; -- LRM93 §12.1 -- Elaboration of a block statement involves first elaborating each not diff --git a/src/vhdl/simulate/simul-execution.adb b/src/vhdl/simulate/simul-execution.adb index 7876c04ba..c8320ecf0 100644 --- a/src/vhdl/simulate/simul-execution.adb +++ b/src/vhdl/simulate/simul-execution.adb @@ -94,8 +94,12 @@ package body Simul.Execution is raise Internal_Error; end; when Kind_Package => - pragma Assert (Scope.Pkg_Parent = Global_Info); - return Global_Instances.Objects (Scope.Pkg_Slot).Instance; + declare + Parent : Block_Instance_Acc; + begin + Parent := Get_Instance_By_Scope (Instance, Scope.Pkg_Parent); + return Parent.Objects (Scope.Pkg_Slot).Instance; + end; when others => raise Internal_Error; end case; -- cgit v1.2.3