random.vhdl 643 B

12345678910111213141516171819202122232425262728293031
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4. library work;
  5. use work.glibc_random.all;
  6. entity random is
  7. port (
  8. clk : in std_ulogic;
  9. data : out std_ulogic_vector(63 downto 0);
  10. raw : out std_ulogic_vector(63 downto 0);
  11. err : out std_ulogic
  12. );
  13. end entity random;
  14. architecture behaviour of random is
  15. begin
  16. err <= '0';
  17. process(clk)
  18. variable rand : std_ulogic_vector(63 downto 0);
  19. begin
  20. if rising_edge(clk) then
  21. rand := pseudorand(64);
  22. data <= rand;
  23. raw <= rand;
  24. end if;
  25. end process;
  26. end behaviour;