Skip to content
Snippets Groups Projects
Commit d5ae20dc authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

gc_reset: asynchronously clear the counter

In case the free_clk itself is not running when the lock is lost,
still reset the other clock domains.
parent 213132e6
Branches
Tags
No related merge requests found
......@@ -22,14 +22,15 @@ architecture rtl of gc_reset is
signal locked_count : unsigned(g_logdelay-1 downto 0) := (others => '0');
signal master_rstn : std_logic;
begin
lock : process(free_clk_i)
lock : process(free_clk_i, locked_i)
constant locked_done : unsigned(g_logdelay-1 downto 0) := (others => '1');
begin
if rising_edge(free_clk_i) then
if locked_i = '0' then
master_rstn <= '0';
locked_count <= (others => '0');
else
-- Asynchronous reset
if locked_i = '0' then
master_rstn <= '0';
locked_count <= (others => '0');
else
if rising_edge(free_clk_i) then
if locked_count = locked_done then
master_rstn <= '1';
else
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment