aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-18 14:56:41 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-18 14:56:41 +0100
commit3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3 (patch)
treea0e3af19cd9a0baaa67e0175e54fc296d44bf1e4 /src
parentd2c059cef84ee053813a9ade503e31598a9ad607 (diff)
downloadghdl-3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3.tar.gz
ghdl-3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3.tar.bz2
ghdl-3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3.zip
ghdl_simul: handle obsoleted and optionnal package body.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/elaboration.adb16
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));