aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/sem_specs.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-10-24 19:17:27 +0200
committerTristan Gingold <tgingold@free.fr>2017-10-24 19:17:27 +0200
commit0aba06b92bf72e6870ee690a26eca485c2e74714 (patch)
tree0d297c05692ed72118945197124208aa2ec397ad /src/vhdl/sem_specs.adb
parent1fbf1e9fc8455d8c675cc80818d1a2cdeaccdcb8 (diff)
downloadghdl-0aba06b92bf72e6870ee690a26eca485c2e74714.tar.gz
ghdl-0aba06b92bf72e6870ee690a26eca485c2e74714.tar.bz2
ghdl-0aba06b92bf72e6870ee690a26eca485c2e74714.zip
sem_specs: use architecture body for entity_aspect_entity when loaded.
Diffstat (limited to 'src/vhdl/sem_specs.adb')
-rw-r--r--src/vhdl/sem_specs.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vhdl/sem_specs.adb b/src/vhdl/sem_specs.adb
index cb7f945f1..8d0eb03a8 100644
--- a/src/vhdl/sem_specs.adb
+++ b/src/vhdl/sem_specs.adb
@@ -1056,6 +1056,7 @@ package body Sem_Specs is
Arch_Name : Iir;
Arch_Unit : Iir;
begin
+ -- The entity.
Entity_Name := Sem_Denoting_Name (Get_Entity_Name (Aspect));
Set_Entity_Name (Aspect, Entity_Name);
Entity := Get_Named_Entity (Entity_Name);
@@ -1073,8 +1074,13 @@ package body Sem_Specs is
if Arch_Name /= Null_Iir then
Arch_Unit := Libraries.Find_Secondary_Unit
(Get_Design_Unit (Entity), Get_Identifier (Arch_Name));
- Set_Named_Entity (Arch_Name, Arch_Unit);
if Arch_Unit /= Null_Iir then
+ -- The architecture is known.
+ if Get_Date_State (Arch_Unit) >= Date_Parse then
+ -- And loaded!
+ Arch_Unit := Get_Library_Unit (Arch_Unit);
+ end if;
+ Set_Named_Entity (Arch_Name, Arch_Unit);
Xref_Ref (Arch_Name, Arch_Unit);
end if;