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.

57 lines
960 B

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. entity issue is
  4. port (
  5. clk : in std_logic
  6. );
  7. end entity issue;
  8. architecture psl of issue is
  9. attribute anyconst : boolean;
  10. signal a: natural;
  11. attribute anyconst of a : signal is true;
  12. begin
  13. -- All is sensitive to rising edge of clk
  14. default clock is rising_edge(clk);
  15. -- works
  16. assume always a = 42;
  17. assert always a = 42;
  18. -- Error occurs when using a generate statement
  19. testG : if true generate
  20. signal b : natural;
  21. attribute anyconst of b : signal is true;
  22. begin
  23. -- works
  24. GEN_ASSUME : assume always b = 23;
  25. GEN_ASSERT : assert always b = 23;
  26. end generate testG;
  27. -- Same error occurs when using a block statement
  28. testB : block is
  29. signal c : natural;
  30. attribute anyconst of c : signal is true;
  31. begin
  32. -- works
  33. BLK_ASSUME : assume always c = 11;
  34. BLK_ASSERT : assert always c = 11;
  35. end block testB;
  36. end architecture psl;