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.

41 lines
898 B

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use work.pkg.all;
  4. entity psl_onehot0 is
  5. port (
  6. clk : in std_logic
  7. );
  8. end entity psl_onehot0;
  9. architecture psl of psl_onehot0 is
  10. signal a, b : std_logic_vector(3 downto 0);
  11. begin
  12. -- 012345678901234567
  13. SEQ_A : hex_sequencer generic map ("000111222444888888") port map (clk, a);
  14. SEQ_B : hex_sequencer generic map ("000111222444888fff") port map (clk, b);
  15. -- All is sensitive to rising edge of clk
  16. default clock is rising_edge(clk);
  17. -- This assertion holds
  18. ONEHOT0_0_a : assert always onehot0(a);
  19. -- This assertion fails at cycle 15
  20. ONEHOT0_1_a : assert always onehot0(b);
  21. -- Stop simulation after longest running sequencer is finished
  22. -- Simulation only code by using pragmas
  23. -- synthesis translate_off
  24. stop_sim(clk, 20);
  25. -- synthesis translate_on
  26. end architecture psl;