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.

50 lines
1.1 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_always is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_always;
  9. architecture psl of psl_always is
  10. signal a : std_logic;
  11. begin
  12. -- 012345
  13. SEQ : sequencer generic map ("--____") port map (clk, a);
  14. -- All is sensitive to rising edge of clk
  15. default clock is rising_edge(clk);
  16. -- Beware: potential pitfall!
  17. -- Every time a PSL assertion is similar to a concurrent
  18. -- VHDL assertion at that place, it is interpreted as such
  19. -- This assert is considered as VHDL assert statement,
  20. -- so it is active every cycle
  21. -- This assertion doesn't hold at cycle 2
  22. VHDL_ASSERT_a : assert a;
  23. -- The PSL comment helps to mark this as PSL assert
  24. -- This assertion holds
  25. -- psl WITHOUT_ALWAYS_a : assert a;
  26. -- This assertion doesn't hold at cycle 2
  27. WITH_ALWAYS_a : assert always a;
  28. -- Stop simulation after longest running sequencer is finished
  29. -- Simulation only code by using pragmas
  30. -- synthesis translate_off
  31. stop_sim(clk, 6);
  32. -- synthesis translate_on
  33. end architecture psl;