📄 float_pkg_c.vhdl
字号:
-- Need to overload the default versions of these function "=" (l, r : UNRESOLVED_float) return BOOLEAN; function "/=" (l, r : UNRESOLVED_float) return BOOLEAN; function ">=" (l, r : UNRESOLVED_float) return BOOLEAN; function "<=" (l, r : UNRESOLVED_float) return BOOLEAN; function ">" (l, r : UNRESOLVED_float) return BOOLEAN; function "<" (l, r : UNRESOLVED_float) return BOOLEAN; function \?=\ (l, r : UNRESOLVED_float) return STD_ULOGIC; function \?/=\ (l, r : UNRESOLVED_float) return STD_ULOGIC; function \?>\ (l, r : UNRESOLVED_float) return STD_ULOGIC; function \?>=\ (l, r : UNRESOLVED_float) return STD_ULOGIC; function \?<\ (l, r : UNRESOLVED_float) return STD_ULOGIC; function \?<=\ (l, r : UNRESOLVED_float) return STD_ULOGIC; function std_match (l, r : UNRESOLVED_float) return BOOLEAN; function find_rightmost (arg : UNRESOLVED_float; y : STD_ULOGIC) return INTEGER; function find_leftmost (arg : UNRESOLVED_float; y : STD_ULOGIC) return INTEGER; function maximum (l, r : UNRESOLVED_float) return UNRESOLVED_float; function minimum (l, r : UNRESOLVED_float) return UNRESOLVED_float; -- conversion functions -- Converts one floating point number into another. function resize ( arg : UNRESOLVED_float; -- Floating point input constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style; -- rounding option constant check_error : BOOLEAN := float_check_error; constant denormalize_in : BOOLEAN := float_denormalize; -- Use IEEE extended FP constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return UNRESOLVED_float; function resize ( arg : UNRESOLVED_float; -- Floating point input size_res : UNRESOLVED_float; constant round_style : round_type := float_round_style; -- rounding option constant check_error : BOOLEAN := float_check_error; constant denormalize_in : BOOLEAN := float_denormalize; -- Use IEEE extended FP constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return UNRESOLVED_float; function to_float32 ( arg : UNRESOLVED_float; constant round_style : round_type := float_round_style; -- rounding option constant check_error : BOOLEAN := float_check_error; constant denormalize_in : BOOLEAN := float_denormalize; -- Use IEEE extended FP constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return UNRESOLVED_float32; function to_float64 ( arg : UNRESOLVED_float; constant round_style : round_type := float_round_style; -- rounding option constant check_error : BOOLEAN := float_check_error; constant denormalize_in : BOOLEAN := float_denormalize; -- Use IEEE extended FP constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return UNRESOLVED_float64; function to_float128 ( arg : UNRESOLVED_float; constant round_style : round_type := float_round_style; -- rounding option constant check_error : BOOLEAN := float_check_error; constant denormalize_in : BOOLEAN := float_denormalize; -- Use IEEE extended FP constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return UNRESOLVED_float128; -- Converts an fp into an SLV (needed for synthesis) function to_slv (arg : UNRESOLVED_float) return STD_LOGIC_VECTOR;-- alias to_StdLogicVector is to_slv [UNRESOLVED_float return STD_LOGIC_VECTOR];-- alias to_Std_Logic_Vector is to_slv [UNRESOLVED_float return STD_LOGIC_VECTOR]; -- Converts an fp into an SULV function to_suv (arg : UNRESOLVED_float) return STD_ULOGIC_VECTOR;-- alias to_StdULogicVector is to_suv [UNRESOLVED_float return STD_ULOGIC_VECTOR];-- alias to_Std_ULogic_Vector is to_suv [UNRESOLVED_float return STD_ULOGIC_VECTOR]; -- std_ulogic_vector to float function to_float ( arg : STD_ULOGIC_VECTOR; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width) -- length of FP output fraction return UNRESOLVED_float; -- Integer to float function to_float ( arg : INTEGER; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style) -- rounding option return UNRESOLVED_float; -- real to float function to_float ( arg : REAL; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style; -- rounding option constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return UNRESOLVED_float; -- unsigned to float function to_float ( arg : UNSIGNED; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style) -- rounding option return UNRESOLVED_float; -- signed to float function to_float ( arg : SIGNED; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style) -- rounding option return UNRESOLVED_float; -- unsigned fixed point to float function to_float ( arg : UNRESOLVED_ufixed; -- unsigned fixed point input constant exponent_width : NATURAL := float_exponent_width; -- width of exponent constant fraction_width : NATURAL := float_fraction_width; -- width of fraction constant round_style : round_type := float_round_style; -- rounding constant denormalize : BOOLEAN := float_denormalize) -- use ieee extensions return UNRESOLVED_float; -- signed fixed point to float function to_float ( arg : UNRESOLVED_sfixed; constant exponent_width : NATURAL := float_exponent_width; -- length of FP output exponent constant fraction_width : NATURAL := float_fraction_width; -- length of FP output fraction constant round_style : round_type := float_round_style; -- rounding constant denormalize : BOOLEAN := float_denormalize) -- rounding option return UNRESOLVED_float; -- size_res functions -- Integer to float function to_float ( arg : INTEGER; size_res : UNRESOLVED_float; constant round_style : round_type := float_round_style) -- rounding option return UNRESOLVED_float; -- real to float function to_float ( arg : REAL; size_res : UNRESOLVED_float; constant round_style : round_type := float_round_style; -- rounding option constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return UNRESOLVED_float; -- unsigned to float function to_float ( arg : UNSIGNED; size_res : UNRESOLVED_float; constant round_style : round_type := float_round_style) -- rounding option return UNRESOLVED_float; -- signed to float function to_float ( arg : SIGNED; size_res : UNRESOLVED_float; constant round_style : round_type := float_round_style) -- rounding option return UNRESOLVED_float; -- sulv to float function to_float ( arg : STD_ULOGIC_VECTOR; size_res : UNRESOLVED_float) return UNRESOLVED_float; -- unsigned fixed point to float function to_float ( arg : UNRESOLVED_ufixed; -- unsigned fixed point input size_res : UNRESOLVED_float; constant round_style : round_type := float_round_style; -- rounding constant denormalize : BOOLEAN := float_denormalize) -- use ieee extensions return UNRESOLVED_float; -- signed fixed point to float function to_float ( arg : UNRESOLVED_sfixed; size_res : UNRESOLVED_float; constant round_style : round_type := float_round_style; -- rounding constant denormalize : BOOLEAN := float_denormalize) -- rounding option return UNRESOLVED_float; -- float to unsigned function to_unsigned ( arg : UNRESOLVED_float; -- floating point input constant size : NATURAL; -- length of output constant check_error : BOOLEAN := float_check_error; -- check for errors constant round_style : round_type := float_round_style) -- rounding option return UNSIGNED; -- float to signed function to_signed ( arg : UNRESOLVED_float; -- floating point input constant size : NATURAL; -- length of output constant check_error : BOOLEAN := float_check_error; -- check for errors constant round_style : round_type := float_round_style) -- rounding option return SIGNED; -- purpose: Converts a float to unsigned fixed point function to_ufixed ( arg : UNRESOLVED_float; -- fp input constant left_index : INTEGER; -- integer part constant right_index : INTEGER; -- fraction part constant round_style : fixed_round_style_type := fixed_round_style; -- rounding constant overflow_style : fixed_overflow_style_type := fixed_overflow_style; -- saturate constant check_error : BOOLEAN := float_check_error; -- check for errors constant denormalize : BOOLEAN := float_denormalize) return UNRESOLVED_ufixed; -- float to signed fixed point function to_sfixed ( arg : UNRESOLVED_float; -- fp input constant left_index : INTEGER; -- integer part constant right_index : INTEGER; -- fraction part constant round_style : fixed_round_style_type := fixed_round_style; -- rounding constant overflow_style : fixed_overflow_style_type := fixed_overflow_style; -- saturate constant check_error : BOOLEAN := float_check_error; -- check for errors constant denormalize : BOOLEAN := float_denormalize) return UNRESOLVED_sfixed; -- size_res versions -- float to unsigned function to_unsigned ( arg : UNRESOLVED_float; -- floating point input size_res : UNSIGNED; constant check_error : BOOLEAN := float_check_error; -- check for errors constant round_style : round_type := float_round_style) -- rounding option return UNSIGNED; -- float to signed function to_signed ( arg : UNRESOLVED_float; -- floating point input size_res : SIGNED; constant check_error : BOOLEAN := float_check_error; -- check for errors constant round_style : round_type := float_round_style) -- rounding option return SIGNED; -- purpose: Converts a float to unsigned fixed point function to_ufixed ( arg : UNRESOLVED_float; -- fp input size_res : UNRESOLVED_ufixed; constant round_style : fixed_round_style_type := fixed_round_style; -- rounding constant overflow_style : fixed_overflow_style_type := fixed_overflow_style; -- saturate constant check_error : BOOLEAN := float_check_error; -- check for errors constant denormalize : BOOLEAN := float_denormalize) return UNRESOLVED_ufixed; -- float to signed fixed point function to_sfixed ( arg : UNRESOLVED_float; -- fp input size_res : UNRESOLVED_sfixed; constant round_style : fixed_round_style_type := fixed_round_style; -- rounding constant overflow_style : fixed_overflow_style_type := fixed_overflow_style; -- saturate constant check_error : BOOLEAN := float_check_error; -- check for errors constant denormalize : BOOLEAN := float_denormalize) return UNRESOLVED_sfixed; -- float to real function to_real ( arg : UNRESOLVED_float; -- floating point input constant round_style : round_type := float_round_style; -- rounding option constant check_error : BOOLEAN := float_check_error; -- check for errors constant denormalize : BOOLEAN := float_denormalize) -- Use IEEE extended FP return REAL; -- float to integer function to_integer ( arg : UNRESOLVED_float; -- floating point input constant check_error : BOOLEAN := float_check_error; -- check for errors constant round_style : round_type := float_round_style) -- rounding option return INTEGER; -- Maps metalogical values function to_01 (
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -