Examples of using PSL for functional and formal verification of VHDL with GHDL (and SymbiYosys)
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.

43 lines
1.1 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_sere_within is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_sere_within;
  9. architecture psl of psl_sere_within is
  10. signal req, busy, valid, done : std_logic;
  11. begin
  12. -- 0123456789
  13. SEQ_REQ : sequencer generic map ("_-________") port map (clk, req);
  14. SEQ_BUSY : sequencer generic map ("__------__") port map (clk, busy);
  15. SEQ_VALID : sequencer generic map ("___-_-_-__") port map (clk, valid);
  16. SEQ_DONE : sequencer generic map ("________-_") port map (clk, done);
  17. -- All is sensitive to rising edge of clk
  18. default clock is rising_edge(clk);
  19. -- Occurrance of a SERE during another SERE
  20. -- valid has to hold 3 times during busy holds and done does't hold
  21. -- This assertion holds
  22. SERE_0_a : assert always {req} |=> {{valid[=3]} within {(busy and not done)[+]}; not busy and done};
  23. -- Stop simulation after longest running sequencer is finished
  24. -- Simulation only code by using pragmas
  25. -- synthesis translate_off
  26. stop_sim(clk, 10);
  27. -- synthesis translate_on
  28. end architecture psl;