Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Asynchronous clocks
Reading Frequency: 200 Mhz
Writing Frequency: 100 Mhz
It can do 80writes in 100 clocks and 4 reads in 10 clocks.
What is the depth of FIFO needed?
Why do you think of a packetised stream? even then a fifo is a data buffer and had no visibility of packets.If you don't know your packet length then you know
nothing.
If you don't know time between packet write and packet
read-to-buffer-bottom then you know nothing.
There has to be some kind of flow control to ensure no
overrun / underrun. A 2:1 write:read means there is no
acceptable FIFO depth absent such higher level feedback.
Only time-to-screwup changes with depth.
How do you presume a write:read rate of 1:1? OP has repeatedly not stated their timing relationship. It could be 100:1 for all we know.Why do you think of a packetised stream? even then a fifo is a data buffer and had no visibility of packets.
rate is 1:1 on average, why you refer to 2:1
write rate = 80/100*100Mhz = 80MHzHow do you presume a write:read rate of 1:1? OP has repeatedly not stated their timing relationship. It could be 100:1 for all we know.
For one special case.write rate = 80/100*100Mhz = 80MHz
read rate = 4/10*200 = 80MHz
so on average it is 1:1
If it is bursty then burst size needs to be buffered based on their implementation.
in every case...For one special case.
If the burst is as below, assuming a time window of 100 write clocks:For one special case.
Again, SOMEONE needs to state a specification. There's nothing in this discussion to make me believe that reading and writing occur simultaneously.
Again, that’s an arbitrary assumption you’ve made to validate your answer. My assumption, until the OP states otherwise, is that there can be 1000000 bursts of 80 writes each before a read is ever done. That’s just as valid an assumption as yours because they’re both based on nothing.If the burst is as below, assuming a time window of 100 write clocks:
80 writes followed by a gap of 20 clks x 1 = 80 writes
4 reads followed by gap of 6 clks x 20 = 80 reads
<------------------------------------------> 80 writes
...................................................................................||||……||||……||||……||||……||||……||||……||||……|||| Rd
If so a fifo depth of 80 will do. Start read once 80 locations are written, from then on it will buffer steadily.
Simulate and confirm
In that case fifo depth has to be 1000,000 * 80 = 80Million locations.Again, that’s an arbitrary assumption you’ve made to validate your answer. My assumption, until the OP states otherwise, is that there can be 1000000 bursts of 80 writes each before a read is ever done. That’s just as valid an assumption as yours because they’re both based on nothing.
As Klaus tries to point out (vainly, I guess) is that, yes the AVERAGE write:read ratio has to be 1:1, but there‘s just not enough information to define the FIFO depth required.
no.(vainly, I guess)
@KLAUS, I think you misunderstood my comment; I totally agree with your 1:1 requirement. I meant that trying to explain this to others appears to be in vain.no.
Every, every, every, FIFO needs an average of 1:1. Else you lose data.
And AVERAGE clearly was highlighted in the posts above.
Just think about it:
* Give one example where it is normal operation to put in more data than you read in average.
(FIFO overflow, loss of data)
* Give one example where it is normal operation to read out more data than you put in, in average.
(FIFO underflow, get corrupt data)
Klaus