Trying to verify Verilog/VHDL designs with formal methods and tools
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.

39 lines
657 B

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4. entity counter is
  5. generic (
  6. Init : natural := 8
  7. );
  8. port (
  9. Reset_n_i : in std_logic;
  10. Clk_i : in std_logic;
  11. Data_o : out std_logic_vector(31 downto 0)
  12. );
  13. end entity counter;
  14. architecture rtl of counter is
  15. begin
  16. process (Reset_n_i, Clk_i) is
  17. begin
  18. if (Reset_n_i = '0') then
  19. Data_o <= std_logic_vector(to_unsigned(Init, Data_o'length));
  20. elsif (rising_edge(Clk_i)) then
  21. if (unsigned(Data_o) < 64) then
  22. Data_o <= std_logic_vector(unsigned(Data_o) + 1);
  23. end if;
  24. end if;
  25. end process;
  26. end architecture rtl;