diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-09-15 08:05:37 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-09-15 08:05:37 +0200 |
commit | 655e52ad5d04e20fcbbd25e9f455a4ed3cd35f97 (patch) | |
tree | fbc05bda91092a5a7865b54b43998b4602ba82f3 /src/vhdl/sem.adb | |
parent | a756fb5de1cdc475537d5c4cfbca52667e054f33 (diff) | |
download | ghdl-655e52ad5d04e20fcbbd25e9f455a4ed3cd35f97.tar.gz ghdl-655e52ad5d04e20fcbbd25e9f455a4ed3cd35f97.tar.bz2 ghdl-655e52ad5d04e20fcbbd25e9f455a4ed3cd35f97.zip |
vhdl08: handle interface type in generic-mapped package
Diffstat (limited to 'src/vhdl/sem.adb')
-rw-r--r-- | src/vhdl/sem.adb | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb index 8187ffd36..d26bbfe6e 100644 --- a/src/vhdl/sem.adb +++ b/src/vhdl/sem.adb @@ -2604,13 +2604,28 @@ package body Sem is Push_Signals_Declarative_Part (Implicit, Decl); if Header /= Null_Iir then - Sem_Interface_Chain - (Get_Generic_Chain (Header), Generic_Interface_List); - if Get_Generic_Map_Aspect_Chain (Header) /= Null_Iir then - if not Sem_Generic_Association_Chain (Header, Header) then - null; + declare + Generic_Chain : constant Iir := Get_Generic_Chain (Header); + Generic_Map : constant Iir := + Get_Generic_Map_Aspect_Chain (Header); + El : Iir; + begin + Sem_Interface_Chain (Generic_Chain, Generic_Interface_List); + if Generic_Map /= Null_Iir then + if Sem_Generic_Association_Chain (Header, Header) then + El := Get_Generic_Map_Aspect_Chain (Header); + while Is_Valid (El) loop + if Get_Kind (El) = Iir_Kind_Association_Element_Type then + Sem_Inst.Substitute_On_Chain + (Generic_Chain, + Get_Type (Get_Associated_Interface (El)), + Get_Type (Get_Named_Entity (Get_Actual (El)))); + end if; + El := Get_Chain (El); + end loop; + end if; end if; - end if; + end; end if; Sem_Declaration_Chain (Decl); |