|
|
@@ -1,73 +0,0 @@ |
|
|
|
LIBRARY ieee;
|
|
|
|
USE ieee.std_logic_1164.ALL;
|
|
|
|
USE work.POLY_FIR_PKG.ALL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ENTITY poly_fir_blk IS
|
|
|
|
|
|
|
|
PORT (
|
|
|
|
i_clk : IN std_logic;
|
|
|
|
i_coeffs : IN vect_polyfir_coeffs_in;
|
|
|
|
i_data : IN vect_adc_data_out;
|
|
|
|
o_data : OUT matrix_fir_data_out);
|
|
|
|
|
|
|
|
END ENTITY poly_fir_blk;
|
|
|
|
|
|
|
|
ARCHITECTURE polyphase OF poly_fir_blk IS
|
|
|
|
|
|
|
|
SIGNAL matrix3D_reg_out_simple_rif_in : matrix3D_reg_data_out := (OTHERS => (OTHERS => (OTHERS => (OTHERS => '0'))));
|
|
|
|
SIGNAL matrix_coeffs : matrix_fir_coeffs_in := (OTHERS => (OTHERS => (OTHERS => '0')));
|
|
|
|
SIGNAL matrix_fir_out : matrix_fir_data_out := (OTHERS => (OTHERS => (OTHERS => '0')));
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN -- ARCHITECTURE polyphase
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--purpose: fill the polyphase coefficients into a 2D matrix from the filter vector (1D)
|
|
|
|
fill_coeff : PROCESS(i_coeffs) -- rearrange coeffs into a matrix
|
|
|
|
VARIABLE coeff_nb : natural;
|
|
|
|
VARIABLE sf_coeff : natural;
|
|
|
|
VARIABLE subfilter_nb : natural;
|
|
|
|
BEGIN
|
|
|
|
coeff_nb := 0;
|
|
|
|
sf_coeff := 0;
|
|
|
|
subfilter_nb := 0;
|
|
|
|
coeff_for_matrix : FOR coeff_nb IN 0 TO cst_nb_coeffs_filter_in-1 LOOP
|
|
|
|
matrix_coeffs(subfilter_nb)(sf_coeff) <= i_coeffs(coeff_nb);
|
|
|
|
subfilter_nb := subfilter_nb+1;
|
|
|
|
IF (subfilter_nb = cst_nb_subfilters) THEN
|
|
|
|
sf_coeff := sf_coeff+1;
|
|
|
|
subfilter_nb := 0;
|
|
|
|
END IF;
|
|
|
|
END LOOP coeff_for_matrix;
|
|
|
|
END PROCESS fill_coeff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- instanciation of the shift-reg for polyphasd filter
|
|
|
|
shift_reg_inst : ENTITY work.POLY_SHIFT_REG(Fill_Matrix)
|
|
|
|
PORT MAP (i_clk => i_clk,
|
|
|
|
i_data => i_data,
|
|
|
|
o_data => matrix3D_reg_out_simple_rif_in
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- instanciation of the (cst_nb_subfilters) subfilters
|
|
|
|
simple_fir_inst_loop : FOR i IN 0 TO cst_nb_subfilters-1 GENERATE
|
|
|
|
simple_fir_inst : ENTITY work.TREE_FIR(Simple_Fir)
|
|
|
|
PORT MAP(i_clk => i_clk,
|
|
|
|
i_coeffs => matrix_coeffs(i),
|
|
|
|
i_data => matrix3D_reg_out_simple_rif_in(i),
|
|
|
|
o_data => matrix_fir_out(i)
|
|
|
|
);
|
|
|
|
END GENERATE simple_fir_inst_loop;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
o_data <= matrix_fir_out;
|
|
|
|
|
|
|
|
END ARCHITECTURE polyphase;
|