aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorBrian Padalino <bpadalino@gmail.com>2021-09-22 11:38:59 -0400
committertgingold <tgingold@users.noreply.github.com>2021-09-22 20:03:00 +0200
commit111007296f1553540a78f59d20197faba29d43c9 (patch)
tree86cf06f7bf91128e7b41e4caeb3824bc514f2e17 /src/grt
parentb4b25fe5e5d77ba712552acc5edae7c64832d1ca (diff)
downloadghdl-111007296f1553540a78f59d20197faba29d43c9.tar.gz
ghdl-111007296f1553540a78f59d20197faba29d43c9.tar.bz2
ghdl-111007296f1553540a78f59d20197faba29d43c9.zip
Add explicit ?>= and ?> functions for translation.
Instead of swapping L/R arguments to try to create ?>= and ?>, create a function for each which performs the not operation of ?< and ?<= as defined by the LRM.
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/grt-std_logic_1164.adb14
-rw-r--r--src/grt/grt-std_logic_1164.ads4
2 files changed, 18 insertions, 0 deletions
diff --git a/src/grt/grt-std_logic_1164.adb b/src/grt/grt-std_logic_1164.adb
index 675039b3d..bb6f49207 100644
--- a/src/grt/grt-std_logic_1164.adb
+++ b/src/grt/grt-std_logic_1164.adb
@@ -91,6 +91,20 @@ package body Grt.Std_Logic_1164 is
Match_Eq_Table (Left, Right)));
end Ghdl_Std_Ulogic_Match_Le;
+ function Ghdl_Std_Ulogic_Match_Ge (L, R : Ghdl_E8) return Ghdl_E8
+ is
+ Lt : constant Ghdl_E8 := Ghdl_Std_Ulogic_Match_Lt(L, R);
+ begin
+ return Std_Ulogic'Pos (Not_Table (Std_Ulogic'Val(Lt))) ;
+ end Ghdl_Std_Ulogic_Match_Ge;
+
+ function Ghdl_Std_Ulogic_Match_Gt (L, R : Ghdl_E8) return Ghdl_E8
+ is
+ Le : constant Ghdl_E8 := Ghdl_Std_Ulogic_Match_Le(L, R);
+ begin
+ return Std_Ulogic'Pos (Not_Table (Std_Ulogic'Val(Le))) ;
+ end Ghdl_Std_Ulogic_Match_Gt;
+
Assert_Arr_Msg : constant String :=
"parameters of '?=' array operator are not of the same length";
diff --git a/src/grt/grt-std_logic_1164.ads b/src/grt/grt-std_logic_1164.ads
index 38b78c7cf..8d2b09457 100644
--- a/src/grt/grt-std_logic_1164.ads
+++ b/src/grt/grt-std_logic_1164.ads
@@ -96,6 +96,8 @@ package Grt.Std_Logic_1164 is
function Ghdl_Std_Ulogic_Match_Ne (L, R : Ghdl_E8) return Ghdl_E8;
function Ghdl_Std_Ulogic_Match_Lt (L, R : Ghdl_E8) return Ghdl_E8;
function Ghdl_Std_Ulogic_Match_Le (L, R : Ghdl_E8) return Ghdl_E8;
+ function Ghdl_Std_Ulogic_Match_Ge (L, R : Ghdl_E8) return Ghdl_E8;
+ function Ghdl_Std_Ulogic_Match_Gt (L, R : Ghdl_E8) return Ghdl_E8;
-- For Gt and Ge, use Lt and Le with swapped parameters.
function Ghdl_Std_Ulogic_Array_Match_Eq (L : Ghdl_Ptr;
@@ -114,6 +116,8 @@ private
pragma Export (C, Ghdl_Std_Ulogic_Match_Ne, "__ghdl_std_ulogic_match_ne");
pragma Export (C, Ghdl_Std_Ulogic_Match_Lt, "__ghdl_std_ulogic_match_lt");
pragma Export (C, Ghdl_Std_Ulogic_Match_Le, "__ghdl_std_ulogic_match_le");
+ pragma Export (C, Ghdl_Std_Ulogic_Match_Ge, "__ghdl_std_ulogic_match_ge");
+ pragma Export (C, Ghdl_Std_Ulogic_Match_Gt, "__ghdl_std_ulogic_match_gt");
pragma Export (C, Ghdl_Std_Ulogic_Array_Match_Eq,
"__ghdl_std_ulogic_array_match_eq");