resetting FIFO

F

FP

Guest
I want to write all 0's to a 2 dimensional FIFO at reset. How do I do
this? The FIFO is 16 bits wide and 256 words deep.
 
FP wrote:
I want to write all 0's to a 2 dimensional FIFO at reset. How do I do
this? The FIFO is 16 bits wide and 256 words deep.
An empty fifo should read zeros
no matter what is in the array.
To init, all I have to do is
set empty, clear full and set
the read and write pointers
to the same location.

-- Mike Treseler
 
FP wrote:
I want to write all 0's to a 2 dimensional FIFO at reset. How do I do
this? The FIFO is 16 bits wide and 256 words deep.
You shouldn't have to initialize any memory in the FIFO. If the 'empty'
output is asserted, as it will be at reset, the output is invalid and it
doesn't matter what it is. -Kevin
 
FP wrote:
I want to write all 0's to a 2 dimensional FIFO at reset. How do I do
this? The FIFO is 16 bits wide and 256 words deep.
The reason you're being told you don't need to reset the FIFO contents
rather than being told how to do it is that this kind of reset is very
expensive in terms of resources and effectively eliminates the ability
to use memory elements to implement the 4kbits of storage elements.

If you want to reset the contents, just treat the logic like any other
bunch of registers. You do, however, have to write your own FIFO from
scratch in this case rather than using modules provided by your
synthesis or silicon vendors in order to get this function considered
"unnecessary" by almost all engineers.

A technique used to "virtually" clear a RAM without actually clearing
the contents is to use a "dirty bit" for each word; the dirty bit gets
cleared on reset (16:1 reduction in registers versus implementing the
RAM in memory) and set when the contents are first written. On a read,
the dirty bit indicates whether to read a zero or the actual memory
contents.

You could use a similar "dirty bit" concept with a FIFO, using a counter
instead but to what end? Once your FIFO goes empty, the contents won't
exactly be zero. An empty FIFO and a reset-initialized FIFO should
behave the same.

So why clear the contents?

- John_H
 
John_H wrote:
(snip)

The reason you're being told you don't need to reset the FIFO contents
rather than being told how to do it is that this kind of reset is very
expensive in terms of resources and effectively eliminates the ability
to use memory elements to implement the 4kbits of storage elements.
(snip)

You could use a similar "dirty bit" concept with a FIFO, using a counter
instead but to what end? Once your FIFO goes empty, the contents won't
exactly be zero. An empty FIFO and a reset-initialized FIFO should
behave the same.
With either triple port memory or an extra cycle on each read
one could possibly write zeros into previously used cells.

It might be required for some secure systems, such as ones
doing cryptographic processing, where sensitive data might
be left in empty cells. (Consider a FIFO between an ATM
keyboard and the bank computer. Do you want your PIN in there.)

-- glen
 
On May 29, 7:58 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
John_H wrote:

(snip)

The reason you're being told you don't need to reset the FIFO contents
rather than being told how to do it is that this kind of reset is very
expensive in terms of resources and effectively eliminates the ability
to use memory elements to implement the 4kbits of storage elements.

(snip)

You could use a similar "dirty bit" concept with a FIFO, using a counter
instead but to what end?  Once your FIFO goes empty, the contents won't
exactly be zero.  An empty FIFO and a reset-initialized FIFO should
behave the same.

With either triple port memory or an extra cycle on each read
one could possibly write zeros into previously used cells.

It might be required for some secure systems, such as ones
doing cryptographic processing, where sensitive data might
be left in empty cells.  (Consider a FIFO between an ATM
keyboard and the bank computer.  Do you want your PIN in there.)

-- glen
Thank you all for your valuable suggestions.
 

Welcome to EDABoard.com

Sponsor

Back
Top