Skip to content
Snippets Groups Projects
Commit e9b0e3b4 authored by BRONES Romain's avatar BRONES Romain
Browse files

Change saturation of mult_d to MM size

parent 2735071c
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ architecture rtl of corr_iir is
constant C_DELAY : natural := 6;
constant C_W_MULT : natural := C_W_MM+C_W_COR_COEF;
constant C_W_CORFP : natural := C_W_COR+C_W_FP;
constant C_W_CORFP : natural := C_W_MM;
type arr_slv is array (natural range <>) of std_logic_vector;
signal delay_valid : std_logic_vector(C_DELAY-1 downto 0);
......@@ -96,7 +96,7 @@ begin
signal rndsat_mult_a : signed(C_W_MM-1 downto 0);
signal rndsat_mult_b : signed(C_W_MM-1 downto 0);
signal rndsat_mult_d : signed(C_W_CORFP+C_W_COR_COEF-C_W_COR_COEFFP-1 downto 0);
signal rndsat_mult_d : signed(C_W_MM-1 downto 0);
signal coef_a : signed(C_W_COR_COEF-1 downto 0);
signal coef_b : signed(C_W_COR_COEF-1 downto 0);
......@@ -202,11 +202,11 @@ begin
if mult_d(C_W_COR_COEFFP-1) = '0' then
rndsat_mult_d <= f_resize_sat(
f_resize_lsb(mult_d, mult_d'length-C_W_COR_COEFFP),
rndsat_mult_d'length);
C_W_MM);
else
rndsat_mult_d <= f_resize_sat(
f_sum_sat(f_resize_lsb(mult_d, mult_d'length-C_W_COR_COEFFP), to_signed(1,2)),
rndsat_mult_d'length);
C_W_MM);
end if;
----------------------------------------------------------------------------------------------------------
......@@ -229,7 +229,7 @@ begin
-- mapping
corrout(I) <= rnd_cor;
corrout_fp(I) <= reg_dout2;
corrout_fp(I) <= f_resize_sat(reg_dout2, C_W_COR+C_W_FP);
end generate gen_corr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment