Forum Discussion
cjak
Occasional Contributor
1 month agoYes, this is the filter. Both multiply and accumulate happens in the FILTERING-state, along with truncation. In addition, there is a RAM holding the accumulated sum. Input-samples are not stored when coming in.
o_coef_addr <= std_logic_vector(coef_addr_cnt);
-- Accumulator RAM
p_accRAM : process (clk) is
begin
if rising_edge(clk) then
if (we_accRAM = '1') then
accRAM_Re(to_integer(accRAM_addr_in)) <= accRAM_Re_in;
accRAM_Im(to_integer(accRAM_addr_in)) <= accRAM_Im_in;
end if;
accRAM_Re_out <= accRAM_Re(to_integer(accRAM_addr_out));
accRAM_Im_out <= accRAM_Im(to_integer(accRAM_addr_out));
end if;
end process p_accRAM;
-- Sample input-samples and detect tvalid-flanks
p_edge : process (clk) is
begin
if rising_edge(clk) then
sample_s1.tvalid <= i_sample.tvalid;
sample_s1.tdata <= i_sample.tdata;
if (i_sample.tvalid = '1' and sample_s1.tvalid = '0') then
sample_tvalid_posedge <= '1';
sample_tvalid_negedge <= '0';
elsif (i_sample.tvalid = '0' and sample_s1.tvalid = '1') then
sample_tvalid_negedge <= '1';
sample_tvalid_posedge <= '0';
else
sample_tvalid_posedge <= '0';
sample_tvalid_negedge <= '0';
end if;
end if;
end process p_edge;