SRAM used as FIFO?

J

Jo Schambach

I have a board on which SRAM is attached to an Altera Cyclone-II FPGA. I
would like to use the SRAM as a FIFO. The memory is capable of running
at 160MHz, the spec for the FIFO is 40MHz, so the SRAM could easily be
cycle-shared between read and write.
I can imagine that this kind of problem is very common, so my question:
Has anybody already written VHDL to control the SRAM in such a way that
it acts like a FIFO? If so, would you be willing to share your design?


--
Dr Joachim Schambach
The University of Texas at Austin
Department of Physics
1 University Station C1600
Austin, Texas 78712-0264, USA
Phone: (512) 471-1303; FAX: (814) 295-5111
e-mail: (e-mail address removed)
 
M

Mike Treseler

Jo said:
I can imagine that this kind of problem is very common, so my question:
Has anybody already written VHDL to control the SRAM in such a way that
it acts like a FIFO? If so, would you be willing to share your design?

A synchronous fifo is just an SRAM that uses
a push or pop counter for write or read addresses.
Here is the guts of a block-ram based design:

begin
if rising_edge(clk) then
if we = '1' then
mem(to_integer(push_tail_ptr)) <= data_i; -- raw address
end if;
data_q <= mem(to_integer(pop_head_ptr));
end if;
end process ram_access;



-- Mike Treseler
 
J

Jo Schambach

I forgot to mention:
the SRAM is actually a ZBT synchronous pipelined SRAM, so the data needs
to be presented to the SRAM 2 cycles after the control in Write
transactions, and also is available 2 cycles after control in Read
transactions.

Jo

Mike said:
A synchronous fifo is just an SRAM that uses
a push or pop counter for write or read addresses.
Here is the guts of a block-ram based design:

begin
if rising_edge(clk) then
if we = '1' then
mem(to_integer(push_tail_ptr)) <= data_i; -- raw address
end if;
data_q <= mem(to_integer(pop_head_ptr));
end if;
end process ram_access;



-- Mike Treseler


--
Dr Joachim Schambach
The University of Texas at Austin
Department of Physics
1 University Station C1600
Austin, Texas 78712-0264, USA
Phone: (512) 471-1303; FAX: (814) 295-5111
e-mail: (e-mail address removed)
 
M

Mike Treseler

Jo said:
I forgot to mention:
the SRAM is actually a ZBT synchronous pipelined SRAM, so the data needs
to be presented to the SRAM 2 cycles after the control in Write
transactions, and also is available 2 cycles after control in Read
transactions.

Well,
write some code, run some sims
or find someone in your department who can.

-- Mike Treseler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top