diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-01-02 12:10:59 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-01-02 12:11:19 +0100 |
commit | 0d3facf9c5774d12925d6bef2655e28a53520598 (patch) | |
tree | 746446e9ccddbe4133da6b1fda4f00bbe184c6f3 /src/vhdl/translate/trans-chap3.adb | |
parent | de4766d9b15d458e7ef963a5157536b0f459dbe9 (diff) | |
download | ghdl-0d3facf9c5774d12925d6bef2655e28a53520598.tar.gz ghdl-0d3facf9c5774d12925d6bef2655e28a53520598.tar.bz2 ghdl-0d3facf9c5774d12925d6bef2655e28a53520598.zip |
WIP: add el size and bounds to unbounded arrays.
Diffstat (limited to 'src/vhdl/translate/trans-chap3.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 56f600776..14e4955fa 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -732,6 +732,8 @@ package body Trans.Chap3 is is Indexes_List : constant Iir_Flist := Get_Index_Subtype_Definition_List (Def); + El_Type : constant Iir := Get_Element_Subtype (Def); + El_Info : constant Type_Info_Acc := Get_Info (El_Type); Constr : O_Element_List; Dim : String (1 .. 8); N : Natural; @@ -766,6 +768,15 @@ package body Trans.Chap3 is Get_Identifier (Dim (P .. Dim'Last)), Get_Info (Get_Base_Type (Index)).B.Range_Type); end loop; + + if Is_Unbounded_Type (El_Info) then + -- Bounds and size for element. + New_Record_Field (Constr, Info.B.El_Bounds, + Get_Identifier ("el_bound"), El_Info.B.Bounds_Type); + New_Record_Field (Constr, Info.B.El_Size, Get_Identifier ("el_size"), + Ghdl_Sizes_Type); + end if; + Finish_Record_Type (Constr, Info.B.Bounds_Type); Finish_Unbounded_Type_Bounds (Info); end Translate_Array_Type_Bounds; @@ -2293,6 +2304,7 @@ package body Trans.Chap3 is Translate_Array_Element_Definition (Def); if Get_Index_Constraint_Flag (Def) then if Base_Info = null or else Base_Info.Type_Incomplete then + -- This subtype also declare the base type. Create it. declare Mark : Id_Mark_Type; begin |