eFEX firmware  1.7.3
ATLAS l1-calo - electron and tau feature extraction firmware for eFEX boards

Back to eFEX documentation
packet_fifo_reset_block.vhd
Go to the documentation of this file.
1 
7 
9 LIBRARY ieee;
10 USE ieee.std_logic_1164.all;
11 
14  PORT (
15  clk : in std_logic;
16  rst : in std_logic;
17  fifo_valid : in std_logic;
18  fifo_last : in std_logic;
19  fifo_error : in std_logic;
20  fifo_reset : out std_logic
21  );
22 END ENTITY packet_fifo_reset_block;
23 
25 Architecture rtl of packet_fifo_reset_block is
26 
27 signal fifo_reset_sig: std_logic;
28 
29 BEGIN
30 
31  fifo_reset <= fifo_reset_sig;
32 
33  fifo_reset_block: process(clk)
34 -- stretched reset signal
35  Variable stretch: std_logic_vector(7 downto 0) := (Others => '1');
36 -- armed set means we are sensitive to incoming data to continue reset
37  Variable armed : std_logic := '0';
38  begin
39  if rising_edge(clk) then
40 -- Reset on incoming rst but don't enable check on incoming data...
41  if (rst = '1') then
42  stretch := (Others => '1');
43  armed := '0';
44 -- Reset on error from FIFO and arm stretch for incoming data
45  elsif (fifo_error = '1') then
46  stretch := (Others => '1');
47  armed := '1';
48 -- Clear reset if tlast seen on input
49  elsif (fifo_valid = '1') and (fifo_last = '1') and (armed = '1') then
50  stretch := (Others => '0');
51 -- Otherwise extend reset if still incoming data...
52  elsif (fifo_valid = '1') and (armed = '1') then
53  stretch := (Others => '1');
54  else
55  stretch := stretch(6 downto 0) & "0";
56  end if;
57 -- Finally make sure that armed is cleared at end of reset...
58  if (fifo_reset_sig = '0') then
59  armed := '0';
60  end if;
61  fifo_reset_sig <= stretch(7)
62  -- pragma translate_off
63  after 2 ns
64  -- pragma translate_on
65  ;
66  end if;
67  end process fifo_reset_block;
68 
69 END Architecture rtl;
Assert reset on error in FIFO and hold until end of incoming packet...
Assert reset on error in FIFO and hold until end of incoming packet...