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
924 B

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity yosys_anyseq is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity yosys_anyseq;
  9. architecture psl of yosys_anyseq is
  10. attribute anyseq : boolean;
  11. signal a: std_logic;
  12. signal b: natural;
  13. attribute anyseq of a : signal is true;
  14. attribute anyseq of b : signal is true;
  15. begin
  16. -- All is sensitive to rising edge of clk
  17. default clock is rising_edge(clk);
  18. -- a should always be high
  19. ANY_ASSUME_0_a : assume always a;
  20. -- This assertion holds
  21. ANY_ASSERT_0_a : assert always a;
  22. -- b should always be in range 23...42
  23. ANY_ASSUME_1_a : assume always b >= 23 and b <= 42;
  24. -- This assertion holds
  25. ANY_ASSERT_1_a : assert always b >= 23 and b <= 42;
  26. -- This assertion fails in cycle 1
  27. -- Solver chosen value can change from one to next cycle
  28. ANY_ASSERT_2_a : assert b >= 23 -> next b = prev(b);
  29. end architecture psl;