Line 6... |
Line 6... |
-- # that a RX link has received new data or that a TX link has finished sending data #
|
-- # that a RX link has received new data or that a TX link has finished sending data #
|
-- # (if FIFO_DEPTH = 1) OR if RX/TX link FIFO has become half full (if FIFO_DEPTH > 1). #
|
-- # (if FIFO_DEPTH = 1) OR if RX/TX link FIFO has become half full (if FIFO_DEPTH > 1). #
|
-- # ********************************************************************************************* #
|
-- # ********************************************************************************************* #
|
-- # BSD 3-Clause License #
|
-- # BSD 3-Clause License #
|
-- # #
|
-- # #
|
-- # Copyright (c) 2021, Stephan Nolting. All rights reserved. #
|
-- # Copyright (c) 2022, Stephan Nolting. All rights reserved. #
|
-- # #
|
-- # #
|
-- # Redistribution and use in source and binary forms, with or without modification, are #
|
-- # Redistribution and use in source and binary forms, with or without modification, are #
|
-- # permitted provided that the following conditions are met: #
|
-- # permitted provided that the following conditions are met: #
|
-- # #
|
-- # #
|
-- # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
-- # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
Line 206... |
Line 206... |
irq_tx_mode(i) <= data_i(i + irq_tx_mode_lsb_c);
|
irq_tx_mode(i) <= data_i(i + irq_tx_mode_lsb_c);
|
end loop;
|
end loop;
|
end if;
|
end if;
|
ack_write <= '1';
|
ack_write <= '1';
|
else -- TX links
|
else -- TX links
|
ack_write <= or_reduce_f(link_sel and tx_fifo_free);
|
if (or_reduce_f(link_sel and tx_fifo_free) = '1') then
|
|
ack_write <= '1';
|
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
|
|
-- read access --
|
-- read access --
|
data_o <= (others => '0');
|
data_o <= (others => '0');
|
Line 242... |
Line 244... |
when others =>
|
when others =>
|
data_o <= (others => '0');
|
data_o <= (others => '0');
|
end case;
|
end case;
|
else -- RX links
|
else -- RX links
|
data_o <= rx_fifo_rdata(to_integer(unsigned(addr(4 downto 2))));
|
data_o <= rx_fifo_rdata(to_integer(unsigned(addr(4 downto 2))));
|
ack_read <= or_reduce_f(link_sel and rx_fifo_avail);
|
if (or_reduce_f(link_sel and rx_fifo_avail) = '1') then
|
|
ack_read <= '1';
|
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process rw_access;
|
end process rw_access;
|
|
|
Line 326... |
Line 330... |
|
|
-- interrupt arbiter --
|
-- interrupt arbiter --
|
irq_generator: process(clk_i)
|
irq_generator: process(clk_i)
|
begin
|
begin
|
if rising_edge(clk_i) then
|
if rising_edge(clk_i) then
|
irq_rx_o <= or_reduce_f(rx_irq.set);
|
irq_rx_o <= '0';
|
irq_tx_o <= or_reduce_f(tx_irq.set);
|
irq_tx_o <= '0';
|
|
if (or_reduce_f(rx_irq.set) = '1') then
|
|
irq_rx_o <= '1';
|
|
end if;
|
|
if (or_reduce_f(tx_irq.set) = '1') then
|
|
irq_tx_o <= '1';
|
|
end if;
|
end if;
|
end if;
|
end process irq_generator;
|
end process irq_generator;
|
|
|
|
|
-- Link Select ----------------------------------------------------------------------------
|
-- Link Select ----------------------------------------------------------------------------
|