diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-09-04 06:12:20 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-09-05 19:54:08 +0200 |
commit | a060bbe2f05b222b977989c2baa04faa72c5d4fd (patch) | |
tree | 45594b3ca271c76667e1cf31638cd70cba51c600 /src/synth/synth-ieee-utils.ads | |
parent | 0d6b21c3b5639af8b321cc7f85fbf03da78d7edb (diff) | |
download | ghdl-a060bbe2f05b222b977989c2baa04faa72c5d4fd.tar.gz ghdl-a060bbe2f05b222b977989c2baa04faa72c5d4fd.tar.bz2 ghdl-a060bbe2f05b222b977989c2baa04faa72c5d4fd.zip |
synth: add evaluation for ieee.std_logic_arith
Diffstat (limited to 'src/synth/synth-ieee-utils.ads')
-rw-r--r-- | src/synth/synth-ieee-utils.ads | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/synth/synth-ieee-utils.ads b/src/synth/synth-ieee-utils.ads index d2fe7d5b4..564fbb74c 100644 --- a/src/synth/synth-ieee-utils.ads +++ b/src/synth/synth-ieee-utils.ads @@ -18,6 +18,8 @@ with Types; use Types; +with Elab.Memtype; use Elab.Memtype; + with Synth.Ieee.Std_Logic_1164; use Synth.Ieee.Std_Logic_1164; package Synth.Ieee.Utils is @@ -40,6 +42,30 @@ package Synth.Ieee.Utils is Sl_To_X01 : constant Sl_To_X01_Array := ('0' | 'L' => '0', '1' | 'H' => '1', others => 'X'); + type Sl_To_01_Array is array (Std_Ulogic) of Sl_01; + Sl_To_01 : constant Sl_To_X01_Array := + ('1' | 'H' => '1', others => '0'); + type Uns_To_01_Array is array (Uns64 range 0 .. 1) of Sl_X01; Uns_To_01 : constant Uns_To_01_Array := (0 => '0', 1 => '1'); + + procedure Fill (Res : Memory_Ptr; Len : Uns32; V : Std_Ulogic); + + -- Note: SRC = DST is allowed. + procedure Neg_Vec (Src : Memory_Ptr; Dst : Memory_Ptr; Len : Uns32); + + -- Note: SRC = DST is allowed. + procedure Abs_Vec (Src : Memory_Ptr; Dst : Memory_Ptr; Len : Uns32); + + -- Multiplication. + -- Length of RES is LLEN + RLEN + 1 (if L_SIGN /= R_SIGN) + procedure Mul_Vec (L, R : Memory_Ptr; + Llen, Rlen : Uns32; + L_Sign, R_Sign : Boolean; + Res : Memory_Ptr); + + -- Assume no X (they are considered as '0'). + function Compare_Vec (L, R : Memory_Ptr; + Llen, Rlen : Uns32; + L_Sign, R_Sign : Boolean) return Order_Type; end Synth.Ieee.Utils; |