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
765 B

  1. -- Simple sequencer to generate waveforms for 4 bit std_logic_vector signals
  2. -- Inspired by SymbioticEDA's sva-demos seq module
  3. -- https://github.com/SymbioticEDA/sva-demos/blob/master/seq.sv
  4. library ieee;
  5. use ieee.std_logic_1164.all;
  6. use work.pkg.all;
  7. entity hex_sequencer is
  8. generic (
  9. seq : string
  10. );
  11. port (
  12. clk : in std_logic;
  13. data : out std_logic_vector(3 downto 0)
  14. );
  15. end entity hex_sequencer;
  16. architecture rtl of hex_sequencer is
  17. signal cycle : natural := 0;
  18. signal ch : character;
  19. begin
  20. process (clk) is
  21. begin
  22. if rising_edge(clk) then
  23. if (cycle < seq'length) then
  24. cycle <= cycle + 1;
  25. end if;
  26. end if;
  27. end process;
  28. ch <= seq(cycle+1);
  29. data <= to_hex(ch);
  30. end architecture rtl;