aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-annotations.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-04-05 19:14:22 +0200
committerTristan Gingold <tgingold@free.fr>2022-04-05 19:14:22 +0200
commit9b14c0ac67981ca6db6c6d4861035afca1595965 (patch)
tree3f0beea15c714ac20c23d744c1af9cdd1aa7ae77 /src/vhdl/vhdl-annotations.adb
parentd46c35b74f8b173363d238bf2e23bda7ae595e54 (diff)
downloadghdl-9b14c0ac67981ca6db6c6d4861035afca1595965.tar.gz
ghdl-9b14c0ac67981ca6db6c6d4861035afca1595965.tar.bz2
ghdl-9b14c0ac67981ca6db6c6d4861035afca1595965.zip
synth: do not add info for element subtype (except for arrays).
Fix #2021
Diffstat (limited to 'src/vhdl/vhdl-annotations.adb')
-rw-r--r--src/vhdl/vhdl-annotations.adb52
1 files changed, 21 insertions, 31 deletions
diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb
index 9fc9788bf..7e1663e9a 100644
--- a/src/vhdl/vhdl-annotations.adb
+++ b/src/vhdl/vhdl-annotations.adb
@@ -324,29 +324,34 @@ package body Vhdl.Annotations is
end if;
when Iir_Kind_Array_Type_Definition =>
- El := Get_Element_Subtype (Def);
- Annotate_Anonymous_Type_Definition (Block_Info, El);
if Flag_Synthesis then
+ -- Create an annotation for the element type, as it can be
+ -- referenced by the implicit concat function definition for
+ -- concatenation with element.
+ El := Get_Element_Subtype (Def);
+ Annotate_Anonymous_Type_Definition (Block_Info, El);
+
+ -- Then for the array.
Create_Object_Info (Block_Info, Def, Kind_Type);
end if;
when Iir_Kind_Array_Subtype_Definition =>
- if Get_Array_Element_Constraint (Def) /= Null_Node
- or else
- (Get_Resolution_Indication (Def) /= Null_Node
- and then
- (Get_Kind (Get_Resolution_Indication (Def))
- = Iir_Kind_Array_Element_Resolution))
- then
- -- This subtype has created a new anonymous subtype for the
- -- element.
- El := Get_Element_Subtype (Def);
- Annotate_Type_Definition (Block_Info, El);
- end if;
if Flag_Synthesis then
-- For the bounds.
Create_Object_Info (Block_Info, Def, Kind_Type);
else
+ if Get_Array_Element_Constraint (Def) /= Null_Node
+ or else
+ (Get_Resolution_Indication (Def) /= Null_Node
+ and then
+ (Get_Kind (Get_Resolution_Indication (Def))
+ = Iir_Kind_Array_Element_Resolution))
+ then
+ -- This subtype has created a new anonymous subtype for the
+ -- element.
+ El := Get_Element_Subtype (Def);
+ Annotate_Type_Definition (Block_Info, El);
+ end if;
declare
List : constant Iir_Flist := Get_Index_Subtype_List (Def);
begin
@@ -378,23 +383,8 @@ package body Vhdl.Annotations is
when Iir_Kind_Record_Subtype_Definition =>
if Flag_Synthesis then
- declare
- List : constant Iir_Flist :=
- Get_Elements_Declaration_List (Def);
- El : Iir;
- El_Type : Iir;
- begin
- for I in Flist_First .. Flist_Last (List) loop
- El := Get_Nth_Element (List, I);
- if Get_Subtype_Indication (El) /= Null_Iir then
- El_Type := Get_Type (El);
- Annotate_Anonymous_Type_Definition
- (Block_Info, El_Type);
- end if;
- end loop;
- -- For the offsets.
- Create_Object_Info (Block_Info, Def, Kind_Type);
- end;
+ -- For the offsets.
+ Create_Object_Info (Block_Info, Def, Kind_Type);
end if;
when Iir_Kind_Access_Type_Definition =>