From 3bfd159dc7eec540fcaea48bad24a2ba3b9e2fe3 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 18 Nov 2017 14:56:41 +0100 Subject: ghdl_simul: handle obsoleted and optionnal package body. --- src/vhdl/simulate/elaboration.adb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') 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)); -- cgit v1.2.3