diff options
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/elab-vhdl_annotations.adb | 5 | ||||
-rw-r--r-- | src/synth/elab-vhdl_types.adb | 2 |
2 files changed, 5 insertions, 2 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 |