diff options
-rw-r--r-- | src/synth/elab-vhdl_annotations.adb | 5 | ||||
-rw-r--r-- | src/synth/elab-vhdl_types.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_inst.adb | 9 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/synth/elab-vhdl_annotations.adb b/src/synth/elab-vhdl_annotations.adb index 9475ac940..84bb6e02e 100644 --- a/src/synth/elab-vhdl_annotations.adb +++ b/src/synth/elab-vhdl_annotations.adb @@ -479,15 +479,16 @@ package body Elab.Vhdl_Annotations is Nbr_Objects => 0, Pkg_Slot => Invalid_Object_Slot, Pkg_Parent => null); + Set_Info (Decl, Package_Info); if Is_Inst or else not Is_Uninstantiated_Package (Decl) then + -- Allocate a slot in the parent block. Block_Info.Nbr_Objects := Block_Info.Nbr_Objects + 1; + -- Link with parent. Package_Info.Pkg_Slot := Block_Info.Nbr_Objects; Package_Info.Pkg_Parent := Block_Info; end if; - Set_Info (Decl, Package_Info); - if Is_Inst then Annotate_Interface_List (Package_Info, Get_Generic_Chain (Decl), True); diff --git a/src/synth/elab-vhdl_types.adb b/src/synth/elab-vhdl_types.adb index c448672ce..9018dc7fe 100644 --- a/src/synth/elab-vhdl_types.adb +++ b/src/synth/elab-vhdl_types.adb @@ -775,6 +775,8 @@ package body Elab.Vhdl_Types is end if; when Iir_Kinds_Denoting_Name => -- Already elaborated. + -- We cannot use the object type as it can be a subtype + -- deduced from the default value (for constants). Atype := Get_Type (Get_Named_Entity (Atype)); when Iir_Kind_Subtype_Attribute => declare diff --git a/src/vhdl/vhdl-sem_inst.adb b/src/vhdl/vhdl-sem_inst.adb index ba5c72acf..5394114a9 100644 --- a/src/vhdl/vhdl-sem_inst.adb +++ b/src/vhdl/vhdl-sem_inst.adb @@ -757,11 +757,12 @@ package body Vhdl.Sem_Inst is end if; when Iir_Kind_Interface_Type_Declaration => declare - Itype : Iir; + Def : Iir; begin - Itype := Instantiate_Iir (Get_Type (Inter), False); - Set_Type (Res, Itype); - Set_Interface_Type_Definition (Res, Itype); + -- Also instantiate the interface type definition. + Def := Instantiate_Iir (Get_Type (Inter), False); + Set_Type (Res, Def); + Set_Interface_Type_Definition (Res, Def); Set_Is_Ref (Res, True); end; when Iir_Kinds_Interface_Subprogram_Declaration => |