aboutsummaryrefslogtreecommitdiffstats
path: root/translate/grt
diff options
context:
space:
mode:
Diffstat (limited to 'translate/grt')
-rw-r--r--translate/grt/grt-lib.adb36
-rw-r--r--translate/grt/grt-lib.ads31
2 files changed, 47 insertions, 20 deletions
diff --git a/translate/grt/grt-lib.adb b/translate/grt/grt-lib.adb
index 2fe1bc6aa..fcbbecb64 100644
--- a/translate/grt/grt-lib.adb
+++ b/translate/grt/grt-lib.adb
@@ -43,6 +43,7 @@ package body Grt.Lib is
procedure Do_Report (Msg : String;
Str : Std_String_Ptr;
+ Default_Str : String;
Severity : Integer;
Loc : Ghdl_Location_Ptr;
Unit : Ghdl_Rti_Access)
@@ -96,7 +97,11 @@ package body Grt.Lib is
Report_C ("???");
end case;
Report_C ("): ");
- Report_E (Str);
+ if Str /= null then
+ Report_E (Str);
+ else
+ Report_E (Default_Str);
+ end if;
if Level >= Grt.Options.Severity_Level then
Error_C (Msg);
Error_E (" failed");
@@ -110,7 +115,8 @@ package body Grt.Lib is
Unit : Ghdl_Rti_Access)
is
begin
- Do_Report ("assertion", Str, Severity, Loc, Unit);
+ Do_Report ("assertion",
+ Str, "Assertion violation", Severity, Loc, Unit);
end Ghdl_Assert_Failed;
procedure Ghdl_Psl_Assert_Failed
@@ -120,9 +126,31 @@ package body Grt.Lib is
Unit : Ghdl_Rti_Access)
is
begin
- Do_Report ("psl assertion", Str, Severity, Loc, Unit);
+ Do_Report ("psl assertion",
+ Str, "Assertion violation", Severity, Loc, Unit);
end Ghdl_Psl_Assert_Failed;
+ procedure Ghdl_Psl_Cover
+ (Str : Std_String_Ptr;
+ Severity : Integer;
+ Loc : Ghdl_Location_Ptr;
+ Unit : Ghdl_Rti_Access)
+ is
+ begin
+ Do_Report ("psl cover", Str, "sequence covered", Severity, Loc, Unit);
+ end Ghdl_Psl_Cover;
+
+ procedure Ghdl_Psl_Cover_Failed
+ (Str : Std_String_Ptr;
+ Severity : Integer;
+ Loc : Ghdl_Location_Ptr;
+ Unit : Ghdl_Rti_Access)
+ is
+ begin
+ Do_Report ("psl cover failure",
+ Str, "sequence not covered", Severity, Loc, Unit);
+ end Ghdl_Psl_Cover_Failed;
+
procedure Ghdl_Report
(Str : Std_String_Ptr;
Severity : Integer;
@@ -130,7 +158,7 @@ package body Grt.Lib is
Unit : Ghdl_Rti_Access)
is
begin
- Do_Report ("report", Str, Severity, Loc, Unit);
+ Do_Report ("report", Str, "Assertion violation", Severity, Loc, Unit);
end Ghdl_Report;
procedure Ghdl_Program_Error (Filename : Ghdl_C_String;
diff --git a/translate/grt/grt-lib.ads b/translate/grt/grt-lib.ads
index f8cc92806..580406dcc 100644
--- a/translate/grt/grt-lib.ads
+++ b/translate/grt/grt-lib.ads
@@ -43,6 +43,19 @@ package Grt.Lib is
Loc : Ghdl_Location_Ptr;
Unit : Ghdl_Rti_Access);
+ -- Called when a sequence is covered (in a cover directive)
+ procedure Ghdl_Psl_Cover
+ (Str : Std_String_Ptr;
+ Severity : Integer;
+ Loc : Ghdl_Location_Ptr;
+ Unit : Ghdl_Rti_Access);
+
+ procedure Ghdl_Psl_Cover_Failed
+ (Str : Std_String_Ptr;
+ Severity : Integer;
+ Loc : Ghdl_Location_Ptr;
+ Unit : Ghdl_Rti_Access);
+
procedure Ghdl_Report
(Str : Std_String_Ptr;
Severity : Integer;
@@ -77,22 +90,6 @@ package Grt.Lib is
function Ghdl_Real_Exp (X : Ghdl_Real; Exp : Ghdl_I32)
return Ghdl_Real;
- -- Create a vhdl string.
- Ghdl_Assert_Default_Report_Arr : constant String := "Assertion violation";
- Ghdl_Assert_Default_Report_Bounds : constant Std_String_Bound :=
- (Dim_1 => (Left => 1,
- Right => Ghdl_Assert_Default_Report_Arr'Length,
- Dir => Dir_To,
- Length => Ghdl_Assert_Default_Report_Arr'Length));
- Ghdl_Assert_Default_Report : constant Ghdl_Uc_Array :=
- (Base => Ghdl_Assert_Default_Report_Arr'Address,
- Bounds => Ghdl_Assert_Default_Report_Bounds'Address);
-
- -- Unfortunatly, with gnat 3.15p, we cannot use a deferred constant with
- -- the export pragma.
- pragma Export (C, Ghdl_Assert_Default_Report,
- "__ghdl_assert_default_report");
-
type Ghdl_Std_Ulogic_Boolean_Array_Type is array (Ghdl_E8 range 0 .. 8)
of Ghdl_B2;
@@ -112,6 +109,8 @@ private
pragma Export (C, Ghdl_Assert_Failed, "__ghdl_assert_failed");
pragma Export (C, Ghdl_Psl_Assert_Failed, "__ghdl_psl_assert_failed");
+ pragma Export (C, Ghdl_Psl_Cover, "__ghdl_psl_cover");
+ pragma Export (C, Ghdl_Psl_Cover_Failed, "__ghdl_psl_cover_failed");
pragma Export (C, Ghdl_Report, "__ghdl_report");
pragma Export (C, Ghdl_Bound_Check_Failed_L0,