diff options
-rw-r--r-- | src/synth/elab-vhdl_insts.adb | 30 | ||||
-rw-r--r-- | src/vhdl/vhdl-annotations.adb | 5 |
2 files changed, 23 insertions, 12 deletions
diff --git a/src/synth/elab-vhdl_insts.adb b/src/synth/elab-vhdl_insts.adb index cb7a6bd9e..404684c26 100644 --- a/src/synth/elab-vhdl_insts.adb +++ b/src/synth/elab-vhdl_insts.adb @@ -107,17 +107,25 @@ package body Elab.Vhdl_Insts is end; when Iir_Kind_Interface_Type_Declaration => - declare - Act : Node; - Act_Typ : Type_Acc; - begin - Act := Get_Actual (Assoc); - if Get_Kind (Act) in Iir_Kinds_Denoting_Name then - Act := Get_Type (Act); - end if; - Act_Typ := Synth_Subtype_Indication (Syn_Inst, Act); - Create_Subtype_Object (Sub_Inst, Get_Type (Inter), Act_Typ); - end; + if Get_Kind (Get_Parent (Inter)) = Iir_Kind_Entity_Declaration + then + declare + Act : Node; + Act_Typ : Type_Acc; + begin + Act := Get_Actual (Assoc); + if Get_Kind (Act) in Iir_Kinds_Denoting_Name then + Act := Get_Type (Act); + end if; + if Get_Kind (Act) in Iir_Kinds_Subtype_Definition then + Act_Typ := Synth_Subtype_Indication (Syn_Inst, Act); + else + Act_Typ := Get_Subtype_Object (Syn_Inst, Act); + end if; + Create_Subtype_Object + (Sub_Inst, Get_Type (Inter), Act_Typ); + end; + end if; when Iir_Kind_Interface_Variable_Declaration | Iir_Kind_Interface_File_Declaration diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb index 71d43dfe1..630f3ef84 100644 --- a/src/vhdl/vhdl-annotations.adb +++ b/src/vhdl/vhdl-annotations.adb @@ -511,7 +511,10 @@ package body Vhdl.Annotations is when Iir_Kind_Interface_Package_Declaration => Annotate_Interface_Package_Declaration (Block_Info, Decl); when Iir_Kind_Interface_Type_Declaration => - if Flag_Synthesis then + if Flag_Synthesis + and then (Get_Kind (Get_Parent (Decl)) + = Iir_Kind_Entity_Declaration) + then -- Create an info on the interface_type_definition. -- This is needed for a generic type in an entity, as the -- nodes are not instantiated. |