diff --git a/lib/filter/src/delay_line.vhd b/lib/filter/src/delay_line.vhd index c33ad60..5c6bff6 100644 --- a/lib/filter/src/delay_line.vhd +++ b/lib/filter/src/delay_line.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_iterative.vhd b/lib/filter/src/fir_iterative.vhd index 0a9829b..3803133 100644 --- a/lib/filter/src/fir_iterative.vhd +++ b/lib/filter/src/fir_iterative.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_iterative_pkg.vhd b/lib/filter/src/fir_iterative_pkg.vhd index af8bb68..bb9b452 100644 --- a/lib/filter/src/fir_iterative_pkg.vhd +++ b/lib/filter/src/fir_iterative_pkg.vhd @@ -5,7 +5,7 @@ use IEEE.MATH_REAL.ALL; use ieee.numeric_std.all; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_parallel.vhd b/lib/filter/src/fir_parallel.vhd index 75fd554..c17bac6 100644 --- a/lib/filter/src/fir_parallel.vhd +++ b/lib/filter/src/fir_parallel.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_parallel_pkg.vhd b/lib/filter/src/fir_parallel_pkg.vhd index 9243d8c..7d55f7b 100644 --- a/lib/filter/src/fir_parallel_pkg.vhd +++ b/lib/filter/src/fir_parallel_pkg.vhd @@ -4,7 +4,7 @@ use IEEE.STD_LOGIC_1164.ALL; use ieee.numeric_std.all; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_pkg.vhd b/lib/filter/src/fir_pkg.vhd index 9e904b5..48ffac0 100644 --- a/lib/filter/src/fir_pkg.vhd +++ b/lib/filter/src/fir_pkg.vhd @@ -5,7 +5,7 @@ use IEEE.MATH_REAL.ALL; use ieee.numeric_std.all; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_semi_parallel.vhd b/lib/filter/src/fir_semi_parallel.vhd index f2e5dce..2db3f73 100644 --- a/lib/filter/src/fir_semi_parallel.vhd +++ b/lib/filter/src/fir_semi_parallel.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_stage.vhd b/lib/filter/src/fir_stage.vhd index a519cf4..7d8b7a3 100644 --- a/lib/filter/src/fir_stage.vhd +++ b/lib/filter/src/fir_stage.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/fir_stage_pkg.vhd b/lib/filter/src/fir_stage_pkg.vhd index c6408b8..f64881f 100644 --- a/lib/filter/src/fir_stage_pkg.vhd +++ b/lib/filter/src/fir_stage_pkg.vhd @@ -4,7 +4,7 @@ use IEEE.STD_LOGIC_1164.ALL; use ieee.numeric_std.all; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; package fir_stage_pkg is diff --git a/lib/filter/src/fir_stage_sys.vhd b/lib/filter/src/fir_stage_sys.vhd index 5b450ef..5702a57 100644 --- a/lib/filter/src/fir_stage_sys.vhd +++ b/lib/filter/src/fir_stage_sys.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/tb_fir_iterative.vhd b/lib/filter/src/tb_fir_iterative.vhd index 535c88c..909d360 100644 --- a/lib/filter/src/tb_fir_iterative.vhd +++ b/lib/filter/src/tb_fir_iterative.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/tb_fir_parallel.vhd b/lib/filter/src/tb_fir_parallel.vhd index 975b01d..f50f411 100644 --- a/lib/filter/src/tb_fir_parallel.vhd +++ b/lib/filter/src/tb_fir_parallel.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/tb_fir_semi_parallel.vhd b/lib/filter/src/tb_fir_semi_parallel.vhd index e319e0c..d4cd472 100644 --- a/lib/filter/src/tb_fir_semi_parallel.vhd +++ b/lib/filter/src/tb_fir_semi_parallel.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/tb_fir_stage.vhd b/lib/filter/src/tb_fir_stage.vhd index 04bb03f..b8787ec 100644 --- a/lib/filter/src/tb_fir_stage.vhd +++ b/lib/filter/src/tb_fir_stage.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/filter/src/tb_fir_stage_sys.vhd b/lib/filter/src/tb_fir_stage_sys.vhd index ef7d37e..9369e71 100644 --- a/lib/filter/src/tb_fir_stage_sys.vhd +++ b/lib/filter/src/tb_fir_stage_sys.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/fixed/fixed_util_pkg.vhd b/lib/fixed/fixed_util_pkg.vhd index 783410a..251fcb8 100644 --- a/lib/fixed/fixed_util_pkg.vhd +++ b/lib/fixed/fixed_util_pkg.vhd @@ -5,7 +5,7 @@ use IEEE.NUMERIC_STD.ALL; use IEEE.MATH_REAL.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; package fixed_util_pkg is diff --git a/lib/radio/cordic/src/cordic_pipe_post.vhd b/lib/radio/cordic/src/cordic_pipe_post.vhd index 54428a3..fac75ae 100644 --- a/lib/radio/cordic/src/cordic_pipe_post.vhd +++ b/lib/radio/cordic/src/cordic_pipe_post.vhd @@ -22,7 +22,7 @@ use IEEE.STD_LOGIC_1164.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -88,9 +88,9 @@ cordic_proc_pre_stage: vld_out <= '1'; - xi := resize(xin, xi); - yi := resize(yin, yi); - zi := resize(zin, zi); + xi := resize(xin, xi, fixed_wrap, fixed_truncate); + yi := resize(yin, yi, fixed_wrap, fixed_truncate); + zi := resize(zin, zi, fixed_wrap, fixed_truncate); xo := resize(xi * gain_x, xo, cordic_saturate_mode, cordic_round_mode); yo := resize(yi * gain_y, yo, cordic_saturate_mode, cordic_round_mode); diff --git a/lib/radio/cordic/src/cordic_pipe_pre.vhd b/lib/radio/cordic/src/cordic_pipe_pre.vhd index 2069b21..f722b78 100644 --- a/lib/radio/cordic/src/cordic_pipe_pre.vhd +++ b/lib/radio/cordic/src/cordic_pipe_pre.vhd @@ -22,7 +22,7 @@ use IEEE.STD_LOGIC_1164.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -63,8 +63,8 @@ end cordic_pipe_pre; architecture Behavioral of cordic_pipe_pre is -constant pi_sfix : sfixed := to_sfixed(z_range, sproto(nbits_z, nbits_z_frac), fixed_wrap, fixed_round); -constant pi2_sfix : sfixed := to_sfixed(z_range/2.0, sproto(nbits_z, nbits_z_frac), fixed_wrap, fixed_round); +constant pi_sfix : sfixed(shi(nbits_z, nbits_z_frac) downto slo(nbits_z, nbits_z_frac)) := to_sfixed(z_range, sproto(nbits_z, nbits_z_frac), fixed_wrap, fixed_truncate); +constant pi2_sfix : sfixed(shi(nbits_z, nbits_z_frac) downto slo(nbits_z, nbits_z_frac)) := to_sfixed(z_range/2.0, sproto(nbits_z, nbits_z_frac), fixed_wrap, fixed_truncate); ------------------------------------------------------------ begin @@ -97,13 +97,13 @@ cordic_proc_pre_stage: zo := zi; if (zi < -pi2_sfix) then - xo := resize(-xi, xo); - yo := resize(-yi, yo); - zo := resize(zi + pi_sfix, zo); + xo := resize(-xi, xo, fixed_wrap, fixed_truncate); + yo := resize(-yi, yo, fixed_wrap, fixed_truncate); + zo := resize(zi + pi_sfix, zo, fixed_wrap, fixed_truncate); elsif (zi > pi2_sfix) then - xo := resize(-xi, xo); - yo := resize(-yi, yo); - zo := resize(zi - pi_sfix, zo); + xo := resize(-xi, xo, fixed_wrap, fixed_truncate); + yo := resize(-yi, yo, fixed_wrap, fixed_truncate); + zo := resize(zi - pi_sfix, zo, fixed_wrap, fixed_truncate); end if; xout <= xo after tpd; diff --git a/lib/radio/cordic/src/cordic_pipe_stage.vhd b/lib/radio/cordic/src/cordic_pipe_stage.vhd index 231f3d8..0ae6894 100644 --- a/lib/radio/cordic/src/cordic_pipe_stage.vhd +++ b/lib/radio/cordic/src/cordic_pipe_stage.vhd @@ -22,7 +22,7 @@ use IEEE.STD_LOGIC_1164.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -95,13 +95,13 @@ cordic_proc_stage: yt := yi sra stage_num; if zi(zi'high) = '1' then - xo := resize(xi + yt, xo); - yo := resize(yi - xt, yo); - zo := resize(zi + coeff, zo); + xo := resize(xi + yt, xo, fixed_wrap, fixed_truncate); + yo := resize(yi - xt, yo, fixed_wrap, fixed_truncate); + zo := resize(zi + coeff, zo, fixed_wrap, fixed_truncate); else - xo := resize(xi - yt, xo); - yo := resize(yi + xt, yo); - zo := resize(zi - coeff, zo); + xo := resize(xi - yt, xo, fixed_wrap, fixed_truncate); + yo := resize(yi + xt, yo, fixed_wrap, fixed_truncate); + zo := resize(zi - coeff, zo, fixed_wrap, fixed_truncate); end if; xout <= xo after tpd; diff --git a/lib/radio/cordic/src/cordic_pipe_top.vhd b/lib/radio/cordic/src/cordic_pipe_top.vhd index d6b2f90..1e76a32 100644 --- a/lib/radio/cordic/src/cordic_pipe_top.vhd +++ b/lib/radio/cordic/src/cordic_pipe_top.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -194,13 +194,13 @@ signal post_vld : std_logic; begin - pre_xin <= resize(xin, pre_xin); - pre_yin <= resize(yin, pre_yin); - pre_zin <= resize(zin, pre_zin); + pre_xin <= resize(xin, pre_xin, fixed_wrap, fixed_truncate); + pre_yin <= resize(yin, pre_yin, fixed_wrap, fixed_truncate); + pre_zin <= resize(zin, pre_zin, fixed_wrap, fixed_truncate); - stage_x(0) <= resize(pre_xout, stage_x(0)); - stage_y(0) <= resize(pre_yout, stage_y(0)); - stage_z(0) <= resize(pre_zout, stage_z(0)); + stage_x(0) <= resize(pre_xout, stage_x(0), fixed_wrap, fixed_truncate); + stage_y(0) <= resize(pre_yout, stage_y(0), fixed_wrap, fixed_truncate); + stage_z(0) <= resize(pre_zout, stage_z(0), fixed_wrap, fixed_truncate); post_xin <= resize(stage_x(nstages), post_xin, cordic_saturate_mode, cordic_round_mode); post_yin <= resize(stage_y(nstages), post_yin, cordic_saturate_mode, cordic_round_mode); diff --git a/lib/radio/cordic/src/cordic_pkg.vhd b/lib/radio/cordic/src/cordic_pkg.vhd index 4abd29a..1dcdace 100644 --- a/lib/radio/cordic/src/cordic_pkg.vhd +++ b/lib/radio/cordic/src/cordic_pkg.vhd @@ -4,7 +4,7 @@ use IEEE.STD_LOGIC_1164.ALL; use ieee.numeric_std.all; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/cordic/src/cordic_rom.vhd b/lib/radio/cordic/src/cordic_rom.vhd index 0da8d35..df86861 100644 --- a/lib/radio/cordic/src/cordic_rom.vhd +++ b/lib/radio/cordic/src/cordic_rom.vhd @@ -22,7 +22,7 @@ USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/cordic/src/cordic_stage.vhd b/lib/radio/cordic/src/cordic_stage.vhd index 3512f8a..c41f516 100644 --- a/lib/radio/cordic/src/cordic_stage.vhd +++ b/lib/radio/cordic/src/cordic_stage.vhd @@ -22,7 +22,7 @@ use IEEE.STD_LOGIC_1164.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -100,9 +100,9 @@ gen_direct: if reg_mode = none generate else ready_r <= '1'; valid_r <= ce; - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end process; @@ -140,9 +140,9 @@ gen_reg_in: if (reg_mode = reg_mode_in) generate ready_r <= '1'; valid_r <= ce; if (ce = '1') then - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end if; end process; @@ -180,9 +180,9 @@ gen_reg_out: if (reg_mode = reg_mode_out) generate else ready_r <= '1'; valid_r <= ce; - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end process; @@ -222,9 +222,9 @@ gen_reg_inout: if (reg_mode = reg_mode_inout) generate ready_r <= '1'; valid_r <= ce; if (ce = '1') then - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end if; end process; @@ -276,13 +276,13 @@ begin y2 := xyz_in.y sra stage_count_r; if (dir_cw_r = '1') then - xyz_out.x <= resize(xyz_in.x + y2, xyz_out.x'left, xyz_out.x'right) after tpd; - xyz_out.y <= resize(xyz_in.y - x2, xyz_out.y'left, xyz_out.y'right) after tpd; - xyz_out.z <= resize(xyz_in.z + coeff, xyz_out.z'left, xyz_out.z'right) after tpd; + xyz_out.x <= resize(xyz_in.x + y2, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate) after tpd; + xyz_out.y <= resize(xyz_in.y - x2, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate) after tpd; + xyz_out.z <= resize(xyz_in.z + coeff, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate) after tpd; else - xyz_out.x <= resize(xyz_in.x - y2, xyz_out.x'left, xyz_out.x'right) after tpd; - xyz_out.y <= resize(xyz_in.y + x2, xyz_out.y'left, xyz_out.y'right) after tpd; - xyz_out.z <= resize(xyz_in.z - coeff, xyz_out.z'left, xyz_out.z'right) after tpd; + xyz_out.x <= resize(xyz_in.x - y2, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate) after tpd; + xyz_out.y <= resize(xyz_in.y + x2, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate) after tpd; + xyz_out.z <= resize(xyz_in.z - coeff, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate) after tpd; end if; end if; end process; diff --git a/lib/radio/cordic/src/cordic_stage_post.vhd b/lib/radio/cordic/src/cordic_stage_post.vhd index f7d19f9..ad7a743 100644 --- a/lib/radio/cordic/src/cordic_stage_post.vhd +++ b/lib/radio/cordic/src/cordic_stage_post.vhd @@ -22,7 +22,7 @@ use IEEE.STD_LOGIC_1164.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -98,9 +98,9 @@ gen_direct: if reg_mode = none generate else ready_r <= '1'; valid_r <= ce; - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end process; @@ -138,9 +138,9 @@ gen_reg_in: if (reg_mode = reg_mode_in) generate ready_r <= '1'; valid_r <= ce; if (ce = '1') then - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end if; end process; @@ -178,9 +178,9 @@ gen_reg_out: if (reg_mode = reg_mode_out) generate else ready_r <= '1'; valid_r <= ce; - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end process; @@ -220,9 +220,9 @@ gen_reg_inout: if (reg_mode = reg_mode_inout) generate ready_r <= '1'; valid_r <= ce; if (ce = '1') then - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end if; end process; @@ -252,9 +252,9 @@ gen_reg_inout: if (reg_mode = reg_mode_inout) generate cordic_post_stage: process(xyz_in, cordic_mode) begin - xyz_out.x <= resize(xyz_in.x, xyz_out.x'left, xyz_out.x'right); - xyz_out.y <= resize(xyz_in.y, xyz_out.y'left, xyz_out.y'right); - xyz_out.z <= resize(xyz_in.z, xyz_out.z'left, xyz_out.z'right); + xyz_out.x <= resize(xyz_in.x, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate); + xyz_out.y <= resize(xyz_in.y, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate); + xyz_out.z <= resize(xyz_in.z, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate); case cordic_mode is diff --git a/lib/radio/cordic/src/cordic_stage_pre.vhd b/lib/radio/cordic/src/cordic_stage_pre.vhd index 2ee5717..fdda017 100644 --- a/lib/radio/cordic/src/cordic_stage_pre.vhd +++ b/lib/radio/cordic/src/cordic_stage_pre.vhd @@ -22,7 +22,7 @@ use IEEE.STD_LOGIC_1164.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -101,9 +101,9 @@ gen_direct: if reg_mode = none generate else ready_r <= '1'; valid_r <= ce; - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end process; @@ -141,9 +141,9 @@ gen_reg_in: if (reg_mode = reg_mode_in) generate ready_r <= '1'; valid_r <= ce; if (ce = '1') then - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end if; end process; @@ -181,9 +181,9 @@ gen_reg_out: if (reg_mode = reg_mode_out) generate else ready_r <= '1'; valid_r <= ce; - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end process; @@ -223,9 +223,9 @@ gen_reg_inout: if (reg_mode = reg_mode_inout) generate ready_r <= '1'; valid_r <= ce; if (ce = '1') then - xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right); - xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right); - xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right); + xyz_in.x <= resize(xin, xyz_in.x'left, xyz_in.x'right, fixed_wrap, fixed_truncate); + xyz_in.y <= resize(yin, xyz_in.y'left, xyz_in.y'right, fixed_wrap, fixed_truncate); + xyz_in.z <= resize(zin, xyz_in.z'left, xyz_in.z'right, fixed_wrap, fixed_truncate); end if; end if; end process; @@ -255,40 +255,40 @@ gen_reg_inout: if (reg_mode = reg_mode_inout) generate cordic_proc_pre_stage: process(xyz_in, cordic_mode) begin - xyz_out.x <= resize(xyz_in.x, xyz_out.x'left, xyz_out.x'right); - xyz_out.y <= resize(xyz_in.y, xyz_out.y'left, xyz_out.y'right); - xyz_out.z <= resize(xyz_in.z, xyz_out.z'left, xyz_out.z'right); + xyz_out.x <= resize(xyz_in.x, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate); + xyz_out.y <= resize(xyz_in.y, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate); + xyz_out.z <= resize(xyz_in.z, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate); case cordic_mode is when cordic_mode_rotate => if (xyz_in.z < -pi2_in_sfix) then - xyz_out.x <= resize(-xyz_in.x, xyz_out.x'left, xyz_out.x'right); - xyz_out.y <= resize(-xyz_in.y, xyz_out.y'left, xyz_out.y'right); - xyz_out.z <= resize(xyz_in.z + pi_out_sfix, xyz_out.z'left, xyz_out.z'right); + xyz_out.x <= resize(-xyz_in.x, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate); + xyz_out.y <= resize(-xyz_in.y, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate); + xyz_out.z <= resize(xyz_in.z + pi_out_sfix, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate); elsif (xyz_in.z > pi2_in_sfix) then - xyz_out.x <= resize(-xyz_in.x, xyz_out.x'left, xyz_out.x'right); - xyz_out.y <= resize(-xyz_in.y, xyz_out.y'left, xyz_out.y'right); - xyz_out.z <= resize(xyz_in.z - pi_out_sfix, xyz_out.z'left, xyz_out.z'right); + xyz_out.x <= resize(-xyz_in.x, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate); + xyz_out.y <= resize(-xyz_in.y, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate); + xyz_out.z <= resize(xyz_in.z - pi_out_sfix, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate); end if; when cordic_mode_vector => -- if (xyz_in.x < zero_in_sfix) then --- xyz_out.x <= resize(-xyz_in.x, xyz_out.x'left, xyz_out.x'right); --- xyz_out.y <= resize(-xyz_in.y, xyz_out.y'left, xyz_out.y'right); --- xyz_out.z <= resize(xyz_in.z - pi_out_sfix, xyz_out.z'left, xyz_out.z'right); +-- xyz_out.x <= resize(-xyz_in.x, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate); +-- xyz_out.y <= resize(-xyz_in.y, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate); +-- xyz_out.z <= resize(xyz_in.z - pi_out_sfix, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate); -- end if; if (xyz_in.y < zero_in_sfix) then - xyz_out.x <= resize(-xyz_in.y, xyz_out.x'left, xyz_out.x'right); - xyz_out.y <= resize(xyz_in.x, xyz_out.y'left, xyz_out.y'right); - xyz_out.z <= resize(xyz_in.z + pi2_out_sfix, xyz_out.z'left, xyz_out.z'right); + xyz_out.x <= resize(-xyz_in.y, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate); + xyz_out.y <= resize(xyz_in.x, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate); + xyz_out.z <= resize(xyz_in.z + pi2_out_sfix, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate); else - xyz_out.x <= resize(xyz_in.y, xyz_out.x'left, xyz_out.x'right); - xyz_out.y <= resize(-xyz_in.x, xyz_out.y'left, xyz_out.y'right); - xyz_out.z <= resize(xyz_in.z - pi2_out_sfix, xyz_out.z'left, xyz_out.z'right); + xyz_out.x <= resize(xyz_in.y, xyz_out.x'left, xyz_out.x'right, fixed_wrap, fixed_truncate); + xyz_out.y <= resize(-xyz_in.x, xyz_out.y'left, xyz_out.y'right, fixed_wrap, fixed_truncate); + xyz_out.z <= resize(xyz_in.z - pi2_out_sfix, xyz_out.z'left, xyz_out.z'right, fixed_wrap, fixed_truncate); end if; when others => null; diff --git a/lib/radio/cordic/src/cordic_top.vhd b/lib/radio/cordic/src/cordic_top.vhd index 782b9af..ca9773a 100644 --- a/lib/radio/cordic/src/cordic_top.vhd +++ b/lib/radio/cordic/src/cordic_top.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/cordic/src/tb_cordic_pipe_top.vhd b/lib/radio/cordic/src/tb_cordic_pipe_top.vhd index 4ef7917..491f605 100644 --- a/lib/radio/cordic/src/tb_cordic_pipe_top.vhd +++ b/lib/radio/cordic/src/tb_cordic_pipe_top.vhd @@ -149,7 +149,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/cordic/src/tb_cordic_top.vhd b/lib/radio/cordic/src/tb_cordic_top.vhd index b127d74..cf8cb17 100644 --- a/lib/radio/cordic/src/tb_cordic_top.vhd +++ b/lib/radio/cordic/src/tb_cordic_top.vhd @@ -149,7 +149,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/ddc/src/ddc.vhd b/lib/radio/ddc/src/ddc.vhd index a70b50b..40e29b5 100644 --- a/lib/radio/ddc/src/ddc.vhd +++ b/lib/radio/ddc/src/ddc.vhd @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/ddc/src/ddc.vhd.bak b/lib/radio/ddc/src/ddc.vhd.bak index 959f213..629a3ac 100644 --- a/lib/radio/ddc/src/ddc.vhd.bak +++ b/lib/radio/ddc/src/ddc.vhd.bak @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/ddc/src/ddc_var.vhd b/lib/radio/ddc/src/ddc_var.vhd index 0140c01..ee5c813 100644 --- a/lib/radio/ddc/src/ddc_var.vhd +++ b/lib/radio/ddc/src/ddc_var.vhd @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/ddc/src/syn_ddc.vhd b/lib/radio/ddc/src/syn_ddc.vhd index 414dea3..92bab7e 100644 --- a/lib/radio/ddc/src/syn_ddc.vhd +++ b/lib/radio/ddc/src/syn_ddc.vhd @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; --library altera; diff --git a/lib/radio/ddc/src/syn_ddc.vhd.bak b/lib/radio/ddc/src/syn_ddc.vhd.bak index 4bcec0c..c35e4f6 100644 --- a/lib/radio/ddc/src/syn_ddc.vhd.bak +++ b/lib/radio/ddc/src/syn_ddc.vhd.bak @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library altera; diff --git a/lib/radio/ddc/src/syn_ddc_var.vhd b/lib/radio/ddc/src/syn_ddc_var.vhd index ab8d0e9..4ee37d4 100644 --- a/lib/radio/ddc/src/syn_ddc_var.vhd +++ b/lib/radio/ddc/src/syn_ddc_var.vhd @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/ddc/src/tb_ddc.vhd b/lib/radio/ddc/src/tb_ddc.vhd index fa3a61e..e482e23 100644 --- a/lib/radio/ddc/src/tb_ddc.vhd +++ b/lib/radio/ddc/src/tb_ddc.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/ddc/src/tb_ddc_var.vhd b/lib/radio/ddc/src/tb_ddc_var.vhd index ddd695b..2eae980 100644 --- a/lib/radio/ddc/src/tb_ddc_var.vhd +++ b/lib/radio/ddc/src/tb_ddc_var.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/ddc/src/tb_syn_ddc.vhd b/lib/radio/ddc/src/tb_syn_ddc.vhd index a2a8ae3..0737089 100644 --- a/lib/radio/ddc/src/tb_syn_ddc.vhd +++ b/lib/radio/ddc/src/tb_syn_ddc.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/decimator/CIC/src/cic_c_pipe.vhd b/lib/radio/decimator/CIC/src/cic_c_pipe.vhd index 49a610e..c209cc9 100644 --- a/lib/radio/decimator/CIC/src/cic_c_pipe.vhd +++ b/lib/radio/decimator/CIC/src/cic_c_pipe.vhd @@ -22,7 +22,7 @@ USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -72,7 +72,7 @@ delay_pipe_proc: -- word_pipe(i) <= (shi(max_width, max_width_frac) downto slo(max_width, max_width_frac) => '0'); -- end loop; elsif vld_in = '1' then - word_pipe(1) <= resize(din, word_pipe(1)); + word_pipe(1) <= resize(din, word_pipe(1), fixed_wrap, fixed_truncate); for i in 2 to max_diff_delay loop word_pipe(i) <= word_pipe(i-1); end loop; @@ -88,13 +88,13 @@ comb_proc: begin if rising_edge(clk) then vld_out <= '0'; - x0 := resize(din, x0); + x0 := resize(din, x0, fixed_wrap, fixed_truncate); x1 := word_pipe(diff_delay); if rst = '1' then dout <= (shi(max_width, max_width_frac) downto slo(max_width, max_width_frac) => '0'); elsif vld_in = '1' then vld_out <= '1'; - dout <= resize(x0 - x1, shi(max_width, max_width_frac), slo(max_width, max_width_frac)); + dout <= resize(x0 - x1, shi(max_width, max_width_frac), slo(max_width, max_width_frac), fixed_wrap, fixed_truncate); end if; end if; end process; diff --git a/lib/radio/decimator/CIC/src/cic_decim_pipe.vhd b/lib/radio/decimator/CIC/src/cic_decim_pipe.vhd index 29746b0..3eeb09a 100644 --- a/lib/radio/decimator/CIC/src/cic_decim_pipe.vhd +++ b/lib/radio/decimator/CIC/src/cic_decim_pipe.vhd @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -125,7 +125,7 @@ input_scale: variable xsi : sfixed(shi(integ_nbits, integ_nbits_frac) downto slo(integ_nbits, integ_nbits_frac)); begin if rising_edge(clk) then - x := resize(din, x); + x := resize(din, x, fixed_wrap, fixed_truncate); xs := x sra scale_nbits; word_i_pipe(0) <= xs; vld_i_pipe(0) <= vld_in; @@ -198,6 +198,6 @@ resampler_proc: end if; end process; - dout <= resize(word_c_pipe(nstages), shi(out_width, out_width_frac), slo(out_width, out_width_frac)); + dout <= resize(word_c_pipe(nstages), shi(out_width, out_width_frac), slo(out_width, out_width_frac), fixed_wrap, fixed_truncate); END; diff --git a/lib/radio/decimator/CIC/src/cic_decimvar_pipe.vhd b/lib/radio/decimator/CIC/src/cic_decimvar_pipe.vhd index 3f6e65b..f5b2130 100644 --- a/lib/radio/decimator/CIC/src/cic_decimvar_pipe.vhd +++ b/lib/radio/decimator/CIC/src/cic_decimvar_pipe.vhd @@ -17,7 +17,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -131,7 +131,7 @@ input_scale: variable xsi : sfixed(shi(integ_nbits, integ_nbits_frac) downto slo(integ_nbits, integ_nbits_frac)); begin if rising_edge(clk) then - x := resize(din, x); + x := resize(din, x, fixed_wrap, fixed_truncate); xs := x sra min_gain_bits; -- xsi := xs sra shift_in; word_i_pipe(0) <= xs; @@ -159,7 +159,7 @@ input_scale: ); end generate; - word_c_pipe(0) <= resize(word_i_pipe(nstages), word_c_pipe(0)); + word_c_pipe(0) <= resize(word_i_pipe(nstages), word_c_pipe(0), fixed_wrap, fixed_truncate); vld_c_pipe(0) <= resample_vld; vld_c <= vld_c_pipe(nstages); @@ -205,6 +205,6 @@ resampler_proc: end if; end process; - dout <= resize(word_c_pipe(nstages), shi(out_width, out_width_frac), slo(out_width, out_width_frac)); + dout <= resize(word_c_pipe(nstages), shi(out_width, out_width_frac), slo(out_width, out_width_frac), fixed_wrap, fixed_truncate); END; diff --git a/lib/radio/decimator/CIC/src/cic_i_pipe.vhd b/lib/radio/decimator/CIC/src/cic_i_pipe.vhd index a9cfef9..113ba67 100644 --- a/lib/radio/decimator/CIC/src/cic_i_pipe.vhd +++ b/lib/radio/decimator/CIC/src/cic_i_pipe.vhd @@ -22,7 +22,7 @@ USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; @@ -57,7 +57,7 @@ signal accu : sfixed(shi(max_width, max_width_frac) downto slo(max_width, max_ ------------------------------------------------------------ begin - dout <= resize(accu, shi(max_width, max_width_frac), slo(max_width, max_width_frac)); + dout <= resize(accu, shi(max_width, max_width_frac), slo(max_width, max_width_frac), fixed_wrap, fixed_truncate); ------------------------------------------------------------ integ_proc: @@ -70,8 +70,8 @@ integ_proc: accu <= (shi(max_width, max_width_frac) downto slo(max_width, max_width_frac) => '0'); elsif vld_in = '1' then vld_out <= '1'; - x := resize(din, x); - accu <= resize(x + accu, accu); + x := resize(din, x, fixed_wrap, fixed_truncate); + accu <= resize(x + accu, accu, fixed_wrap, fixed_truncate); end if; end if; end process; diff --git a/lib/radio/decimator/CIC/src/syn_cic_c_pipe.vhd b/lib/radio/decimator/CIC/src/syn_cic_c_pipe.vhd index 23c690d..8618c06 100644 --- a/lib/radio/decimator/CIC/src/syn_cic_c_pipe.vhd +++ b/lib/radio/decimator/CIC/src/syn_cic_c_pipe.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/decimator/CIC/src/syn_cic_i_pipe.vhd b/lib/radio/decimator/CIC/src/syn_cic_i_pipe.vhd index 34c4a27..f7e66c1 100644 --- a/lib/radio/decimator/CIC/src/syn_cic_i_pipe.vhd +++ b/lib/radio/decimator/CIC/src/syn_cic_i_pipe.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/decimator/CIC/src/tb_cic_c_pipe.vhd b/lib/radio/decimator/CIC/src/tb_cic_c_pipe.vhd index bce50b5..2f2eca6 100644 --- a/lib/radio/decimator/CIC/src/tb_cic_c_pipe.vhd +++ b/lib/radio/decimator/CIC/src/tb_cic_c_pipe.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/decimator/CIC/src/tb_cic_decim_pipe.vhd b/lib/radio/decimator/CIC/src/tb_cic_decim_pipe.vhd index a1350f4..63f9309 100644 --- a/lib/radio/decimator/CIC/src/tb_cic_decim_pipe.vhd +++ b/lib/radio/decimator/CIC/src/tb_cic_decim_pipe.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/decimator/CIC/src/tb_cic_decimvar_pipe.vhd b/lib/radio/decimator/CIC/src/tb_cic_decimvar_pipe.vhd index 2cf79a1..f8e806c 100644 --- a/lib/radio/decimator/CIC/src/tb_cic_decimvar_pipe.vhd +++ b/lib/radio/decimator/CIC/src/tb_cic_decimvar_pipe.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/decimator/CIC/src/tb_cic_i_pipe.vhd b/lib/radio/decimator/CIC/src/tb_cic_i_pipe.vhd index bcc8186..1139d5a 100644 --- a/lib/radio/decimator/CIC/src/tb_cic_i_pipe.vhd +++ b/lib/radio/decimator/CIC/src/tb_cic_i_pipe.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/mix/src/mix_cpx.vhd b/lib/radio/mix/src/mix_cpx.vhd index 3df161e..93d009f 100644 --- a/lib/radio/mix/src/mix_cpx.vhd +++ b/lib/radio/mix/src/mix_cpx.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/mix/src/mix_real.vhd b/lib/radio/mix/src/mix_real.vhd index 37e96de..fb3f879 100644 --- a/lib/radio/mix/src/mix_real.vhd +++ b/lib/radio/mix/src/mix_real.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/mix/src/tb_mix_cpx.vhd b/lib/radio/mix/src/tb_mix_cpx.vhd index 5eac130..11b9fef 100644 --- a/lib/radio/mix/src/tb_mix_cpx.vhd +++ b/lib/radio/mix/src/tb_mix_cpx.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/mix/src/tb_mix_real.vhd b/lib/radio/mix/src/tb_mix_real.vhd index 8f0ce40..8babd3e 100644 --- a/lib/radio/mix/src/tb_mix_real.vhd +++ b/lib/radio/mix/src/tb_mix_real.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/mix/src/tb_undc_real.vhd b/lib/radio/mix/src/tb_undc_real.vhd index 3fc872b..1debd59 100644 --- a/lib/radio/mix/src/tb_undc_real.vhd +++ b/lib/radio/mix/src/tb_undc_real.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/mix/src/undc_real.vhd b/lib/radio/mix/src/undc_real.vhd index e4a3bba..9a24d60 100644 --- a/lib/radio/mix/src/undc_real.vhd +++ b/lib/radio/mix/src/undc_real.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; use work.fixed_util_pkg.all; diff --git a/lib/radio/nco/src/mix_cordic.vhd b/lib/radio/nco/src/mix_cordic.vhd index ad002a0..8d789ae 100644 --- a/lib/radio/nco/src/mix_cordic.vhd +++ b/lib/radio/nco/src/mix_cordic.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/nco_lut.vhd b/lib/radio/nco/src/nco_lut.vhd index 09e1e87..ddc09f4 100644 --- a/lib/radio/nco/src/nco_lut.vhd +++ b/lib/radio/nco/src/nco_lut.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/nco_lut_dbg.vhd b/lib/radio/nco/src/nco_lut_dbg.vhd index a766e7d..278041d 100644 --- a/lib/radio/nco/src/nco_lut_dbg.vhd +++ b/lib/radio/nco/src/nco_lut_dbg.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/nco_pkg.vhd b/lib/radio/nco/src/nco_pkg.vhd index c11ae7c..009c743 100644 --- a/lib/radio/nco/src/nco_pkg.vhd +++ b/lib/radio/nco/src/nco_pkg.vhd @@ -5,7 +5,7 @@ use ieee.numeric_std.all; use IEEE.MATH_REAL.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/tb_mix_cordic.vhd b/lib/radio/nco/src/tb_mix_cordic.vhd index 335c619..8d9ac70 100644 --- a/lib/radio/nco/src/tb_mix_cordic.vhd +++ b/lib/radio/nco/src/tb_mix_cordic.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/tb_nco_cordic.vhd b/lib/radio/nco/src/tb_nco_cordic.vhd index 0bcfd93..2375796 100644 --- a/lib/radio/nco/src/tb_nco_cordic.vhd +++ b/lib/radio/nco/src/tb_nco_cordic.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/tb_nco_lut.vhd b/lib/radio/nco/src/tb_nco_lut.vhd index 53a480d..17885c2 100644 --- a/lib/radio/nco/src/tb_nco_lut.vhd +++ b/lib/radio/nco/src/tb_nco_lut.vhd @@ -18,7 +18,7 @@ USE ieee.numeric_std.ALL; use std.textio.all; -- Imports the standard textio package. library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/wavelut.vhd b/lib/radio/nco/src/wavelut.vhd index 6f8eaed..7e16ccc 100644 --- a/lib/radio/nco/src/wavelut.vhd +++ b/lib/radio/nco/src/wavelut.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work; diff --git a/lib/radio/nco/src/waverom_dual.vhd b/lib/radio/nco/src/waverom_dual.vhd index b39e2a7..b75f06e 100644 --- a/lib/radio/nco/src/waverom_dual.vhd +++ b/lib/radio/nco/src/waverom_dual.vhd @@ -23,7 +23,7 @@ use IEEE.MATH_REAL.ALL; USE ieee.numeric_std.ALL; library ieee_proposed; -use ieee_proposed.math_utility_pkg.all; +use ieee_proposed.fixed_float_types.all; use ieee_proposed.fixed_pkg.all; library work;