diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-10 18:30:11 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-10 18:30:11 +0100 |
commit | a3f0fe3693602af086246ac57b0363578c96e171 (patch) | |
tree | 58b0cd92539ba138675ff54fb4bf84b2629b64d8 /src/synth | |
parent | 00319239e313633919ff821d2ffc81c0e5d605ff (diff) | |
download | ghdl-a3f0fe3693602af086246ac57b0363578c96e171.tar.gz ghdl-a3f0fe3693602af086246ac57b0363578c96e171.tar.bz2 ghdl-a3f0fe3693602af086246ac57b0363578c96e171.zip |
synth: add comments, minor rewrite
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 |