1 -- The Potato Processor - A simple processor for FPGAs
2 -- (c) Kristian Klomsten Skordal 2018 <kristian.skordal@wafflemail.net>
5 use ieee.std_logic_1164.all;
6 use work.pp_utilities.all;
8 --! @brief System reset unit.
9 --! Because most resets in the processor core are synchronous, at least one
10 --! clock pulse has to be given to the processor while the reset signal is
11 --! asserted. However, if the clock generator is being reset at the same time,
12 --! the system clock might not run during reset, preventing the processor from
13 --! properly resetting.
14 entity pp_soc_reset is
16 RESET_CYCLE_COUNT : natural := 20000000
21 reset_n : in std_logic;
22 reset_out : out std_logic;
24 system_clk : in std_logic;
25 system_clk_locked : in std_logic
27 end entity pp_soc_reset;
29 architecture behaviour of pp_soc_reset is
31 subtype counter_type is natural range 0 to RESET_CYCLE_COUNT;
32 signal counter : counter_type;
34 signal fast_reset : std_logic := '0';
35 signal slow_reset : std_logic := '1';
38 reset_out <= slow_reset;
42 -- if rising_edge(clk) then
43 -- if reset_n = '0' then
45 -- elsif system_clk_locked = '1' then
46 -- if fast_reset = '1' and slow_reset = '1' then
55 if rising_edge(system_clk) then
58 counter <= RESET_CYCLE_COUNT;
63 counter <= counter - 1;
69 end architecture behaviour;