📄 fixed_pkg_c.vhdl
字号:
-- 1 / ufixed(a downto b) = ufixed(-b downto -a-1) function reciprocal ( arg : UNRESOLVED_ufixed; -- fixed point input constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed; -- 1 / sfixed(a downto b) = sfixed(-b+1 downto -a) function reciprocal ( arg : UNRESOLVED_sfixed; -- fixed point input constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed; -- REM function -- ufixed (a downto b) rem ufixed (c downto d) -- = ufixed (minimum(a,c) downto minimum(b,d)) function remainder ( l, r : UNRESOLVED_ufixed; constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed; -- sfixed (a downto b) rem sfixed (c downto d) -- = sfixed (minimum(a,c) downto minimum(b,d)) function remainder ( l, r : UNRESOLVED_sfixed; constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed; -- mod function -- ufixed (a downto b) mod ufixed (c downto d) -- = ufixed (minimum(a,c) downto minimum(b, d)) function modulo ( l, r : UNRESOLVED_ufixed; constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_ufixed; -- sfixed (a downto b) mod sfixed (c downto d) -- = sfixed (c downto minimum(b, d)) function modulo ( l, r : UNRESOLVED_sfixed; constant overflow_style : fixed_overflow_style_type := fixed_overflow_style; constant round_style : fixed_round_style_type := fixed_round_style; constant guard_bits : NATURAL := fixed_guard_bits) return UNRESOLVED_sfixed; -- Procedure for those who need an "accumulator" function. -- add_carry (ufixed(a downto b), ufixed (c downto d)) -- = ufixed (maximum(a,c) downto minimum(b,d)) procedure add_carry ( L, R : in UNRESOLVED_ufixed; c_in : in STD_ULOGIC; result : out UNRESOLVED_ufixed; c_out : out STD_ULOGIC); -- add_carry (sfixed(a downto b), sfixed (c downto d)) -- = sfixed (maximum(a,c) downto minimum(b,d)) procedure add_carry ( L, R : in UNRESOLVED_sfixed; c_in : in STD_ULOGIC; result : out UNRESOLVED_sfixed; c_out : out STD_ULOGIC); -- Scales the result by a power of 2. Width of input = width of output with -- the binary point moved. function scalb (y : UNRESOLVED_ufixed; N : INTEGER) return UNRESOLVED_ufixed; function scalb (y : UNRESOLVED_ufixed; N : SIGNED) return UNRESOLVED_ufixed; function scalb (y : UNRESOLVED_sfixed; N : INTEGER) return UNRESOLVED_sfixed; function scalb (y : UNRESOLVED_sfixed; N : SIGNED) return UNRESOLVED_sfixed; function Is_Negative (arg : UNRESOLVED_sfixed) return BOOLEAN; --=========================================================================== -- Comparison Operators --=========================================================================== function ">" (l, r : UNRESOLVED_ufixed) return BOOLEAN; function ">" (l, r : UNRESOLVED_sfixed) return BOOLEAN; function "<" (l, r : UNRESOLVED_ufixed) return BOOLEAN; function "<" (l, r : UNRESOLVED_sfixed) return BOOLEAN; function "<=" (l, r : UNRESOLVED_ufixed) return BOOLEAN; function "<=" (l, r : UNRESOLVED_sfixed) return BOOLEAN; function ">=" (l, r : UNRESOLVED_ufixed) return BOOLEAN; function ">=" (l, r : UNRESOLVED_sfixed) return BOOLEAN; function "=" (l, r : UNRESOLVED_ufixed) return BOOLEAN; function "=" (l, r : UNRESOLVED_sfixed) return BOOLEAN; function "/=" (l, r : UNRESOLVED_ufixed) return BOOLEAN; function "/=" (l, r : UNRESOLVED_sfixed) return BOOLEAN; function \?=\ (l, r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?/=\ (l, r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?>\ (l, r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?>=\ (l, r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?<\ (l, r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?<=\ (l, r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?=\ (l, r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?/=\ (l, r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?>\ (l, r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?>=\ (l, r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?<\ (l, r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?<=\ (l, r : UNRESOLVED_sfixed) return STD_ULOGIC; function std_match (l, r : UNRESOLVED_ufixed) return BOOLEAN; function std_match (l, r : UNRESOLVED_sfixed) return BOOLEAN; -- Overloads the default "maximum" and "minimum" function function maximum (l, r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed; function minimum (l, r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed; function maximum (l, r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed; function minimum (l, r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed; ---------------------------------------------------------------------------- -- In these compare functions a natural is converted into a -- fixed point number of the bounds "maximum(l'high,0) downto 0" ---------------------------------------------------------------------------- function "=" (l : UNRESOLVED_ufixed; r : NATURAL) return BOOLEAN; function "/=" (l : UNRESOLVED_ufixed; r : NATURAL) return BOOLEAN; function ">=" (l : UNRESOLVED_ufixed; r : NATURAL) return BOOLEAN; function "<=" (l : UNRESOLVED_ufixed; r : NATURAL) return BOOLEAN; function ">" (l : UNRESOLVED_ufixed; r : NATURAL) return BOOLEAN; function "<" (l : UNRESOLVED_ufixed; r : NATURAL) return BOOLEAN; function "=" (l : NATURAL; r : UNRESOLVED_ufixed) return BOOLEAN; function "/=" (l : NATURAL; r : UNRESOLVED_ufixed) return BOOLEAN; function ">=" (l : NATURAL; r : UNRESOLVED_ufixed) return BOOLEAN; function "<=" (l : NATURAL; r : UNRESOLVED_ufixed) return BOOLEAN; function ">" (l : NATURAL; r : UNRESOLVED_ufixed) return BOOLEAN; function "<" (l : NATURAL; r : UNRESOLVED_ufixed) return BOOLEAN; function \?=\ (l : UNRESOLVED_ufixed; r : NATURAL) return STD_ULOGIC; function \?/=\ (l : UNRESOLVED_ufixed; r : NATURAL) return STD_ULOGIC; function \?>=\ (l : UNRESOLVED_ufixed; r : NATURAL) return STD_ULOGIC; function \?<=\ (l : UNRESOLVED_ufixed; r : NATURAL) return STD_ULOGIC; function \?>\ (l : UNRESOLVED_ufixed; r : NATURAL) return STD_ULOGIC; function \?<\ (l : UNRESOLVED_ufixed; r : NATURAL) return STD_ULOGIC; function \?=\ (l : NATURAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?/=\ (l : NATURAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?>=\ (l : NATURAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?<=\ (l : NATURAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?>\ (l : NATURAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?<\ (l : NATURAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function maximum (l : UNRESOLVED_ufixed; r : NATURAL) return UNRESOLVED_ufixed; function minimum (l : UNRESOLVED_ufixed; r : NATURAL) return UNRESOLVED_ufixed; function maximum (l : NATURAL; r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed; function minimum (l : NATURAL; r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed; ---------------------------------------------------------------------------- -- In these compare functions a real is converted into a -- fixed point number of the bounds "l'high+1 downto l'low" ---------------------------------------------------------------------------- function "=" (l : UNRESOLVED_ufixed; r : REAL) return BOOLEAN; function "/=" (l : UNRESOLVED_ufixed; r : REAL) return BOOLEAN; function ">=" (l : UNRESOLVED_ufixed; r : REAL) return BOOLEAN; function "<=" (l : UNRESOLVED_ufixed; r : REAL) return BOOLEAN; function ">" (l : UNRESOLVED_ufixed; r : REAL) return BOOLEAN; function "<" (l : UNRESOLVED_ufixed; r : REAL) return BOOLEAN; function "=" (l : REAL; r : UNRESOLVED_ufixed) return BOOLEAN; function "/=" (l : REAL; r : UNRESOLVED_ufixed) return BOOLEAN; function ">=" (l : REAL; r : UNRESOLVED_ufixed) return BOOLEAN; function "<=" (l : REAL; r : UNRESOLVED_ufixed) return BOOLEAN; function ">" (l : REAL; r : UNRESOLVED_ufixed) return BOOLEAN; function "<" (l : REAL; r : UNRESOLVED_ufixed) return BOOLEAN; function \?=\ (l : UNRESOLVED_ufixed; r : REAL) return STD_ULOGIC; function \?/=\ (l : UNRESOLVED_ufixed; r : REAL) return STD_ULOGIC; function \?>=\ (l : UNRESOLVED_ufixed; r : REAL) return STD_ULOGIC; function \?<=\ (l : UNRESOLVED_ufixed; r : REAL) return STD_ULOGIC; function \?>\ (l : UNRESOLVED_ufixed; r : REAL) return STD_ULOGIC; function \?<\ (l : UNRESOLVED_ufixed; r : REAL) return STD_ULOGIC; function \?=\ (l : REAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?/=\ (l : REAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?>=\ (l : REAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?<=\ (l : REAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?>\ (l : REAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function \?<\ (l : REAL; r : UNRESOLVED_ufixed) return STD_ULOGIC; function maximum (l : UNRESOLVED_ufixed; r : REAL) return UNRESOLVED_ufixed; function maximum (l : REAL; r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed; function minimum (l : UNRESOLVED_ufixed; r : REAL) return UNRESOLVED_ufixed; function minimum (l : REAL; r : UNRESOLVED_ufixed) return UNRESOLVED_ufixed; ---------------------------------------------------------------------------- -- In these compare functions an integer is converted into a -- fixed point number of the bounds "maximum(l'high,1) downto 0" ---------------------------------------------------------------------------- function "=" (l : UNRESOLVED_sfixed; r : INTEGER) return BOOLEAN; function "/=" (l : UNRESOLVED_sfixed; r : INTEGER) return BOOLEAN; function ">=" (l : UNRESOLVED_sfixed; r : INTEGER) return BOOLEAN; function "<=" (l : UNRESOLVED_sfixed; r : INTEGER) return BOOLEAN; function ">" (l : UNRESOLVED_sfixed; r : INTEGER) return BOOLEAN; function "<" (l : UNRESOLVED_sfixed; r : INTEGER) return BOOLEAN; function "=" (l : INTEGER; r : UNRESOLVED_sfixed) return BOOLEAN; function "/=" (l : INTEGER; r : UNRESOLVED_sfixed) return BOOLEAN; function ">=" (l : INTEGER; r : UNRESOLVED_sfixed) return BOOLEAN; function "<=" (l : INTEGER; r : UNRESOLVED_sfixed) return BOOLEAN; function ">" (l : INTEGER; r : UNRESOLVED_sfixed) return BOOLEAN; function "<" (l : INTEGER; r : UNRESOLVED_sfixed) return BOOLEAN; function \?=\ (l : UNRESOLVED_sfixed; r : INTEGER) return STD_ULOGIC; function \?/=\ (l : UNRESOLVED_sfixed; r : INTEGER) return STD_ULOGIC; function \?>=\ (l : UNRESOLVED_sfixed; r : INTEGER) return STD_ULOGIC; function \?<=\ (l : UNRESOLVED_sfixed; r : INTEGER) return STD_ULOGIC; function \?>\ (l : UNRESOLVED_sfixed; r : INTEGER) return STD_ULOGIC; function \?<\ (l : UNRESOLVED_sfixed; r : INTEGER) return STD_ULOGIC; function \?=\ (l : INTEGER; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?/=\ (l : INTEGER; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?>=\ (l : INTEGER; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?<=\ (l : INTEGER; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?>\ (l : INTEGER; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?<\ (l : INTEGER; r : UNRESOLVED_sfixed) return STD_ULOGIC; function maximum (l : UNRESOLVED_sfixed; r : INTEGER) return UNRESOLVED_sfixed; function maximum (l : INTEGER; r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed; function minimum (l : UNRESOLVED_sfixed; r : INTEGER) return UNRESOLVED_sfixed; function minimum (l : INTEGER; r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed; ---------------------------------------------------------------------------- -- In these compare functions a real is converted into a -- fixed point number of the bounds "l'high+1 downto l'low" ---------------------------------------------------------------------------- function "=" (l : UNRESOLVED_sfixed; r : REAL) return BOOLEAN; function "/=" (l : UNRESOLVED_sfixed; r : REAL) return BOOLEAN; function ">=" (l : UNRESOLVED_sfixed; r : REAL) return BOOLEAN; function "<=" (l : UNRESOLVED_sfixed; r : REAL) return BOOLEAN; function ">" (l : UNRESOLVED_sfixed; r : REAL) return BOOLEAN; function "<" (l : UNRESOLVED_sfixed; r : REAL) return BOOLEAN; function "=" (l : REAL; r : UNRESOLVED_sfixed) return BOOLEAN; function "/=" (l : REAL; r : UNRESOLVED_sfixed) return BOOLEAN; function ">=" (l : REAL; r : UNRESOLVED_sfixed) return BOOLEAN; function "<=" (l : REAL; r : UNRESOLVED_sfixed) return BOOLEAN; function ">" (l : REAL; r : UNRESOLVED_sfixed) return BOOLEAN; function "<" (l : REAL; r : UNRESOLVED_sfixed) return BOOLEAN; function \?=\ (l : UNRESOLVED_sfixed; r : REAL) return STD_ULOGIC; function \?/=\ (l : UNRESOLVED_sfixed; r : REAL) return STD_ULOGIC; function \?>=\ (l : UNRESOLVED_sfixed; r : REAL) return STD_ULOGIC; function \?<=\ (l : UNRESOLVED_sfixed; r : REAL) return STD_ULOGIC; function \?>\ (l : UNRESOLVED_sfixed; r : REAL) return STD_ULOGIC; function \?<\ (l : UNRESOLVED_sfixed; r : REAL) return STD_ULOGIC; function \?=\ (l : REAL; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?/=\ (l : REAL; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?>=\ (l : REAL; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?<=\ (l : REAL; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?>\ (l : REAL; r : UNRESOLVED_sfixed) return STD_ULOGIC; function \?<\ (l : REAL; r : UNRESOLVED_sfixed) return STD_ULOGIC; function maximum (l : UNRESOLVED_sfixed; r : REAL) return UNRESOLVED_sfixed; function maximum (l : REAL; r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed; function minimum (l : UNRESOLVED_sfixed; r : REAL) return UNRESOLVED_sfixed; function minimum (l : REAL; r : UNRESOLVED_sfixed) return UNRESOLVED_sfixed; --=========================================================================== -- Shift and Rotate Functions. -- Note that sra and sla are not the same as the BIT_VECTOR version --=========================================================================== function "sll" (ARG : UNRESOLVED_ufixed; COUNT : INTEGER) return UNRESOLVED_ufixed; function "srl" (ARG : UNRESOLVED_ufixed; COUNT : INTEGER) return UNRESOLVED_ufixed; function "rol" (ARG : UNRESOLVED_ufixed; COUNT : INTEGER) return UNRESOLVED_ufixed; function "ror" (ARG : UNRESOLVED_ufixed; COUNT : INTEGER)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -