aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-06-12 21:23:02 +0200
committerTristan Gingold <tgingold@free.fr>2019-06-12 21:23:02 +0200
commit4f310c7b94d495500dd3834a7bd5a56e641f36ae (patch)
treeabd5912139307734e452d35b6f113cac590c8fad /src/vhdl
parentfd836e03fbd809d870cee9de6bf58bac297af873 (diff)
downloadghdl-4f310c7b94d495500dd3834a7bd5a56e641f36ae.tar.gz
ghdl-4f310c7b94d495500dd3834a7bd5a56e641f36ae.tar.bz2
ghdl-4f310c7b94d495500dd3834a7bd5a56e641f36ae.zip
vhdl/simulate: fix regression wrt package instances.
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/simulate/simul-annotations.adb2
-rw-r--r--src/vhdl/simulate/simul-elaboration.adb8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/vhdl/simulate/simul-annotations.adb b/src/vhdl/simulate/simul-annotations.adb
index 53e1fb0f7..ddc2733c8 100644
--- a/src/vhdl/simulate/simul-annotations.adb
+++ b/src/vhdl/simulate/simul-annotations.adb
@@ -614,7 +614,7 @@ package body Simul.Annotations is
if Get_Kind (Decl) = Iir_Kind_Package_Instantiation_Declaration then
declare
- Bod : constant Iir := Get_Package_Body (Decl);
+ Bod : constant Iir := Get_Instance_Package_Body (Decl);
begin
if Bod /= Null_Iir then
Set_Info (Bod, Package_Info);
diff --git a/src/vhdl/simulate/simul-elaboration.adb b/src/vhdl/simulate/simul-elaboration.adb
index 1638aa721..c879d24b1 100644
--- a/src/vhdl/simulate/simul-elaboration.adb
+++ b/src/vhdl/simulate/simul-elaboration.adb
@@ -383,6 +383,7 @@ package body Simul.Elaboration is
Package_Info : constant Sim_Info_Acc := Get_Info (Decl);
Instance : Block_Instance_Acc;
Hdr : Iir;
+ Bod : Iir;
begin
if Block /= Global_Instances then
-- Packages in library unit can be elaborated in a different order.
@@ -418,17 +419,18 @@ package body Simul.Elaboration is
Elaborate_Declarative_Part (Instance, Get_Declaration_Chain (Decl));
if Get_Kind (Decl) = Iir_Kind_Package_Instantiation_Declaration then
+ Bod := Get_Instance_Package_Body (Decl);
-- Elaborate the body now.
- if Get_Package_Body (Decl) /= Null_Iir then
+ if Bod /= Null_Iir then
-- Macro-expanded.
Elaborate_Declarative_Part
- (Instance, Get_Declaration_Chain (Get_Package_Body (Decl)));
+ (Instance, Get_Declaration_Chain (Bod));
else
-- Shared body.
declare
Uninst : constant Iir := Get_Uninstantiated_Package_Decl (Decl);
- Bod : constant Iir := Get_Package_Body (Uninst);
begin
+ Bod := Get_Package_Body (Uninst);
Instance.Uninst_Scope := Get_Info (Uninst);
if Is_Valid (Bod) then
-- Body is optional.