diff options
author | Tristan Gingold | 2015-08-29 07:57:12 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-08-29 07:57:12 +0200 |
commit | b75d703676ab830ea3e5731e1965d1d89879a456 (patch) | |
tree | 1a0a21ba1cce6385715bd2823853ee4ad47905ee /src/vhdl/translate/trans-chap3.ads | |
parent | 64fa65e1395bef4f05c51bc19d9a46d6003339ee (diff) | |
download | ghdl-b75d703676ab830ea3e5731e1965d1d89879a456.tar.gz ghdl-b75d703676ab830ea3e5731e1965d1d89879a456.tar.bz2 ghdl-b75d703676ab830ea3e5731e1965d1d89879a456.zip |
Replace fat accesses by bounds accesses
translate: separate info for signals from object.
Improve some error messages.
Diffstat (limited to 'src/vhdl/translate/trans-chap3.ads')
-rw-r--r-- | src/vhdl/translate/trans-chap3.ads | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/vhdl/translate/trans-chap3.ads b/src/vhdl/translate/trans-chap3.ads index b5f42e8..69d1137 100644 --- a/src/vhdl/translate/trans-chap3.ads +++ b/src/vhdl/translate/trans-chap3.ads @@ -172,6 +172,10 @@ package Trans.Chap3 is -- Get array bounds for type ATYPE. function Get_Array_Type_Bounds (Atype : Iir) return Mnode; + -- Return a pointer to the base from bounds_acc ACC. + function Get_Bounds_Acc_Base + (Acc : O_Enode; D_Type : Iir) return O_Enode; + -- Deallocate OBJ. procedure Gen_Deallocate (Obj : O_Enode); @@ -188,17 +192,25 @@ package Trans.Chap3 is Obj_Type : Iir; Bounds : Mnode); - -- Copy SRC to DEST. - -- Both have the same type, OTYPE. - -- Furthermore, arrays are of the same length. + -- Low level copy of SRC to DEST. Both have the same type, OBJ_TYPE. + -- There is no length check, so arrays must be of the same length. procedure Translate_Object_Copy (Dest : Mnode; Src : O_Enode; Obj_Type : Iir); + -- Get size (in bytes with type ghdl_index_type) of subtype ATYPE. + -- For an unconstrained array, BOUNDS must be set, otherwise it may be a + -- null_mnode. + function Get_Subtype_Size + (Atype : Iir; Bounds : Mnode; Kind : Object_Kind_Type) return O_Enode; + -- Get size (in bytes with type ghdl_index_type) of object OBJ. -- For an unconstrained array, OBJ must be really an object, otherwise, - -- it may be a null_mnode, created by T2M. + -- it may be the result of T2M. function Get_Object_Size (Obj : Mnode; Obj_Type : Iir) return O_Enode; + -- If needed call the procedure to build OBJ. + procedure Maybe_Call_Type_Builder (Obj : Mnode; Obj_Type : Iir); + -- Allocate the base of a fat array, whose length is determined from -- the bounds. -- RES_PTR is a pointer to the fat pointer (must be a variable that |