diff options
Diffstat (limited to 'src/synth/synth-ieee-numeric_std.ads')
-rw-r--r-- | src/synth/synth-ieee-numeric_std.ads | 122 |
1 files changed, 76 insertions, 46 deletions
diff --git a/src/synth/synth-ieee-numeric_std.ads b/src/synth/synth-ieee-numeric_std.ads index 69ebaae1a..22616986e 100644 --- a/src/synth/synth-ieee-numeric_std.ads +++ b/src/synth/synth-ieee-numeric_std.ads @@ -19,72 +19,97 @@ with Types; use Types; with Elab.Vhdl_Objtypes; use Elab.Vhdl_Objtypes; -with Synth.Source; use Synth.Source; package Synth.Ieee.Numeric_Std is -- Reminder: vectors elements are from left to right. - function Compare_Uns_Uns - (Left, Right : Memtyp; Err : Order_Type; Loc : Syn_Src) return Order_Type; - function Compare_Uns_Nat - (Left, Right : Memtyp; Err : Order_Type; Loc : Syn_Src) return Order_Type; - function Compare_Nat_Uns - (Left, Right : Memtyp; Err : Order_Type; Loc : Syn_Src) return Order_Type; - function Compare_Sgn_Sgn - (Left, Right : Memtyp; Err : Order_Type; Loc : Syn_Src) return Order_Type; - function Compare_Sgn_Int - (Left, Right : Memtyp; Err : Order_Type; Loc : Syn_Src) return Order_Type; + function Compare_Uns_Uns (Left, Right : Memtyp; + Err : Order_Type; + Loc : Location_Type) return Order_Type; + function Compare_Uns_Nat (Left, Right : Memtyp; + Err : Order_Type; + Loc : Location_Type) return Order_Type; + function Compare_Nat_Uns (Left, Right : Memtyp; + Err : Order_Type; + Loc : Location_Type) return Order_Type; + function Compare_Sgn_Sgn (Left, Right : Memtyp; + Err : Order_Type; + Loc : Location_Type) return Order_Type; + function Compare_Sgn_Int (Left, Right : Memtyp; + Err : Order_Type; + Loc : Location_Type) return Order_Type; -- Unary "-" - function Neg_Vec (V : Memtyp; Loc : Syn_Src) return Memtyp; + function Neg_Vec (V : Memtyp; Loc : Location_Type) return Memtyp; -- "abs" - function Abs_Vec (V : Memtyp; Loc : Syn_Src) return Memtyp; + function Abs_Vec (V : Memtyp; Loc : Location_Type) return Memtyp; -- "+" - function Add_Uns_Uns (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Add_Sgn_Sgn (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Add_Sgn_Int (L : Memtyp; R : Int64; Loc : Syn_Src) return Memtyp; - function Add_Uns_Nat (L : Memtyp; R : Uns64; Loc : Syn_Src) return Memtyp; + function Add_Uns_Uns (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Add_Sgn_Sgn (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Add_Sgn_Int (L : Memtyp; R : Int64; Loc : Location_Type) + return Memtyp; + function Add_Uns_Nat (L : Memtyp; R : Uns64; Loc : Location_Type) + return Memtyp; -- "-" - function Sub_Uns_Uns (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Sub_Uns_Nat (L : Memtyp; R : Uns64; Loc : Syn_Src) return Memtyp; - function Sub_Nat_Uns (L : Uns64; R : Memtyp; Loc : Syn_Src) return Memtyp; - - function Sub_Sgn_Sgn (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Sub_Sgn_Int (L : Memtyp; R : Int64; Loc : Syn_Src) return Memtyp; - function Sub_Int_Sgn (L : Int64; R : Memtyp; Loc : Syn_Src) return Memtyp; + function Sub_Uns_Uns (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Sub_Uns_Nat (L : Memtyp; R : Uns64; Loc : Location_Type) + return Memtyp; + function Sub_Nat_Uns (L : Uns64; R : Memtyp; Loc : Location_Type) + return Memtyp; + + function Sub_Sgn_Sgn (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Sub_Sgn_Int (L : Memtyp; R : Int64; Loc : Location_Type) + return Memtyp; + function Sub_Int_Sgn (L : Int64; R : Memtyp; Loc : Location_Type) + return Memtyp; -- "*" - function Mul_Uns_Uns (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Mul_Nat_Uns (L : Uns64; R : Memtyp; Loc : Syn_Src) return Memtyp; - function Mul_Uns_Nat (L : Memtyp; R : Uns64; Loc : Syn_Src) return Memtyp; - - function Mul_Sgn_Sgn (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Mul_Int_Sgn (L : Int64; R : Memtyp; Loc : Syn_Src) return Memtyp; - function Mul_Sgn_Int (L : Memtyp; R : Int64; Loc : Syn_Src) return Memtyp; + function Mul_Uns_Uns (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Mul_Nat_Uns (L : Uns64; R : Memtyp; Loc : Location_Type) + return Memtyp; + function Mul_Uns_Nat (L : Memtyp; R : Uns64; Loc : Location_Type) + return Memtyp; + + function Mul_Sgn_Sgn (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Mul_Int_Sgn (L : Int64; R : Memtyp; Loc : Location_Type) + return Memtyp; + function Mul_Sgn_Int (L : Memtyp; R : Int64; Loc : Location_Type) + return Memtyp; -- "/" - function Div_Uns_Uns (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Div_Uns_Nat (L : Memtyp; R : Uns64; Loc : Syn_Src) return Memtyp; - function Div_Nat_Uns (L : Uns64; R : Memtyp; Loc : Syn_Src) return Memtyp; - function Div_Sgn_Sgn (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Div_Sgn_Int (L : Memtyp; R : Int64; Loc : Syn_Src) return Memtyp; - function Div_Int_Sgn (L : Int64; R : Memtyp; Loc : Syn_Src) return Memtyp; + function Div_Uns_Uns (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Div_Uns_Nat (L : Memtyp; R : Uns64; Loc : Location_Type) + return Memtyp; + function Div_Nat_Uns (L : Uns64; R : Memtyp; Loc : Location_Type) + return Memtyp; + function Div_Sgn_Sgn (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Div_Sgn_Int (L : Memtyp; R : Int64; Loc : Location_Type) + return Memtyp; + function Div_Int_Sgn (L : Int64; R : Memtyp; Loc : Location_Type) + return Memtyp; -- "rem" - function Rem_Uns_Uns (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Rem_Uns_Nat (L : Memtyp; R : Uns64; Loc : Syn_Src) return Memtyp; - function Rem_Nat_Uns (L : Uns64; R : Memtyp; Loc : Syn_Src) return Memtyp; - function Rem_Sgn_Sgn (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Rem_Sgn_Int (L : Memtyp; R : Int64; Loc : Syn_Src) return Memtyp; - function Rem_Int_Sgn (L : Int64; R : Memtyp; Loc : Syn_Src) return Memtyp; + function Rem_Uns_Uns (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Rem_Uns_Nat (L : Memtyp; R : Uns64; Loc : Location_Type) + return Memtyp; + function Rem_Nat_Uns (L : Uns64; R : Memtyp; Loc : Location_Type) + return Memtyp; + function Rem_Sgn_Sgn (L, R : Memtyp; Loc : Location_Type) return Memtyp; + function Rem_Sgn_Int (L : Memtyp; R : Int64; Loc : Location_Type) + return Memtyp; + function Rem_Int_Sgn (L : Int64; R : Memtyp; Loc : Location_Type) + return Memtyp; -- "mod" - function Mod_Sgn_Sgn (L, R : Memtyp; Loc : Syn_Src) return Memtyp; - function Mod_Sgn_Int (L : Memtyp; R : Int64; Loc : Syn_Src) return Memtyp; - function Mod_Int_Sgn (L : Int64; R : Memtyp; Loc : Syn_Src) return Memtyp; + function Mod_Sgn_Sgn (L, R : Memtyp; Loc : Location_Type) + return Memtyp; + function Mod_Sgn_Int (L : Memtyp; R : Int64; Loc : Location_Type) + return Memtyp; + function Mod_Int_Sgn (L : Int64; R : Memtyp; Loc : Location_Type) + return Memtyp; -- Shift function Shift_Vec (Val : Memtyp; @@ -100,4 +125,9 @@ package Synth.Ieee.Numeric_Std is function Resize_Vec (Val : Memtyp; Size : Uns32; Signed : Boolean) return Memtyp; + + -- Minimum/Maximum. + function Minmax (L, R : Memtyp; Is_Signed : Boolean; Is_Max : Boolean) + return Memtyp; + end Synth.Ieee.Numeric_Std; |