aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-12-04 03:39:59 +0100
committerTristan Gingold <tgingold@free.fr>2017-12-04 03:39:59 +0100
commit9ee3c82ab5a0b59eef5c91181dd282e7f5bcac61 (patch)
treee483d05bb155102ae6b4f0ddaf176442e2d00e41 /src
parent57cc5b5215f018ac0e5d9c5c16a5ad7c39c67cf1 (diff)
downloadghdl-9ee3c82ab5a0b59eef5c91181dd282e7f5bcac61.tar.gz
ghdl-9ee3c82ab5a0b59eef5c91181dd282e7f5bcac61.tar.bz2
ghdl-9ee3c82ab5a0b59eef5c91181dd282e7f5bcac61.zip
simul: WIP for nested packages.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/simul-elaboration.adb2
-rw-r--r--src/vhdl/simulate/simul-execution.adb8
2 files changed, 7 insertions, 3 deletions
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;