diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-10-17 06:18:36 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-10-21 08:03:37 +0200 |
commit | ed7ad157dbecc784bb2df44684442e88431db561 (patch) | |
tree | 491533354ca2add405e08869f66c1c74622f97d7 /src/grt/grt-rtis.ads | |
parent | 13000af67c96c2a3417fa321daa3fbf50165f54f (diff) | |
download | ghdl-ed7ad157dbecc784bb2df44684442e88431db561.tar.gz ghdl-ed7ad157dbecc784bb2df44684442e88431db561.tar.bz2 ghdl-ed7ad157dbecc784bb2df44684442e88431db561.zip |
Rework translation of unbounded and complex types.
Diffstat (limited to 'src/grt/grt-rtis.ads')
-rw-r--r-- | src/grt/grt-rtis.ads | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/grt/grt-rtis.ads b/src/grt/grt-rtis.ads index afe9676c6..030cd7e04 100644 --- a/src/grt/grt-rtis.ads +++ b/src/grt/grt-rtis.ads @@ -120,6 +120,8 @@ package Grt.Rtis is -- bit 0: set for complex type -- bit 1: set for anonymous type definition -- bit 2: set only for physical type with non-static units (time) + -- * record elements: + -- bit 0: set for complex type (copy of the type complex bit). -- * signals: -- bit 0-3: mode (1: linkage, 2: buffer, 3 : out, 4 : inout, 5: in) -- bit 4-5: kind (0 : none, 1 : register, 2 : bus) @@ -311,9 +313,7 @@ package Grt.Rtis is Common : Ghdl_Rti_Common; Name : Ghdl_C_String; Basetype : Ghdl_Rti_Access; - Bounds : Ghdl_Rti_Loc; - Valsize : Ghdl_Rti_Loc; - Sigsize : Ghdl_Rti_Loc; + Layout : Ghdl_Rti_Loc; end record; pragma Convention (C, Ghdl_Rtin_Subtype_Composite); type Ghdl_Rtin_Subtype_Composite_Acc is access Ghdl_Rtin_Subtype_Composite; @@ -332,12 +332,22 @@ package Grt.Rtis is function To_Ghdl_Rtin_Type_Fileacc_Acc is new Ada.Unchecked_Conversion (Source => Ghdl_Rti_Access, Target => Ghdl_Rtin_Type_Fileacc_Acc); + -- Set in the mode field to know what Val_Off and Sig_Off are relative to. + -- This could also be extrated from the element type. + Ghdl_Rti_Element_Static : constant Ghdl_Rti_U8 := 0; + Ghdl_Rti_Element_Complex : constant Ghdl_Rti_U8 := 1; + Ghdl_Rti_Element_Unbounded : constant Ghdl_Rti_U8 := 2; + type Ghdl_Rtin_Element is record Common : Ghdl_Rti_Common; Name : Ghdl_C_String; Eltype : Ghdl_Rti_Access; + -- For static element: offset in the record. + -- For complex element: offset in the type layout or object layout. Val_Off : Ghdl_Index_Type; Sig_Off : Ghdl_Index_Type; + -- For unbounded records: element layout offset in the layout. + Layout_Off : Ghdl_Index_Type; end record; pragma Convention (C, Ghdl_Rtin_Element); type Ghdl_Rtin_Element_Acc is access Ghdl_Rtin_Element; @@ -349,6 +359,8 @@ package Grt.Rtis is Name : Ghdl_C_String; Nbrel : Ghdl_Index_Type; Elements : Ghdl_Rti_Arr_Acc; + -- Layout variable for the record, if it is complex. + Layout : Ghdl_Rti_Loc; end record; pragma Convention (C, Ghdl_Rtin_Type_Record); type Ghdl_Rtin_Type_Record_Acc is access Ghdl_Rtin_Type_Record; |