aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ghdldrv/ghdlrun.adb2
-rw-r--r--src/grt/grt-images.adb12
-rw-r--r--src/grt/grt-images.ads4
-rw-r--r--src/vhdl/translate/trans-chap7.adb4
-rw-r--r--src/vhdl/translate/trans_decls.ads1
-rw-r--r--src/vhdl/translate/translation.adb2
6 files changed, 25 insertions, 0 deletions
diff --git a/src/ghdldrv/ghdlrun.adb b/src/ghdldrv/ghdlrun.adb
index 32e85a0f7..cc93bd827 100644
--- a/src/ghdldrv/ghdlrun.adb
+++ b/src/ghdldrv/ghdlrun.adb
@@ -535,6 +535,8 @@ package body Ghdlrun is
Def (Trans_Decls.Ghdl_To_String_I32,
Grt.Images.Ghdl_To_String_I32'Address);
+ Def (Trans_Decls.Ghdl_To_String_I64,
+ Grt.Images.Ghdl_To_String_I64'Address);
Def (Trans_Decls.Ghdl_To_String_F64,
Grt.Images.Ghdl_To_String_F64'Address);
Def (Trans_Decls.Ghdl_To_String_F64_Digits,
diff --git a/src/grt/grt-images.adb b/src/grt/grt-images.adb
index 272c42352..e56c8354b 100644
--- a/src/grt/grt-images.adb
+++ b/src/grt/grt-images.adb
@@ -100,6 +100,16 @@ package body Grt.Images is
Return_String (Res, Str (First .. Str'Last));
end Ghdl_Image_I32;
+ procedure Ghdl_Image_I64 (Res : Std_String_Ptr; Val : Ghdl_I64)
+ is
+ -- biggest number is: 18446744073709551615 (20 digits)
+ Str : String (1 .. 21);
+ First : Natural;
+ begin
+ To_String (Str, First, Val);
+ Return_String (Res, Str (First .. Str'Last));
+ end Ghdl_Image_I64;
+
procedure Ghdl_Image_P64
(Res : Std_String_Ptr; Val : Ghdl_I64; Rti : Ghdl_Rti_Access)
is
@@ -159,6 +169,8 @@ package body Grt.Images is
procedure Ghdl_To_String_I32 (Res : Std_String_Ptr; Val : Ghdl_I32)
renames Ghdl_Image_I32;
+ procedure Ghdl_To_String_I64 (Res : Std_String_Ptr; Val : Ghdl_I64)
+ renames Ghdl_Image_I64;
procedure Ghdl_To_String_F64 (Res : Std_String_Ptr; Val : Ghdl_F64)
renames Ghdl_Image_F64;
diff --git a/src/grt/grt-images.ads b/src/grt/grt-images.ads
index cd8911091..afbaaadd1 100644
--- a/src/grt/grt-images.ads
+++ b/src/grt/grt-images.ads
@@ -36,6 +36,7 @@ package Grt.Images is
procedure Ghdl_Image_E32
(Res : Std_String_Ptr; Val : Ghdl_E32; Rti : Ghdl_Rti_Access);
procedure Ghdl_Image_I32 (Res : Std_String_Ptr; Val : Ghdl_I32);
+ procedure Ghdl_Image_I64 (Res : Std_String_Ptr; Val : Ghdl_I64);
procedure Ghdl_Image_F64 (Res : Std_String_Ptr; Val : Ghdl_F64);
procedure Ghdl_Image_P64
(Res : Std_String_Ptr; Val : Ghdl_I64; Rti : Ghdl_Rti_Access);
@@ -43,6 +44,7 @@ package Grt.Images is
(Res : Std_String_Ptr; Val : Ghdl_I32; Rti : Ghdl_Rti_Access);
procedure Ghdl_To_String_I32 (Res : Std_String_Ptr; Val : Ghdl_I32);
+ procedure Ghdl_To_String_I64 (Res : Std_String_Ptr; Val : Ghdl_I64);
procedure Ghdl_To_String_F64 (Res : Std_String_Ptr; Val : Ghdl_F64);
procedure Ghdl_To_String_F64_Digits
(Res : Std_String_Ptr; Val : Ghdl_F64; Nbr_Digits : Ghdl_I32);
@@ -84,11 +86,13 @@ private
pragma Export (C, Ghdl_Image_E8, "__ghdl_image_e8");
pragma Export (C, Ghdl_Image_E32, "__ghdl_image_e32");
pragma Export (C, Ghdl_Image_I32, "__ghdl_image_i32");
+ pragma Export (C, Ghdl_Image_I64, "__ghdl_image_i64");
pragma Export (C, Ghdl_Image_F64, "__ghdl_image_f64");
pragma Export (C, Ghdl_Image_P64, "__ghdl_image_p64");
pragma Export (C, Ghdl_Image_P32, "__ghdl_image_p32");
pragma Export (C, Ghdl_To_String_I32, "__ghdl_to_string_i32");
+ pragma Export (C, Ghdl_To_String_I64, "__ghdl_to_string_i64");
pragma Export (C, Ghdl_To_String_F64, "__ghdl_to_string_f64");
pragma Export (C, Ghdl_To_String_F64_Digits, "__ghdl_to_string_f64_digits");
pragma Export (C, Ghdl_To_String_F64_Format, "__ghdl_to_string_f64_format");
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index c226f52dd..4833564bd 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -2443,6 +2443,10 @@ package body Trans.Chap7 is
return Translate_To_String
(Ghdl_To_String_I32, Res_Type, Loc,
New_Convert_Ov (Left_Tree, Ghdl_I32_Type));
+ when Type_Mode_I64 =>
+ return Translate_To_String
+ (Ghdl_To_String_I64, Res_Type, Loc,
+ New_Convert_Ov (Left_Tree, Ghdl_I64_Type));
when others =>
raise Internal_Error;
end case;
diff --git a/src/vhdl/translate/trans_decls.ads b/src/vhdl/translate/trans_decls.ads
index 50f49cf5c..e2c87f042 100644
--- a/src/vhdl/translate/trans_decls.ads
+++ b/src/vhdl/translate/trans_decls.ads
@@ -232,6 +232,7 @@ package Trans_Decls is
-- For To_String (vhdl 2008).
Ghdl_To_String_I32 : O_Dnode;
+ Ghdl_To_String_I64 : O_Dnode;
Ghdl_To_String_F64 : O_Dnode;
Ghdl_To_String_F64_Digits : O_Dnode;
Ghdl_To_String_F64_Format : O_Dnode;
diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb
index 4e416367c..516c3e9e3 100644
--- a/src/vhdl/translate/translation.adb
+++ b/src/vhdl/translate/translation.adb
@@ -1758,6 +1758,8 @@ package body Translation is
Create_To_String_Subprogram
("__ghdl_to_string_i32", Ghdl_To_String_I32, Ghdl_I32_Type);
Create_To_String_Subprogram
+ ("__ghdl_to_string_i64", Ghdl_To_String_I64, Ghdl_I64_Type);
+ Create_To_String_Subprogram
("__ghdl_to_string_f64", Ghdl_To_String_F64, Ghdl_Real_Type);
Create_To_String_Subprogram
("__ghdl_to_string_f64_digits", Ghdl_To_String_F64_Digits,