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.

47 lines
1.0 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_next is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_next;
  9. architecture psl of psl_next is
  10. signal a, b : std_logic;
  11. signal c, d : std_logic;
  12. begin
  13. -- 012345678901
  14. SEQ_A : sequencer generic map ("_-__--__-__") port map (clk, a);
  15. SEQ_B : sequencer generic map ("_--__--__--") port map (clk, b);
  16. -- 012345678901
  17. SEQ_C : sequencer generic map ("_-__--__-__") port map (clk, c);
  18. SEQ_D : sequencer generic map ("_--__-___--") port map (clk, d);
  19. -- All is sensitive to rising edge of clk
  20. default clock is rising_edge(clk);
  21. -- This assertion holds
  22. NEXT_0_a : assert always (a -> next b);
  23. -- This assertion doesn't hold at cycle 6
  24. NEXT_1_a : assert always (c -> next d);
  25. -- Stop simulation after longest running sequencer is finished
  26. -- Simulation only code by using pragmas
  27. -- synthesis translate_off
  28. stop_sim(clk, 12);
  29. -- synthesis translate_on
  30. end architecture psl;