Various projects using Raspberry Pi
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.

69 lines
1.3 KiB

  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4. entity FiRoE is
  5. generic (
  6. TOGGLE : boolean := true
  7. );
  8. port (
  9. FiRo_o : out std_logic;
  10. Run_i : in std_logic
  11. );
  12. end entity FiRoE;
  13. architecture rtl of FiRoE is
  14. --+ signal for inverter loop
  15. signal s_ring : std_logic_vector(15 downto 0);
  16. signal s_tff : std_logic;
  17. --+ attributes for synplify synthesis tool to preserve inverter loop
  18. attribute syn_keep : boolean;
  19. attribute syn_hier : string;
  20. attribute syn_hier of rtl : architecture is "hard";
  21. attribute syn_keep of s_ring : signal is true;
  22. attribute syn_keep of s_tff : signal is true;
  23. begin
  24. FiroRingG : for index in 1 to 15 generate
  25. s_ring(index) <= not(s_ring(index - 1));
  26. end generate FiroRingG;
  27. 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 Run_i;
  28. WithToggleG : if TOGGLE generate
  29. tffP : process(Run_i, s_ring(15)) is
  30. begin
  31. if(Run_i = '0') then
  32. s_tff <= '0';
  33. elsif(rising_edge(s_ring(15))) then
  34. s_tff <= not s_tff;
  35. end if;
  36. end process tffP;
  37. FiRo_o <= s_ring(15) xor s_tff;
  38. end generate WithToggleG;
  39. WithoutToggleG : if not(TOGGLE) generate
  40. FiRo_o <= s_ring(15);
  41. end generate WithoutToggleG;
  42. end architecture rtl;