misc: Allow dynamic length for synchronizer

This commit is contained in:
Markus Koch 2021-08-28 19:08:07 +02:00
parent 38f96cdc63
commit 3900d454f9
1 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,9 @@ use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity synchronizer is
generic(
SIZE : integer := 3
);
port(
clk : in std_logic;
rst : in std_logic;
@ -12,7 +15,7 @@ entity synchronizer is
end entity synchronizer;
architecture RTL of synchronizer is
signal sr : std_logic_vector(2 downto 0);
signal sr : std_logic_vector(SIZE - 1 downto 0);
begin
sync : process(clk, rst) is
begin