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.

54 lines
1.4 KiB

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