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.

46 lines
1.1 KiB

  1. vunit psl_vunit_vu (psl_vunit(beh)) {
  2. -- All is sensitive to rising edge of clk
  3. default clock is rising_edge(clk);
  4. gen_0 : if FORMAL = "SERE_0" or formal = "ALL" generate
  5. -- This assertion holds
  6. SERE_0_a : assert {a};
  7. end generate gen_0;
  8. gen_1 : if FORMAL = "SERE_1" or formal = "ALL" generate
  9. -- This assertion holds
  10. SERE_1_a : assert {a; a};
  11. end generate gen_1;
  12. gen_2 : if FORMAL = "SERE_2" or formal = "ALL" generate
  13. -- This assertion holds
  14. SERE_2_a : assert {a; a and b};
  15. end generate gen_2;
  16. gen_3 : if FORMAL = "SERE_3" or formal = "ALL" generate
  17. -- This assertion doesn't hold at cycle 2
  18. SERE_3_a : assert always {a; a};
  19. end generate gen_3;
  20. -- A simple check for counter increasing
  21. counter_check : for i in 0 to 14 generate
  22. SERE_4_a : assert always
  23. {c = std_logic_vector(to_unsigned(i, 4))}
  24. |=>
  25. {c = std_logic_vector(to_unsigned(i + 1, 4))};
  26. end generate counter_check;
  27. -- Using named sequences
  28. sequence s_a is {a; a};
  29. sequence s_b is {b};
  30. SERE_5_a : assert always s_a |-> s_b;
  31. -- Using named property
  32. property p_a is always s_a |-> s_b;
  33. PROP_0_a : assert p_a;
  34. }