aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-03-22 06:48:24 +0100
committerTristan Gingold <tgingold@free.fr>2022-03-22 19:40:36 +0100
commitf06253fa91cbb6d086db1b937c38c56fa5f5178c (patch)
treed3a3b062e8c6c9d0acb6371ed77c7faecfed3e38 /src/grt
parent06a1e88bc76de16681bedc53661327eaa74ead98 (diff)
downloadghdl-f06253fa91cbb6d086db1b937c38c56fa5f5178c.tar.gz
ghdl-f06253fa91cbb6d086db1b937c38c56fa5f5178c.tar.bz2
ghdl-f06253fa91cbb6d086db1b937c38c56fa5f5178c.zip
grt: extract grt-vhdl_types from grt-types
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/grt-astdio-vhdl.ads1
-rw-r--r--src/grt/grt-avhpi.ads1
-rw-r--r--src/grt/grt-callbacks.ads2
-rw-r--r--src/grt/grt-change_generics.adb1
-rw-r--r--src/grt/grt-disp.adb4
-rw-r--r--src/grt/grt-disp_rti.adb1
-rw-r--r--src/grt/grt-errors.adb2
-rw-r--r--src/grt/grt-errors.ads1
-rw-r--r--src/grt/grt-files.ads1
-rw-r--r--src/grt/grt-files_operations.ads1
-rw-r--r--src/grt/grt-fst.adb1
-rw-r--r--src/grt/grt-images.ads1
-rw-r--r--src/grt/grt-lib.ads1
-rw-r--r--src/grt/grt-main.adb1
-rw-r--r--src/grt/grt-names.ads1
-rw-r--r--src/grt/grt-options.ads1
-rw-r--r--src/grt/grt-processes.ads1
-rw-r--r--src/grt/grt-rtis_addr.ads1
-rw-r--r--src/grt/grt-rtis_utils.adb1
-rw-r--r--src/grt/grt-signals.ads1
-rw-r--r--src/grt/grt-std_logic_1164.adb1
-rw-r--r--src/grt/grt-to_strings.ads1
-rw-r--r--src/grt/grt-types.ads133
-rw-r--r--src/grt/grt-values.ads1
-rw-r--r--src/grt/grt-vcd.ads1
-rw-r--r--src/grt/grt-vhdl_types.ads163
-rw-r--r--src/grt/grt-vhpi.adb1
-rw-r--r--src/grt/grt-vpi.adb1
-rw-r--r--src/grt/grt-waves.adb1
29 files changed, 190 insertions, 138 deletions
diff --git a/src/grt/grt-astdio-vhdl.ads b/src/grt/grt-astdio-vhdl.ads
index bacc12276..8f69a7a52 100644
--- a/src/grt/grt-astdio-vhdl.ads
+++ b/src/grt/grt-astdio-vhdl.ads
@@ -20,6 +20,7 @@
-- covered by the GNU General Public License. This exception does not
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
package Grt.Astdio.Vhdl is
pragma Preelaborate (Grt.Astdio.Vhdl);
diff --git a/src/grt/grt-avhpi.ads b/src/grt/grt-avhpi.ads
index 7675c9b1f..f4016de1a 100644
--- a/src/grt/grt-avhpi.ads
+++ b/src/grt/grt-avhpi.ads
@@ -28,6 +28,7 @@
-- * this implementation never allocates memory.
with System; use System;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Rtis; use Grt.Rtis;
with Grt.Rtis_Addr; use Grt.Rtis_Addr;
diff --git a/src/grt/grt-callbacks.ads b/src/grt/grt-callbacks.ads
index fc0ce9e47..ac9d93c46 100644
--- a/src/grt/grt-callbacks.ads
+++ b/src/grt/grt-callbacks.ads
@@ -21,7 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with System;
-with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
-- Callbacks are user registered procedures that are called during simulation.
-- They are used to implement vpi/vhpi callbacks, but also some features like
diff --git a/src/grt/grt-change_generics.adb b/src/grt/grt-change_generics.adb
index 23fbc9806..b62826991 100644
--- a/src/grt/grt-change_generics.adb
+++ b/src/grt/grt-change_generics.adb
@@ -23,6 +23,7 @@
with System;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Lib; use Grt.Lib;
with Grt.Options; use Grt.Options;
with Grt.Avhpi; use Grt.Avhpi;
diff --git a/src/grt/grt-disp.adb b/src/grt/grt-disp.adb
index 23e6805bc..025e56e7b 100644
--- a/src/grt/grt-disp.adb
+++ b/src/grt/grt-disp.adb
@@ -20,12 +20,10 @@
-- covered by the GNU General Public License. This exception does not
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
-with System.Storage_Elements; -- Work around GNAT bug.
-pragma Unreferenced (System.Storage_Elements);
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Astdio; use Grt.Astdio;
with Grt.Astdio.Vhdl; use Grt.Astdio.Vhdl;
with Grt.Stdio; use Grt.Stdio;
---with Grt.Errors; use Grt.Errors;
package body Grt.Disp is
diff --git a/src/grt/grt-disp_rti.adb b/src/grt/grt-disp_rti.adb
index a46e89231..f66c43ca1 100644
--- a/src/grt/grt-disp_rti.adb
+++ b/src/grt/grt-disp_rti.adb
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Astdio; use Grt.Astdio;
with Grt.Astdio.Vhdl; use Grt.Astdio.Vhdl;
with Grt.Errors; use Grt.Errors;
diff --git a/src/grt/grt-errors.adb b/src/grt/grt-errors.adb
index 48cdd1870..f266f4b0a 100644
--- a/src/grt/grt-errors.adb
+++ b/src/grt/grt-errors.adb
@@ -126,7 +126,7 @@ package body Grt.Errors is
procedure Diag_C_Now is
begin
- Put_Time (Error_Stream, Grt.Types.Current_Time);
+ Put_Time (Error_Stream, Grt.Vhdl_Types.Current_Time);
end Diag_C_Now;
procedure Newline_Err is
diff --git a/src/grt/grt-errors.ads b/src/grt/grt-errors.ads
index 371908fad..0df4773b8 100644
--- a/src/grt/grt-errors.ads
+++ b/src/grt/grt-errors.ads
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Hooks;
with Grt.Stdio;
diff --git a/src/grt/grt-files.ads b/src/grt/grt-files.ads
index 05ac829de..da22f0c1d 100644
--- a/src/grt/grt-files.ads
+++ b/src/grt/grt-files.ads
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Interfaces;
package Grt.Files is
diff --git a/src/grt/grt-files_operations.ads b/src/grt/grt-files_operations.ads
index c8c7d9d9a..e9da80597 100644
--- a/src/grt/grt-files_operations.ads
+++ b/src/grt/grt-files_operations.ads
@@ -24,6 +24,7 @@
with Interfaces;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Stdio;
package Grt.Files_Operations is
diff --git a/src/grt/grt-fst.adb b/src/grt/grt-fst.adb
index 199952060..28470cfe9 100644
--- a/src/grt/grt-fst.adb
+++ b/src/grt/grt-fst.adb
@@ -40,6 +40,7 @@ with Ada.Unchecked_Deallocation;
with Interfaces; use Interfaces;
with Interfaces.C;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Fst_Api; use Grt.Fst_Api;
with Grt.Vcd; use Grt.Vcd;
with Grt.Avhpi; use Grt.Avhpi;
diff --git a/src/grt/grt-images.ads b/src/grt/grt-images.ads
index 76f518319..5f1109b9b 100644
--- a/src/grt/grt-images.ads
+++ b/src/grt/grt-images.ads
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Rtis; use Grt.Rtis;
package Grt.Images is
diff --git a/src/grt/grt-lib.ads b/src/grt/grt-lib.ads
index 551b9521f..467cc4ca3 100644
--- a/src/grt/grt-lib.ads
+++ b/src/grt/grt-lib.ads
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
package Grt.Lib is
procedure Ghdl_Memcpy
diff --git a/src/grt/grt-main.adb b/src/grt/grt-main.adb
index 71b148467..e6c71e120 100644
--- a/src/grt/grt-main.adb
+++ b/src/grt/grt-main.adb
@@ -20,6 +20,7 @@
-- covered by the GNU General Public License. This exception does not
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Stdio;
with Grt.Errors; use Grt.Errors;
with Grt.Processes;
diff --git a/src/grt/grt-names.ads b/src/grt/grt-names.ads
index 8dde1f762..065fe4f98 100644
--- a/src/grt/grt-names.ads
+++ b/src/grt/grt-names.ads
@@ -22,6 +22,7 @@
-- covered by the GNU Public License.
with System; use System;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Rtis; use Grt.Rtis;
package Grt.Names is
diff --git a/src/grt/grt-options.ads b/src/grt/grt-options.ads
index 8da4ace94..fa29cc85f 100644
--- a/src/grt/grt-options.ads
+++ b/src/grt/grt-options.ads
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Severity;
package Grt.Options is
diff --git a/src/grt/grt-processes.ads b/src/grt/grt-processes.ads
index d38e20855..80df93641 100644
--- a/src/grt/grt-processes.ads
+++ b/src/grt/grt-processes.ads
@@ -24,6 +24,7 @@ with System;
with Ada.Unchecked_Conversion;
with Grt.Stack2; use Grt.Stack2;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Signals; use Grt.Signals;
with Grt.Rtis; use Grt.Rtis;
with Grt.Rtis_Addr;
diff --git a/src/grt/grt-rtis_addr.ads b/src/grt/grt-rtis_addr.ads
index 1e275e21d..52c651794 100644
--- a/src/grt/grt-rtis_addr.ads
+++ b/src/grt/grt-rtis_addr.ads
@@ -23,6 +23,7 @@
with System; use System;
with Ada.Unchecked_Conversion;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Rtis; use Grt.Rtis;
-- Addresses handling.
diff --git a/src/grt/grt-rtis_utils.adb b/src/grt/grt-rtis_utils.adb
index 636a0c9e3..be0ecd3ab 100644
--- a/src/grt/grt-rtis_utils.adb
+++ b/src/grt/grt-rtis_utils.adb
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Errors; use Grt.Errors;
with Grt.To_Strings; use Grt.To_Strings;
with Grt.Vstrings_IO; use Grt.Vstrings_IO;
diff --git a/src/grt/grt-signals.ads b/src/grt/grt-signals.ads
index 14d20dfb8..8fe1e4dfe 100644
--- a/src/grt/grt-signals.ads
+++ b/src/grt/grt-signals.ads
@@ -24,6 +24,7 @@ with System;
with Ada.Unchecked_Conversion;
with Grt.Table;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Rtis; use Grt.Rtis;
limited with Grt.Processes;
pragma Elaborate_All (Grt.Table);
diff --git a/src/grt/grt-std_logic_1164.adb b/src/grt/grt-std_logic_1164.adb
index bb6f49207..d2607c4fe 100644
--- a/src/grt/grt-std_logic_1164.adb
+++ b/src/grt/grt-std_logic_1164.adb
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Lib;
with Grt.Errors; use Grt.Errors;
with Grt.Severity; use Grt.Severity;
diff --git a/src/grt/grt-to_strings.ads b/src/grt/grt-to_strings.ads
index 5b19a9b9b..184bf8d78 100644
--- a/src/grt/grt-to_strings.ads
+++ b/src/grt/grt-to_strings.ads
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
package Grt.To_Strings is
-- Write the image of N into STR padded to the right. FIRST is the index
diff --git a/src/grt/grt-types.ads b/src/grt/grt-types.ads
index 5754c9e42..788840b21 100644
--- a/src/grt/grt-types.ads
+++ b/src/grt/grt-types.ads
@@ -45,71 +45,12 @@ package Grt.Types is
type Ghdl_Index_Type is mod 2 ** 32;
subtype Ghdl_Real is Ghdl_F64;
- type Ghdl_Dir_Type is (Dir_To, Dir_Downto);
- for Ghdl_Dir_Type use (Dir_To => 0, Dir_Downto => 1);
- for Ghdl_Dir_Type'Size use 8;
-
-- Access to an unconstrained string.
type String_Access is access String;
type String_Cst is access constant String;
procedure Unchecked_Deallocation is new Ada.Unchecked_Deallocation
(Name => String_Access, Object => String);
- subtype Std_Integer is Ghdl_I32;
-
- type Std_Integer_Acc is access Std_Integer;
- pragma Convention (C, Std_Integer_Acc);
-
- type Std_Time is new Ghdl_I64;
- Bad_Time : constant Std_Time := Std_Time'First;
-
- type Std_Integer_Trt is record
- Left : Std_Integer;
- Right : Std_Integer;
- Dir : Ghdl_Dir_Type;
- Length : Ghdl_Index_Type;
- end record;
-
- type Std_Integer_Range_Ptr is access Std_Integer_Trt;
- pragma Convention (C, Std_Integer_Range_Ptr);
-
- subtype Std_Character is Character;
- type Std_String_Uncons is array (Ghdl_Index_Type range <>) of Std_Character;
- subtype Std_String_Base is Std_String_Uncons (Ghdl_Index_Type);
- type Std_String_Basep is access all Std_String_Base;
- function To_Std_String_Basep is new Ada.Unchecked_Conversion
- (Source => Address, Target => Std_String_Basep);
-
- type Std_String_Bound is record
- Dim_1 : Std_Integer_Trt;
- end record;
- type Std_String_Boundp is access all Std_String_Bound;
- function To_Std_String_Boundp is new Ada.Unchecked_Conversion
- (Source => Address, Target => Std_String_Boundp);
-
- type Std_String is record
- Base : Std_String_Basep;
- Bounds : Std_String_Boundp;
- end record;
- type Std_String_Ptr is access all Std_String;
- function To_Std_String_Ptr is new Ada.Unchecked_Conversion
- (Source => Address, Target => Std_String_Ptr);
-
- type Std_Bit is ('0', '1');
- type Std_Bit_Vector_Uncons is array (Ghdl_Index_Type range <>) of Std_Bit;
- subtype Std_Bit_Vector_Base is Std_Bit_Vector_Uncons (Ghdl_Index_Type);
- type Std_Bit_Vector_Basep is access all Std_Bit_Vector_Base;
-
- -- An unconstrained array.
- -- It is in fact a fat pointer to the base and the bounds.
- type Ghdl_Uc_Array is record
- Base : Address;
- Bounds : Address;
- end record;
- type Ghdl_Uc_Array_Acc is access Ghdl_Uc_Array;
- function To_Ghdl_Uc_Array_Acc is new Ada.Unchecked_Conversion
- (Source => Address, Target => Ghdl_Uc_Array_Acc);
-
-- Verilog types.
type Ghdl_Logic32 is record
@@ -229,73 +170,6 @@ package Grt.Types is
function To_Ghdl_Value_Ptr is new Ada.Unchecked_Conversion
(Source => Address, Target => Ghdl_Value_Ptr);
- -- Ranges.
- type Ghdl_Range_B1 is record
- Left : Ghdl_B1;
- Right : Ghdl_B1;
- Dir : Ghdl_Dir_Type;
- Len : Ghdl_Index_Type;
- end record;
-
- type Ghdl_Range_E8 is record
- Left : Ghdl_E8;
- Right : Ghdl_E8;
- Dir : Ghdl_Dir_Type;
- Len : Ghdl_Index_Type;
- end record;
-
- type Ghdl_Range_E32 is record
- Left : Ghdl_E32;
- Right : Ghdl_E32;
- Dir : Ghdl_Dir_Type;
- Len : Ghdl_Index_Type;
- end record;
-
- type Ghdl_Range_I32 is record
- Left : Ghdl_I32;
- Right : Ghdl_I32;
- Dir : Ghdl_Dir_Type;
- Len : Ghdl_Index_Type;
- end record;
-
- type Ghdl_Range_I64 is record
- Left : Ghdl_I64;
- Right : Ghdl_I64;
- Dir : Ghdl_Dir_Type;
- Len : Ghdl_Index_Type;
- end record;
-
- type Ghdl_Range_F64 is record
- Left : Ghdl_F64;
- Right : Ghdl_F64;
- Dir : Ghdl_Dir_Type;
- end record;
-
- type Ghdl_Range_Type (K : Mode_Type := Mode_B1) is record
- case K is
- when Mode_B1 =>
- B1 : Ghdl_Range_B1;
- when Mode_E8 =>
- E8 : Ghdl_Range_E8;
- when Mode_E32 =>
- E32 : Ghdl_Range_E32;
- when Mode_I32 =>
- I32 : Ghdl_Range_I32;
- when Mode_I64 =>
- P64 : Ghdl_Range_I64;
- when Mode_F64 =>
- F64 : Ghdl_Range_F64;
- end case;
- end record;
- pragma Unchecked_Union (Ghdl_Range_Type);
-
- type Ghdl_Range_Ptr is access all Ghdl_Range_Type;
-
- function To_Ghdl_Range_Ptr is new Ada.Unchecked_Conversion
- (Source => Address, Target => Ghdl_Range_Ptr);
-
- type Ghdl_Range_Array is array (Ghdl_Index_Type range <>) of Ghdl_Range_Ptr;
-
type Ghdl_Indexes_Type is record
Value : Ghdl_Index_Type;
Signal : Ghdl_Index_Type;
@@ -343,11 +217,4 @@ package Grt.Types is
function To_Integer is new Ada.Unchecked_Conversion
(Source => Address, Target => Integer_Address);
-
- -- The NOW value.
- Current_Time : Std_Time;
- -- The current delta cycle number.
- Current_Delta : Integer;
-private
- pragma Export (C, Current_Time, "__ghdl_now");
end Grt.Types;
diff --git a/src/grt/grt-values.ads b/src/grt/grt-values.ads
index 07fb03dd0..369c69cfd 100644
--- a/src/grt/grt-values.ads
+++ b/src/grt/grt-values.ads
@@ -21,6 +21,7 @@
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Rtis; use Grt.Rtis;
package Grt.Values is
diff --git a/src/grt/grt-vcd.ads b/src/grt/grt-vcd.ads
index 62910adf4..c849b69d6 100644
--- a/src/grt/grt-vcd.ads
+++ b/src/grt/grt-vcd.ads
@@ -23,6 +23,7 @@
with System;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Avhpi; use Grt.Avhpi;
with Grt.Rtis;
diff --git a/src/grt/grt-vhdl_types.ads b/src/grt/grt-vhdl_types.ads
new file mode 100644
index 000000000..42db6b9dd
--- /dev/null
+++ b/src/grt/grt-vhdl_types.ads
@@ -0,0 +1,163 @@
+-- GHDL Run Time (GRT) - common types.
+-- Copyright (C) 2002 - 2014 Tristan Gingold
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <gnu.org/licenses>.
+--
+-- As a special exception, if other files instantiate generics from this
+-- unit, or you link this unit with other files to produce an executable,
+-- this unit does not by itself cause the resulting executable to be
+-- covered by the GNU General Public License. This exception does not
+-- however invalidate any other reasons why the executable file might be
+-- covered by the GNU Public License.
+with System; use System;
+with Ada.Unchecked_Conversion;
+
+with Grt.Types; use Grt.Types;
+
+package Grt.Vhdl_Types is
+ pragma Preelaborate (Grt.Vhdl_Types);
+
+ type Ghdl_Dir_Type is (Dir_To, Dir_Downto);
+ for Ghdl_Dir_Type use (Dir_To => 0, Dir_Downto => 1);
+ for Ghdl_Dir_Type'Size use 8;
+
+ subtype Std_Integer is Ghdl_I32;
+
+ type Std_Integer_Acc is access Std_Integer;
+ pragma Convention (C, Std_Integer_Acc);
+
+ type Std_Time is new Ghdl_I64;
+ Bad_Time : constant Std_Time := Std_Time'First;
+
+ type Std_Integer_Trt is record
+ Left : Std_Integer;
+ Right : Std_Integer;
+ Dir : Ghdl_Dir_Type;
+ Length : Ghdl_Index_Type;
+ end record;
+
+ type Std_Integer_Range_Ptr is access Std_Integer_Trt;
+ pragma Convention (C, Std_Integer_Range_Ptr);
+
+ subtype Std_Character is Character;
+ type Std_String_Uncons is array (Ghdl_Index_Type range <>) of Std_Character;
+ subtype Std_String_Base is Std_String_Uncons (Ghdl_Index_Type);
+ type Std_String_Basep is access all Std_String_Base;
+ function To_Std_String_Basep is new Ada.Unchecked_Conversion
+ (Source => Address, Target => Std_String_Basep);
+
+ type Std_String_Bound is record
+ Dim_1 : Std_Integer_Trt;
+ end record;
+ type Std_String_Boundp is access all Std_String_Bound;
+ function To_Std_String_Boundp is new Ada.Unchecked_Conversion
+ (Source => Address, Target => Std_String_Boundp);
+
+ type Std_String is record
+ Base : Std_String_Basep;
+ Bounds : Std_String_Boundp;
+ end record;
+ type Std_String_Ptr is access all Std_String;
+ function To_Std_String_Ptr is new Ada.Unchecked_Conversion
+ (Source => Address, Target => Std_String_Ptr);
+
+ type Std_Bit is ('0', '1');
+ type Std_Bit_Vector_Uncons is array (Ghdl_Index_Type range <>) of Std_Bit;
+ subtype Std_Bit_Vector_Base is Std_Bit_Vector_Uncons (Ghdl_Index_Type);
+ type Std_Bit_Vector_Basep is access all Std_Bit_Vector_Base;
+
+ -- An unconstrained array.
+ -- It is in fact a fat pointer to the base and the bounds.
+ type Ghdl_Uc_Array is record
+ Base : Address;
+ Bounds : Address;
+ end record;
+ type Ghdl_Uc_Array_Acc is access Ghdl_Uc_Array;
+ function To_Ghdl_Uc_Array_Acc is new Ada.Unchecked_Conversion
+ (Source => Address, Target => Ghdl_Uc_Array_Acc);
+
+ -- Ranges.
+ type Ghdl_Range_B1 is record
+ Left : Ghdl_B1;
+ Right : Ghdl_B1;
+ Dir : Ghdl_Dir_Type;
+ Len : Ghdl_Index_Type;
+ end record;
+
+ type Ghdl_Range_E8 is record
+ Left : Ghdl_E8;
+ Right : Ghdl_E8;
+ Dir : Ghdl_Dir_Type;
+ Len : Ghdl_Index_Type;
+ end record;
+
+ type Ghdl_Range_E32 is record
+ Left : Ghdl_E32;
+ Right : Ghdl_E32;
+ Dir : Ghdl_Dir_Type;
+ Len : Ghdl_Index_Type;
+ end record;
+
+ type Ghdl_Range_I32 is record
+ Left : Ghdl_I32;
+ Right : Ghdl_I32;
+ Dir : Ghdl_Dir_Type;
+ Len : Ghdl_Index_Type;
+ end record;
+
+ type Ghdl_Range_I64 is record
+ Left : Ghdl_I64;
+ Right : Ghdl_I64;
+ Dir : Ghdl_Dir_Type;
+ Len : Ghdl_Index_Type;
+ end record;
+
+ type Ghdl_Range_F64 is record
+ Left : Ghdl_F64;
+ Right : Ghdl_F64;
+ Dir : Ghdl_Dir_Type;
+ end record;
+
+ type Ghdl_Range_Type (K : Mode_Type := Mode_B1) is record
+ case K is
+ when Mode_B1 =>
+ B1 : Ghdl_Range_B1;
+ when Mode_E8 =>
+ E8 : Ghdl_Range_E8;
+ when Mode_E32 =>
+ E32 : Ghdl_Range_E32;
+ when Mode_I32 =>
+ I32 : Ghdl_Range_I32;
+ when Mode_I64 =>
+ P64 : Ghdl_Range_I64;
+ when Mode_F64 =>
+ F64 : Ghdl_Range_F64;
+ end case;
+ end record;
+ pragma Unchecked_Union (Ghdl_Range_Type);
+
+ type Ghdl_Range_Ptr is access all Ghdl_Range_Type;
+
+ function To_Ghdl_Range_Ptr is new Ada.Unchecked_Conversion
+ (Source => Address, Target => Ghdl_Range_Ptr);
+
+ type Ghdl_Range_Array is array (Ghdl_Index_Type range <>) of Ghdl_Range_Ptr;
+
+ -- The NOW value.
+ Current_Time : Std_Time;
+ -- The current delta cycle number.
+ Current_Delta : Integer;
+private
+ pragma Export (C, Current_Time, "__ghdl_now");
+end Grt.Vhdl_Types;
diff --git a/src/grt/grt-vhpi.adb b/src/grt/grt-vhpi.adb
index 1f0fba1ca..292e04f28 100644
--- a/src/grt/grt-vhpi.adb
+++ b/src/grt/grt-vhpi.adb
@@ -15,6 +15,7 @@
-- along with this program. If not, see <gnu.org/licenses>.
with Ada.Unchecked_Conversion;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Astdio; use Grt.Astdio;
with Grt.Astdio.Vhdl; use Grt.Astdio.Vhdl;
with Grt.Errors; use Grt.Errors;
diff --git a/src/grt/grt-vpi.adb b/src/grt/grt-vpi.adb
index a1dfb57ed..f0fb5b823 100644
--- a/src/grt/grt-vpi.adb
+++ b/src/grt/grt-vpi.adb
@@ -38,6 +38,7 @@
with Ada.Unchecked_Deallocation;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Stdio; use Grt.Stdio;
with Grt.C; use Grt.C;
with Grt.Signals; use Grt.Signals;
diff --git a/src/grt/grt-waves.adb b/src/grt/grt-waves.adb
index a2fc86356..a513ef010 100644
--- a/src/grt/grt-waves.adb
+++ b/src/grt/grt-waves.adb
@@ -26,6 +26,7 @@ with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with Interfaces; use Interfaces;
with Grt.Types; use Grt.Types;
+with Grt.Vhdl_Types; use Grt.Vhdl_Types;
with Grt.Avhpi; use Grt.Avhpi;
with Grt.Stdio; use Grt.Stdio;
with Grt.C; use Grt.C;