aboutsummaryrefslogtreecommitdiffstats
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
parent1a3509f18205c60beef329e806a639faf286c32a (diff)
downloadghdl-dd9836c89f15039137442ad0d882a403b96d89ff.tar.gz
ghdl-dd9836c89f15039137442ad0d882a403b96d89ff.tar.bz2
ghdl-dd9836c89f15039137442ad0d882a403b96d89ff.zip
simul: fix annotation of macro-expanded package instantiation.
-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;
113' href='#n113'>113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171