diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-11-24 07:26:51 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-11-24 07:26:51 +0100 |
commit | d4708cc345e3c0a11c33e1ec197285229d1fd113 (patch) | |
tree | 5dc7450fa268a34e83b262e5b54a91e9b185e07c /src/vhdl | |
parent | 1474383160069468694f2e64920ce968a80d58ab (diff) | |
download | ghdl-d4708cc345e3c0a11c33e1ec197285229d1fd113.tar.gz ghdl-d4708cc345e3c0a11c33e1ec197285229d1fd113.tar.bz2 ghdl-d4708cc345e3c0a11c33e1ec197285229d1fd113.zip |
trans-rtis: take into account instances in the count of packages.
rtis: check number of packages.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/translate/trans-rtis.adb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/vhdl/translate/trans-rtis.adb b/src/vhdl/translate/trans-rtis.adb index 00ee0a0ee..7a1baf407 100644 --- a/src/vhdl/translate/trans-rtis.adb +++ b/src/vhdl/translate/trans-rtis.adb @@ -2930,6 +2930,7 @@ package body Trans.Rtis is Unit : Iir_Design_Unit; Lib : Iir_Library_Declaration; + Lib_Unit : Iir; Prev : Rti_Block; begin Push_Rti_Node (Prev); @@ -2943,10 +2944,20 @@ package body Trans.Rtis is Lib := Get_Library (Get_Design_File (Unit)); Generate_Library (Lib, True); - if Get_Kind (Get_Library_Unit (Unit)) = Iir_Kind_Package_Declaration - then - Nbr_Pkgs := Nbr_Pkgs + 1; - end if; + -- Count the number of top-level packages. + Lib_Unit := Get_Library_Unit (Unit); + case Get_Kind (Lib_Unit) is + when Iir_Kind_Package_Declaration => + Nbr_Pkgs := Nbr_Pkgs + 1; + when Iir_Kind_Package_Instantiation_Declaration => + if Get_Macro_Expanded_Flag + (Get_Uninstantiated_Package_Decl (Lib_Unit)) + then + Nbr_Pkgs := Nbr_Pkgs + 1; + end if; + when others => + null; + end case; end loop; Pop_Rti_Node (Prev); |