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.

79 lines
2.1 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_sere_consecutive_repetition is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_sere_consecutive_repetition;
  9. architecture psl of psl_sere_consecutive_repetition 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. -- 012345678
  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. -- 012345
  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. -- 012345678
  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. SERE_0_a : assert always {a} |=> {b; b; b; b; c};
  30. -- This assertion holds
  31. SERE_1_a : assert always {a} |=> {b[*4]; c};
  32. -- This assertion holds
  33. SERE_2_a : assert always {a} |=> {b[*3 to 5]; c};
  34. -- This assertion holds
  35. SERE_3_a : assert always {a} |=> {b[*]; c};
  36. -- This assertion holds
  37. SERE_4_a : assert always {a} |=> {b[+]; c};
  38. -- This assertion holds
  39. SERE_5_a : assert always {d} |=> {e[*]; f};
  40. -- This assertion doesn't hold at cycle 2
  41. SERE_6_a : assert always {d} |=> {e[+]; f};
  42. -- This assertion doesn't hold at cycle 3
  43. SERE_7_a : assert always {g} |=> {h[*3]; i};
  44. -- This assertion doesn't hold at cycle 3
  45. SERE_8_a : assert always {g} |=> {h[*2 to 4]; i};
  46. -- This assertion doesn't hold at cycle 3
  47. SERE_9_a : assert always {g} |=> {h[*]; i};
  48. -- This assertion doesn't hold at cycle 3
  49. SERE_10_a : assert always {g} |=> {h[+]; i};
  50. -- This assertion holds
  51. SERE_11_a : assert always {g} |=> {[*5]; i};
  52. end architecture psl;