diff options
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/elab-vhdl_types.adb | 5 | ||||
-rw-r--r-- | src/synth/synth-vhdl_expr.adb | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/synth/elab-vhdl_types.adb b/src/synth/elab-vhdl_types.adb index ffddd20ae..b7f2da58f 100644 --- a/src/synth/elab-vhdl_types.adb +++ b/src/synth/elab-vhdl_types.adb @@ -220,6 +220,7 @@ package body Elab.Vhdl_Types is function Synth_Array_Type_Definition (Syn_Inst : Synth_Instance_Acc; Def : Node) return Type_Acc is + El_St : constant Node := Get_Element_Subtype_Indication (Def); El_Type : constant Node := Get_Element_Subtype (Def); Ndims : constant Natural := Get_Nbr_Dimensions (Def); Idx : Node; @@ -227,7 +228,9 @@ package body Elab.Vhdl_Types is Idx_Typ : Type_Acc; Typ : Type_Acc; begin - Synth_Subtype_Indication_If_Anonymous (Syn_Inst, El_Type); + if Get_Kind (El_St) in Iir_Kinds_Subtype_Definition then + Synth_Subtype_Indication (Syn_Inst, El_Type); + end if; El_Typ := Get_Subtype_Object (Syn_Inst, El_Type); if El_Typ.Kind in Type_Nets and then Ndims = 1 then diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb index 6b7672ae2..26555ff4d 100644 --- a/src/synth/synth-vhdl_expr.adb +++ b/src/synth/synth-vhdl_expr.adb @@ -2231,8 +2231,11 @@ package body Synth.Vhdl_Expr is | Iir_Kind_Low_Array_Attribute | Iir_Kind_Indexed_Name | Iir_Kind_Integer_Literal => - -- The type of this attribute is the type of the index, which is - -- not synthesized as a type (only as an index). + -- For array attributes: the type is the type of the index, which + -- is not synthesized as a type (only as an index). + -- + -- Likewise for indexed names. + -- -- For integer_literal, the type is not really needed, and it -- may be created by static evaluation of an array attribute. Etype := Get_Base_Type (Etype); |