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.

44 lines
1.2 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_sere_len_matching_and is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_sere_len_matching_and;
  9. architecture psl of psl_sere_len_matching_and 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. -- Length matching AND two SERE
  20. -- valid has to hold 3 times between req & done.
  21. -- busy has to hold each cycle between req & done.
  22. -- This assertion holds
  23. SERE_0_a : assert always {req} |=> {{valid[->3]} && {(busy and not done)[+]}; not busy and done};
  24. -- Stop simulation after longest running sequencer is finished
  25. -- Simulation only code by using pragmas
  26. -- synthesis translate_off
  27. stop_sim(clk, 10);
  28. -- synthesis translate_on
  29. end architecture psl;