You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
751 B

  1. library ieee ;
  2. use ieee.std_logic_1164.all;
  3. -- Async reset synchronizer circuit inspired from
  4. -- Chris Cummings SNUG 2002 paper
  5. -- Synchronous Resets? Asynchronous Resets?
  6. -- I am so confused!
  7. -- How will I ever know which to use?
  8. entity reset_sync is
  9. generic (
  10. POLARITY : std_logic := '0'
  11. );
  12. port (
  13. clk_i : in std_logic;
  14. rst_i : in std_logic;
  15. rst_o : out std_logic
  16. );
  17. end entity;
  18. architecture sim of reset_sync is
  19. signal s_rst_d : std_logic_vector(1 downto 0);
  20. begin
  21. process (clk_i, rst_i) is
  22. begin
  23. if (rst_i = POLARITY) then
  24. s_rst_d <= (others => POLARITY);
  25. elsif (rising_edge(clk_i)) then
  26. s_rst_d <= s_rst_d(0) & not POLARITY;
  27. end if;
  28. end process;
  29. rst_o <= s_rst_d(1);
  30. end architecture;