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.

44 lines
1.0 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_next_event_e is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_next_event_e;
  9. architecture psl of psl_next_event_e is
  10. signal a, b, c : std_logic;
  11. begin
  12. -- 012345678901234
  13. SEQ_A : sequencer generic map ("_-______-______") port map (clk, a);
  14. SEQ_B : sequencer generic map ("___-__-___-__-_") port map (clk, b);
  15. SEQ_C : sequencer generic map ("______-___-____") port map (clk, c);
  16. -- All is sensitive to rising edge of clk
  17. default clock is rising_edge(clk);
  18. -- This assertion holds
  19. NEXT_EVENT_0_a : assert always (a -> next_event_e(b)[1 to 2](c));
  20. -- This assertion doesn't hold at cycle 13
  21. -- This assert is similar to using next_event(b)[2](c)
  22. NEXT_EVENT_1_a : assert always (a -> next_event_e(b)[2 to 2](c));
  23. -- Stop simulation after longest running sequencer is finished
  24. -- Simulation only code by using pragmas
  25. -- synthesis translate_off
  26. stop_sim(clk, 15);
  27. -- synthesis translate_on
  28. end architecture psl;