ROD firmware  1.0.5
ATLAS l1-calo - ROD_eFEX and ROD_jFEX firmware for the L1Calo ROD board

Back to ROD documentation
system_top_reset.vhd
1 
2 
3 library IEEE;
4 use IEEE.STD_LOGIC_1164.ALL;
5 use IEEE.STD_LOGIC_UNSIGNED.ALL;
6 
8 
9 entity system_top_reset is
10 generic
11  (
12  max_count : std_logic_vector(31 downto 0) := x"0000FFFF"
13  );
14 
15 
16  Port ( clk40 : in STD_LOGIC;
17  rod_button : in STD_LOGIC;
18  sys_top_reset : out STD_LOGIC;
19  sys_top_reset_b : out STD_LOGIC);
21 
22 architecture RTL of system_top_reset is
23 
24 
25 
26 signal reset_reg : std_logic := '1';
27 signal count : std_logic_vector(31 downto 0) := X"0FFFFFFF";
28 
29 begin
30 
31  process (clk40) begin
32  if rising_edge (clk40) then
33  if (rod_button = '0') then
34  count <= max_count;
35  reset_reg <= '1';
36  elsif count /= X"00000000" then
37  count <= (count - '1');
38  reset_reg <='1';
39  else
40  reset_reg <='0';
41  end if;
42  end if;
43  end process;
44  sys_top_reset <= reset_reg;
45  sys_top_reset_b <= not reset_reg;
46 
47 
48 end RTL;