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

Back to eFEX documentation
nreset_gen.vhd
Go to the documentation of this file.
1 
6 
7 LIBRARY ieee;
8 USE ieee.std_logic_1164.all;
9 USE ieee.std_logic_arith.all;
10 
12 ENTITY nreset_gen IS
13  PORT(
15  clk : IN std_logic;
17  en_rst : IN std_logic;
19  reset : IN std_logic;
21  nreset : OUT std_logic
22  );
23 
24 -- Declarations
25 
26 END nreset_gen ;
28 
29 
30 
31 ARCHITECTURE Behavioral OF nreset_gen IS
32 
33  -- Architecture Declarations
34  signal cntr :unsigned(5 downto 0);
35 
36  TYPE STATE_TYPE IS (
37  s0,
38  s1,
39  s2
40  );
41 
42  -- Declare current and next state signals
43  SIGNAL current_state : STATE_TYPE;
44  SIGNAL next_state : STATE_TYPE;
45 
46  -- Declare any pre-registered internal signals
47  SIGNAL nreset_cld : std_logic ;
48 
49 BEGIN
50 
51  -----------------------------------------------------------------
52  clocked_proc : PROCESS (
53  clk,
54  reset
55  )
56  -----------------------------------------------------------------
57  BEGIN
58  IF (reset = '1') THEN
59  current_state <= s0;
60  -- Default Reset Values
61  nreset_cld <= '1';
62  cntr <= (others => '0');
63  ELSIF (clk'EVENT AND clk = '1') THEN
64  current_state <= next_state;
65 
66  -- Combined Actions
67  CASE current_state IS
68  WHEN s0 =>
69  cntr <= (others => '0');
70  nreset_cld <='1' ;
71  IF (en_rst ='1') THEN
72  nreset_cld <= '0';
73  END IF;
74  WHEN s1 =>
75  if (cntr < 32) then
76  cntr <= cntr +1;
77  end if;
78  WHEN s2 =>
79  nreset_cld <='1' ;
80  WHEN OTHERS =>
81  NULL;
82  END CASE;
83  END IF;
84  END PROCESS clocked_proc;
85 
86  -----------------------------------------------------------------
87  nextstate_proc : PROCESS (
88  cntr,
89  current_state,
90  en_rst
91  )
92  -----------------------------------------------------------------
93  BEGIN
94  CASE current_state IS
95  WHEN s0 =>
96  IF (en_rst ='1') THEN
97  next_state <= s1;
98  ELSE
99  next_state <= s0;
100  END IF;
101  WHEN s1 =>
102  IF (cntr = 32 and en_rst ='0') THEN
103  next_state <= s2;
104  ELSE
105  next_state <= s1;
106  END IF;
107  WHEN s2 =>
108  next_state <= s0;
109  WHEN OTHERS =>
110  next_state <= s0;
111  END CASE;
112  END PROCESS nextstate_proc;
113 
114  -- Concurrent Statements
115  -- Clocked output assignments
116  nreset <= nreset_cld;
117 
118 
119 end Behavioral;
Reset generation of PLLs.
Definition: nreset_gen.vhd:31
Reset generation of PLLs.
Definition: nreset_gen.vhd:12
in reset std_logic
reset
Definition: nreset_gen.vhd:19
in en_rst std_logic
reset pll
Definition: nreset_gen.vhd:17
in clk std_logic
clock
Definition: nreset_gen.vhd:15
out nreset std_logic
active low pll reset
Definition: nreset_gen.vhd:22