diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-04-05 09:20:04 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-04-05 10:47:39 +0200 |
commit | 3c9c6023c38ed1272634a7d2aed5dbe1c318842a (patch) | |
tree | 9b0c80f87645a14fbcea51e05ecccaeb02ca6aeb /src/vhdl/vhdl-canon.adb | |
parent | f3e936f0ca532fb57f2700a46ba1ff84557f7305 (diff) | |
download | ghdl-3c9c6023c38ed1272634a7d2aed5dbe1c318842a.tar.gz ghdl-3c9c6023c38ed1272634a7d2aed5dbe1c318842a.tar.bz2 ghdl-3c9c6023c38ed1272634a7d2aed5dbe1c318842a.zip |
vhdl and libraries: add support for binding to a foreign module
Diffstat (limited to 'src/vhdl/vhdl-canon.adb')
-rw-r--r-- | src/vhdl/vhdl-canon.adb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/vhdl/vhdl-canon.adb b/src/vhdl/vhdl-canon.adb index 7fb55f601..3845b8d0f 100644 --- a/src/vhdl/vhdl-canon.adb +++ b/src/vhdl/vhdl-canon.adb @@ -2335,6 +2335,7 @@ package body Vhdl.Canon is Binding : Iir) is Aspect : Iir; + Ent : Iir; begin if Binding = Null_Iir then return; @@ -2348,7 +2349,12 @@ package body Vhdl.Canon is if Get_Architecture (Aspect) /= Null_Iir then Add_Dependence (Top, Aspect); else - Add_Dependence (Top, Get_Design_Unit (Get_Entity (Aspect))); + Ent := Get_Entity (Aspect); + pragma Assert (Ent /= Null_Iir); + if Get_Kind (Ent) = Iir_Kind_Entity_Declaration then + Ent := Get_Design_Unit (Ent); + end if; + Add_Dependence (Top, Ent); end if; when Iir_Kind_Entity_Aspect_Configuration => Add_Dependence (Top, Get_Design_Unit (Get_Configuration (Aspect))); @@ -2396,11 +2402,18 @@ package body Vhdl.Canon is if Is_Config then Entity_Aspect := Get_Entity_Aspect (Bind); Entity := Get_Entity_From_Entity_Aspect (Entity_Aspect); - Sem_Specs.Sem_Check_Missing_Generic_Association - (Get_Generic_Chain (Entity), - Get_Generic_Map_Aspect_Chain (Bind), - Null_Iir, - Cfg); + case Get_Kind (Entity) is + when Iir_Kind_Entity_Declaration => + Sem_Specs.Sem_Check_Missing_Generic_Association + (Get_Generic_Chain (Entity), + Get_Generic_Map_Aspect_Chain (Bind), + Null_Iir, + Cfg); + when Iir_Kind_Foreign_Module => + null; + when others => + raise Internal_Error; + end case; end if; return; else |