diff options
Diffstat (limited to 'src/synth/elab-vhdl_files.adb')
-rw-r--r-- | src/synth/elab-vhdl_files.adb | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/src/synth/elab-vhdl_files.adb b/src/synth/elab-vhdl_files.adb index e84c00d42..c2a8dc35f 100644 --- a/src/synth/elab-vhdl_files.adb +++ b/src/synth/elab-vhdl_files.adb @@ -56,13 +56,13 @@ package body Elab.Vhdl_Files is procedure Convert_String (Val : Valtyp; Res : out String) is Vtyp : constant Type_Acc := Val.Typ; - Vlen : constant Uns32 := Vtyp.Abounds.D (1).Len; + Vlen : constant Uns32 := Vtyp.Abound.Len; begin pragma Assert (Vtyp.Kind = Type_Array); pragma Assert (Vtyp.Arr_El.Kind = Type_Discrete); pragma Assert (Vtyp.Arr_El.W in 7 .. 8); -- Could be 7 in vhdl87 - pragma Assert (Vtyp.Abounds.Ndim = 1); - pragma Assert (Vtyp.Abounds.D (1).Len = Res'Length); + pragma Assert (Vtyp.Alast); + pragma Assert (Vtyp.Abound.Len = Res'Length); for I in 1 .. Vlen loop Res (Res'First + Natural (I - 1)) := @@ -79,7 +79,7 @@ package body Elab.Vhdl_Files is Name : constant Valtyp := Strip_Alias_Const (Val); pragma Unreferenced (Val); begin - Len := Natural (Name.Typ.Abounds.D (1).Len); + Len := Natural (Name.Typ.Abound.Len); if Len >= Res'Length - 1 then Status := Op_Filename_Error; @@ -395,6 +395,20 @@ package body Elab.Vhdl_Files is end if; end Synth_File_Close; + procedure Synth_File_Flush + (Syn_Inst : Synth_Instance_Acc; Imp : Node; Loc : Node) + is + Inters : constant Node := Get_Interface_Declaration_Chain (Imp); + F : constant File_Index := Get_Value (Syn_Inst, Inters).Val.File; + Status : Op_Status; + begin + Ghdl_File_Flush (F, Status); + + if Status /= Op_Ok then + File_Error (Loc, Status); + end if; + end Synth_File_Flush; + -- Declaration: -- procedure untruncated_text_read --!V87 -- (file f : text; str : out string; len : out natural); --!V87 @@ -408,7 +422,7 @@ package body Elab.Vhdl_Files is Str : constant Valtyp := Get_Value (Syn_Inst, Param2); Param3 : constant Node := Get_Chain (Param2); Param_Len : constant Valtyp := Get_Value (Syn_Inst, Param3); - Buf : String (1 .. Natural (Str.Typ.Abounds.D (1).Len)); + Buf : String (1 .. Natural (Str.Typ.Abound.Len)); Len : Std_Integer; Status : Op_Status; begin @@ -447,7 +461,7 @@ package body Elab.Vhdl_Files is Off : Size_Type; begin Off := 0; - for I in 1 .. Get_Array_Flat_Length (Val.Typ) loop + for I in 1 .. Get_Bound_Length (Val.Typ) loop File_Read_Value (File, (El_Typ, Val.Mem + Off), Loc); Off := Off + El_Typ.Sz; end loop; @@ -455,8 +469,8 @@ package body Elab.Vhdl_Files is when Type_Record => for I in Val.Typ.Rec.E'Range loop File_Read_Value - (File, - (Val.Typ.Rec.E (I).Typ, Val.Mem + Val.Typ.Rec.E (I).Moff), + (File, (Val.Typ.Rec.E (I).Typ, + Val.Mem + Val.Typ.Rec.E (I).Offs.Mem_Off), Loc); end loop; when Type_Unbounded_Record @@ -502,17 +516,17 @@ package body Elab.Vhdl_Files is Off : Size_Type; begin Off := 0; - for I in 1 .. Get_Array_Flat_Length (Val.Typ) loop + for I in 1 .. Get_Bound_Length (Val.Typ) loop File_Write_Value (File, (El_Typ, Val.Mem + Off), Loc); Off := Off + El_Typ.Sz; end loop; end; when Type_Record => for I in Val.Typ.Rec.E'Range loop - File_Write_Value - (File, - (Val.Typ.Rec.E (I).Typ, Val.Mem + Val.Typ.Rec.E (I).Moff), - Loc); + File_Write_Value (File, + (Val.Typ.Rec.E (I).Typ, + Val.Mem + Val.Typ.Rec.E (I).Offs.Mem_Off), + Loc); end loop; when Type_Unbounded_Record | Type_Unbounded_Array @@ -542,7 +556,7 @@ package body Elab.Vhdl_Files is Str : Std_String; Bnd : Std_String_Bound; begin - B := Val.Typ.Abounds.D (1); + B := Val.Typ.Abound; Bnd.Dim_1 := (Left => Ghdl_I32 (B.Left), Right => Ghdl_I32 (B.Right), Dir => Dir_To_Dir (B.Dir), |