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.

45 lines
919 B

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4. entity firo is
  5. generic (
  6. TOGGLE : boolean := true
  7. );
  8. port (
  9. frun_i : in std_logic;
  10. fdata_o : out std_logic
  11. );
  12. end entity firo;
  13. architecture rtl of firo is
  14. signal s_ring : std_logic_vector(15 downto 0);
  15. signal s_tff : std_logic;
  16. begin
  17. firoring : for index in 1 to 15 generate
  18. s_ring(index) <= not s_ring(index - 1);
  19. end generate;
  20. s_ring(0) <= (s_ring(15) xor s_ring(14) xor s_ring(7) xor s_ring(6) xor s_ring(5) xor s_ring(4) xor s_ring(2)) and frun_i;
  21. with_toggle : if TOGGLE generate
  22. tffP : process(frun_i, s_ring(15)) is
  23. begin
  24. if (not frun_i) then
  25. s_tff <= '0';
  26. elsif (rising_edge(s_ring(15))) then
  27. s_tff <= not s_tff;
  28. end if;
  29. end process tffP;
  30. fdata_o <= s_ring(15) xor s_tff;
  31. else generate
  32. fdata_o <= s_ring(15);
  33. end generate;
  34. end architecture rtl;