|
@ -5,6 +5,9 @@ use ieee.numeric_std.all; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
entity counter is |
|
|
entity counter is |
|
|
|
|
|
generic ( |
|
|
|
|
|
Init : natural := 8 |
|
|
|
|
|
); |
|
|
port ( |
|
|
port ( |
|
|
Reset_n_i : in std_logic; |
|
|
Reset_n_i : in std_logic; |
|
|
Clk_i : in std_logic; |
|
|
Clk_i : in std_logic; |
|
@ -23,7 +26,7 @@ begin |
|
|
process (Reset_n_i, Clk_i) is |
|
|
process (Reset_n_i, Clk_i) is |
|
|
begin |
|
|
begin |
|
|
if (Reset_n_i = '0') then |
|
|
if (Reset_n_i = '0') then |
|
|
Data_o <= 32x"8"; |
|
|
|
|
|
|
|
|
Data_o <= std_logic_vector(to_unsigned(Init, Data_o'length)); |
|
|
elsif (rising_edge(Clk_i)) then |
|
|
elsif (rising_edge(Clk_i)) then |
|
|
if (unsigned(Data_o) <= 64) then |
|
|
if (unsigned(Data_o) <= 64) then |
|
|
Data_o <= std_logic_vector(unsigned(Data_o) + 1); |
|
|
Data_o <= std_logic_vector(unsigned(Data_o) + 1); |
|
@ -33,3 +36,4 @@ begin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end architecture rtl; |
|
|
end architecture rtl; |
|
|
|
|
|
|