Lösung des Praktikums Systementwurf
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.

sync_rst.vhd 764B

1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. entity sync_rst is
  4. generic
  5. (
  6. WIDTH : positive range 2 to 5 := 3
  7. );
  8. port
  9. (
  10. clk : in std_logic;
  11. reset : in std_logic;
  12. rst_sync : out std_logic
  13. );
  14. end entity sync_rst;
  15. architecture rtl of sync_rst is
  16. --! Synchronization FFs
  17. signal sync : std_logic_vector( WIDTH - 1 downto 0 );
  18. begin
  19. p_sync: process ( clk, reset ) is
  20. begin
  21. if ( reset = '1' ) then
  22. sync <= ( others => '1' );
  23. elsif ( rising_edge( clk ) ) then
  24. sync( 0 ) <= '0';
  25. sync( WIDTH - 1 downto 1 ) <= sync( WIDTH - 2 downto 0 );
  26. end if;
  27. end process p_sync;
  28. rst_sync <= sync( WIDTH - 1 );
  29. end architecture rtl;