Line 1... |
Line 1... |
--!
|
--!
|
--! Copyright (C) 2011 - 2012 Creonic GmbH
|
--! Copyright (C) 2011 - 2014 Creonic GmbH
|
--!
|
--!
|
--! This file is part of the Creonic Viterbi Decoder, which is distributed
|
--! This file is part of the Creonic Viterbi Decoder, which is distributed
|
--! under the terms of the GNU General Public License version 2.
|
--! under the terms of the GNU General Public License version 2.
|
--!
|
--!
|
--! @file
|
--! @file
|
Line 58... |
Line 58... |
signal s_axis_input_tready_int : std_logic;
|
signal s_axis_input_tready_int : std_logic;
|
|
|
begin
|
begin
|
|
|
-- We are ready, when we are allowed to write to the output, or the output is idle.
|
-- We are ready, when we are allowed to write to the output, or the output is idle.
|
-- s_axis_input_tready_int <= '1' when m_axis_output_tready = '1' or m_axis_output_tvalid_int = '0' else
|
|
s_axis_input_tready_int <= '1' when m_axis_output_tready = '1' else
|
s_axis_input_tready_int <= '1' when m_axis_output_tready = '1' else
|
'0';
|
'0';
|
|
|
-- Connect internal versions of signal to output port.
|
-- Connect internal versions of signal to output port.
|
s_axis_input_tready <= s_axis_input_tready_int;
|
s_axis_input_tready <= s_axis_input_tready_int;
|
Line 77... |
Line 76... |
if rst = '1' then
|
if rst = '1' then
|
m_axis_output_tvalid_int <= '0';
|
m_axis_output_tvalid_int <= '0';
|
m_axis_output_tdata <= (others => '0');
|
m_axis_output_tdata <= (others => '0');
|
m_axis_output_tlast <= '0';
|
m_axis_output_tlast <= '0';
|
else
|
else
|
|
|
|
if m_axis_output_tvalid_int = '1' and m_axis_output_tready = '1' then
|
|
m_axis_output_tvalid_int <= '0';
|
|
m_axis_output_tlast <= '0';
|
|
end if;
|
|
|
if s_axis_input_tready_int = '1' and s_axis_input_tvalid = '1' then
|
if s_axis_input_tready_int = '1' and s_axis_input_tvalid = '1' then
|
v_branch_result := 0;
|
v_branch_result := 0;
|
|
|
for i in NUMBER_PARITY_BITS - 1 downto 0 loop
|
for i in NUMBER_PARITY_BITS - 1 downto 0 loop
|
|
|
--
|
--
|
-- Either the value is added or subtrcated, depending on
|
-- Either the value is added or subtracted, depending on
|
-- the current branch metric we are computing.
|
-- the current branch metric we are computing.
|
--
|
--
|
if EDGE_WEIGHT(i) = '0' then
|
if EDGE_WEIGHT(i) = '0' then
|
v_branch_result := v_branch_result + to_integer(s_axis_input_tdata(i));
|
v_branch_result := v_branch_result + to_integer(s_axis_input_tdata(i));
|
else
|
else
|
v_branch_result := v_branch_result - to_integer(s_axis_input_tdata(i));
|
v_branch_result := v_branch_result - to_integer(s_axis_input_tdata(i));
|
end if;
|
end if;
|
end loop;
|
end loop;
|
m_axis_output_tdata <= std_logic_vector(to_signed(v_branch_result, BW_BRANCH_RESULT));
|
m_axis_output_tdata <= std_logic_vector(to_signed(v_branch_result, BW_BRANCH_RESULT));
|
|
m_axis_output_tvalid_int <= '1';
|
|
m_axis_output_tlast <= s_axis_input_tlast;
|
end if;
|
end if;
|
|
|
m_axis_output_tvalid_int <= s_axis_input_tvalid;
|
|
m_axis_output_tlast <= s_axis_input_tlast;
|
|
end if;
|
end if;
|
end if;
|
end if;
|
end process pr_branch;
|
end process pr_branch;
|
|
|
end architecture rtl;
|
end architecture rtl;
|