Line 43... |
Line 43... |
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
--
|
--
|
-- CVS Revision History
|
-- CVS Revision History
|
--
|
--
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.1 2004/06/03 17:49:26 gedra
|
|
-- Generic event register. Used in both receiver and transmitter.
|
|
--
|
--
|
--
|
|
|
library IEEE;
|
library IEEE;
|
use IEEE.std_logic_1164.all;
|
use IEEE.std_logic_1164.all;
|
|
|
entity gen_event_reg is
|
entity gen_event_reg is
|
generic (DataWidth: integer:=32);
|
generic (DATA_WIDTH: integer:=32);
|
port (
|
port (
|
clk: in std_logic; -- clock
|
clk: in std_logic; -- clock
|
rst: in std_logic; -- reset
|
rst: in std_logic; -- reset
|
evt_wr: in std_logic; -- event register write
|
evt_wr: in std_logic; -- event register write
|
evt_rd: in std_logic; -- event register read
|
evt_rd: in std_logic; -- event register read
|
evt_din: in std_logic_vector(DataWidth - 1 downto 0); -- write data
|
evt_din: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- write data
|
evt_dout: out std_logic_vector(DataWidth - 1 downto 0); -- read data
|
event: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- event vector
|
event: in std_logic_vector(DataWidth - 1 downto 0); -- event vector
|
evt_mask: in std_logic_vector(DATA_WIDTH - 1 downto 0); -- irq mask
|
evt_mask: in std_logic_vector(DataWidth - 1 downto 0); -- irq mask
|
|
evt_en: in std_logic; -- irq enable
|
evt_en: in std_logic; -- irq enable
|
|
evt_dout: out std_logic_vector(DATA_WIDTH - 1 downto 0); -- read data
|
evt_irq: out std_logic); -- interrupt request
|
evt_irq: out std_logic); -- interrupt request
|
end gen_event_reg;
|
end gen_event_reg;
|
|
|
architecture rtl of gen_event_reg is
|
architecture rtl of gen_event_reg is
|
|
|
signal evt_internal, zero: std_logic_vector(DataWidth - 1 downto 0);
|
signal evt_internal, zero: std_logic_vector(DATA_WIDTH - 1 downto 0);
|
|
|
begin
|
begin
|
|
|
evt_dout <= evt_internal when evt_rd = '1' else (others => '0');
|
evt_dout <= evt_internal when evt_rd = '1' else (others => '0');
|
zero <= (others => '0');
|
zero <= (others => '0');
|
|
|
-- IRQ generation:
|
-- IRQ generation:
|
-- IRQ signal will pulse low when writing to the event register. This will capture situations
|
-- IRQ signal will pulse low when writing to the event register. This will
|
-- when not all active events are cleared or an event happens at the same time as it is cleared.
|
-- capture situations when not all active events are cleared or an event happens
|
|
-- at the same time as it is cleared.
|
IR: process (clk)
|
IR: process (clk)
|
begin
|
begin
|
if rising_edge(clk) then
|
if rising_edge(clk) then
|
if ((evt_internal and evt_mask) /= zero) and evt_wr = '0' and evt_en = '1' then
|
if ((evt_internal and evt_mask) /= zero) and evt_wr = '0' and evt_en = '1' then
|
evt_irq <= '1';
|
evt_irq <= '1';
|
Line 102... |
Line 106... |
evt_internal(k) <= '0';
|
evt_internal(k) <= '0';
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process EBIT;
|
end process EBIT;
|
end generate;
|
end generate EVTREG;
|
|
|
end rtl;
|
end rtl;
|
|
|
No newline at end of file
|
No newline at end of file
|