Examples and design pattern for VHDL verification
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.

60 lines
1.1 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4. library std;
  5. use std.env.all;
  6. entity psl_test_endpoint is
  7. end entity psl_test_endpoint;
  8. architecture test of psl_test_endpoint is
  9. signal s_rst_n : std_logic := '0';
  10. signal s_clk : std_logic := '0';
  11. signal s_write : std_logic;
  12. signal s_read : std_logic;
  13. begin
  14. s_rst_n <= '1' after 100 ns;
  15. s_clk <= not s_clk after 10 ns;
  16. TestP : process is
  17. begin
  18. report "RUNNING psl_test_endpoint test case";
  19. report "==========================================";
  20. s_write <= '0'; -- named assertion should hit
  21. s_read <= '0';
  22. wait until s_rst_n = '1' and rising_edge(s_clk);
  23. s_write <= '1';
  24. wait until rising_edge(s_clk);
  25. s_read <= '1'; -- assertion should hit
  26. wait until rising_edge(s_clk);
  27. s_write <= '0';
  28. s_read <= '0';
  29. wait until rising_edge(s_clk);
  30. stop(0);
  31. wait;
  32. end process TestP;
  33. -- psl default clock is rising_edge(s_clk);
  34. -- psl endpoint E_TEST0 is {not(s_write); s_write};
  35. process is
  36. begin
  37. wait until E_TEST0;
  38. report "HIT";
  39. wait;
  40. end process;
  41. end architecture test;