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.

42 lines
750 B

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