debouncing sys_res_n
[hwmod.git] / src / debouncing / counter.vhd
1 library ieee;\r
2 use ieee.std_logic_1164.all;\r
3 use work.math_pkg.all;\r
4 \r
5 entity counter is\r
6   generic\r
7   (\r
8     CNT_MAX : integer range 2 to integer'high\r
9   );\r
10   port\r
11   (\r
12     sys_clk : in std_logic;\r
13     sys_res_n : in std_logic;\r
14     clear_cnt : in std_logic;\r
15     cnt : out std_logic_vector(log2c(CNT_MAX) - 1 downto 0)\r
16   );\r
17 end entity counter;\r