diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-01-05 09:29:59 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-01-11 12:51:47 +0100 |
commit | 2d0b6074af96f3375165afc7386b0e9071be206a (patch) | |
tree | 8205991632ab8a28d8b4eb17708076a272e89f67 /src/vhdl/translate/trans-chap3.ads | |
parent | 1e0718e33573d3b855e4e57006c0293a2fe0f40b (diff) | |
download | ghdl-2d0b6074af96f3375165afc7386b0e9071be206a.tar.gz ghdl-2d0b6074af96f3375165afc7386b0e9071be206a.tar.bz2 ghdl-2d0b6074af96f3375165afc7386b0e9071be206a.zip |
WIP: arrays of unbounded type.
Diffstat (limited to 'src/vhdl/translate/trans-chap3.ads')
-rw-r--r-- | src/vhdl/translate/trans-chap3.ads | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads index c1e53695f..552813451 100644 --- a/src/vhdl/translate/trans-chap3.ads +++ b/src/vhdl/translate/trans-chap3.ads @@ -120,15 +120,28 @@ package Trans.Chap3 is -- number of dimensions; these fields are a structure describing the -- range of the dimension. + -- If the element subtype of ARR_TYPE is unbounded, create a fat pointer, + -- set the bounds of it (from ARR), and return it. + -- Otherwise, return a null mnode. + -- Used to build a var for a subelement of ARR. + function Create_Maybe_Fat_Array_Element (Arr : Mnode; Arr_Type : Iir) + return Mnode; + + -- If the element subtype of the array is unbounded, set the base of VAR + -- from EL, and return it. + -- Otherwise directly return EL (VAR must be null). + function Assign_Maybe_Fat_Array_Element (Var : Mnode; El : Mnode) + return Mnode; + -- Index array BASE of type ATYPE with INDEX. -- INDEX must be of type ghdl_index_type, thus no bounds checks are -- performed. function Index_Base (Base : Mnode; Atype : Iir; Index : O_Enode) - return Mnode; + return Mnode; -- Same for for slicing. function Slice_Base (Base : Mnode; Atype : Iir; Index : O_Enode) - return Mnode; + return Mnode; -- Get the length of the array (the number of elements). function Get_Array_Length (Arr : Mnode; Atype : Iir) return O_Enode; @@ -179,6 +192,11 @@ package Trans.Chap3 is -- element EL. function Bounds_To_Element_Bounds (B : Mnode; El : Iir) return Mnode; + -- From an unbounded array bounds B, get the bounds for the (unbounded) + -- element. + function Array_Bounds_To_Element_Bounds (B : Mnode; Atype : Iir) + return Mnode; + -- Deallocate OBJ. procedure Gen_Deallocate (Obj : O_Enode); |