Advertisement
Guest User

Untitled

a guest
May 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.91 KB | None | 0 0
  1.     process(clock, reset)
  2.     begin
  3.         if rising_edge(clock) then
  4.             fifo_count <= fifo_count + 1;
  5.             fifo_wren <= '0';
  6.             if (fifo_count > 2 and fifo_count < 10) or (fifo_count > 20) then
  7.                 if fifo_almost_full = '0' then
  8. --                  if fifo_count(0) = '1' then
  9.                         fifo_wren <= '1';
  10.                         fifo_din <= std_logic_vector(fifo_count);
  11. --                  end if;
  12.                 end if;
  13.             end if;
  14.  
  15.             -- pretend, that we don't want to read immediately
  16.             fifo_valid_sr <= fifo_valid_sr(fifo_valid_sr'left-1 downto 0) & fifo_valid;
  17.            
  18.             fifo_rdack <= '0';
  19. --          if fifo_valid = '1' and fifo_valid_sr(5) = '1' then
  20.             if fifo_valid = '1' then
  21.                 foo <= fifo_dout;
  22.                 report "FOO: " & integer'image(to_integer(unsigned(fifo_dout)));
  23.                 fifo_rdack <= '1';
  24.             end if;
  25.         end if;
  26.        
  27.         if reset = '1' then
  28.             fifo_count <= (others => '0');
  29.             fifo_wren <= '0';
  30.             fifo_rdack <= '0';
  31.             fifo_valid_sr <= (others => '0');
  32.         end if;
  33.     end process;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement