diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-18 14:56:41 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-18 14:56:41 +0100 |
commit | 3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3 (patch) | |
tree | a0e3af19cd9a0baaa67e0175e54fc296d44bf1e4 /src/vhdl | |
parent | d2c059cef84ee053813a9ade503e31598a9ad607 (diff) | |
download | ghdl-3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3.tar.gz ghdl-3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3.tar.bz2 ghdl-3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3.zip |
ghdl_simul: handle obsoleted and optionnal package body.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/simulate/elaboration.adb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/vhdl/simulate/elaboration.adb b/src/vhdl/simulate/elaboration.adb index 812688183..a2700cb6b 100644 --- a/src/vhdl/simulate/elaboration.adb +++ b/src/vhdl/simulate/elaboration.adb @@ -491,8 +491,18 @@ package body Elaboration is -- Load the body now, as it can add objects in the -- package instance. - Body_Design := Libraries.Load_Secondary_Unit - (Design, Null_Identifier, Design_Unit); + -- Don't try to load optionnal but obsolete package body. + Body_Design := Libraries.Find_Secondary_Unit + (Design, Null_Identifier); + if Body_Design /= Null_Iir + and then + (Get_Need_Body (Library_Unit) + or else Get_Date (Body_Design) /= Date_Obsolete) + then + Libraries.Load_Design_Unit (Body_Design, Design_Unit); + else + Body_Design := Null_Iir; + end if; -- First the packages on which DESIGN depends. Elaborate_Dependence (Design); @@ -1624,6 +1634,8 @@ package body Elaboration is if Arch = Null_Iir then Arch := Libraries.Get_Latest_Architecture (Get_Entity (Aspect)); + else + Arch := Strip_Denoting_Name (Arch); end if; Config := Get_Library_Unit (Get_Default_Configuration_Declaration (Arch)); |