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.

61 lines
1.6 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_until is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_until;
  9. architecture psl of psl_until is
  10. signal a, b, c : std_logic;
  11. signal d, e, f : std_logic;
  12. signal g, h, i : std_logic;
  13. begin
  14. -- 01234567890
  15. SEQ_A : sequencer generic map ("_-___-_____") port map (clk, a);
  16. SEQ_B : sequencer generic map ("__--__----_") port map (clk, b);
  17. SEQ_C : sequencer generic map ("____-_____-") port map (clk, c);
  18. -- 01234567890
  19. SEQ_D : sequencer generic map ("_-___-_____") port map (clk, d);
  20. SEQ_E : sequencer generic map ("__---_-----") port map (clk, e);
  21. SEQ_F : sequencer generic map ("____-_____-") port map (clk, f);
  22. -- 012345
  23. SEQ_G : sequencer generic map ("_-____") port map (clk, g);
  24. SEQ_H : sequencer generic map ("______") port map (clk, h);
  25. SEQ_I : sequencer generic map ("__-___") port map (clk, i);
  26. -- All is sensitive to rising edge of clk
  27. default clock is rising_edge(clk);
  28. -- This assertion holds
  29. UNTIL_0_a : assert always (a -> next (b until c));
  30. -- This assertion holds
  31. UNTIL_1_a : assert always (d -> next (e until f));
  32. -- This assertion holds
  33. UNTIL_2_a : assert always (g -> next (h until i));
  34. -- This assertion doesn't hold at cycle 4
  35. UNTIL_3_a : assert always (a -> next (b until_ c));
  36. -- This assertion holds
  37. UNTIL_4_a : assert always (d -> next (e until_ f));
  38. -- This assertion doesn't hold at cycle 2
  39. UNTIL_5_a : assert always (g -> next (h until_ i));
  40. end architecture psl;