aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-12-07 05:58:08 +0100
committerTristan Gingold <tgingold@free.fr>2017-12-07 05:58:08 +0100
commitdd9836c89f15039137442ad0d882a403b96d89ff (patch)
tree21dce863fdbc97dbcf508e559cb9373259c425a1 /src
parent1a3509f18205c60beef329e806a639faf286c32a (diff)
downloadghdl-dd9836c89f15039137442ad0d882a403b96d89ff.tar.gz
ghdl-dd9836c89f15039137442ad0d882a403b96d89ff.tar.bz2
ghdl-dd9836c89f15039137442ad0d882a403b96d89ff.zip
simul: fix annotation of macro-expanded package instantiation.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/simul-annotations.adb21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/vhdl/simulate/simul-annotations.adb b/src/vhdl/simulate/simul-annotations.adb
index 920501744..6a21d3382 100644
--- a/src/vhdl/simulate/simul-annotations.adb
+++ b/src/vhdl/simulate/simul-annotations.adb
@@ -573,12 +573,23 @@ package body Simul.Annotations is
if Get_Kind (Decl) = Iir_Kind_Package_Instantiation_Declaration then
declare
- Uninst : constant Iir := Get_Uninstantiated_Package_Decl (Decl);
- Uninst_Info : constant Sim_Info_Acc := Get_Info (Uninst);
+ Bod : constant Iir := Get_Package_Body (Decl);
begin
- -- There is not corresponding body for an instantiation, so
- -- also add objects for the shared body.
- Package_Info.Nbr_Objects := Uninst_Info.Nbr_Objects;
+ if Bod /= Null_Iir then
+ Set_Info (Bod, Package_Info);
+ Annotate_Declaration_List
+ (Package_Info, Get_Declaration_Chain (Bod));
+ else
+ declare
+ Uninst : constant Iir :=
+ Get_Uninstantiated_Package_Decl (Decl);
+ Uninst_Info : constant Sim_Info_Acc := Get_Info (Uninst);
+ begin
+ -- There is not corresponding body for an instantiation, so
+ -- also add objects for the shared body.
+ Package_Info.Nbr_Objects := Uninst_Info.Nbr_Objects;
+ end;
+ end if;
end;
end if;
end Annotate_Package_Declaration;