Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FIFO depth

aishu21

Newbie
Joined
May 18, 2023
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
23
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?
 
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?

write rate = 80/100*100Mhz = 80MHz
read rate = 4/10*200 = 80MHz
case 1: if your clocks are related(though asynchronous) and provided data flow is maintained then your write rate and read rate are same. your minimum depth would be that accommodating initial writes until read starts.

case2: if clocks are unrelated you have to set a threshold level and a feedback logic to control filling from source as rate can't be controlled otherwise.
 
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.
 
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.
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
 
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
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.
 
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.
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.
 
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.
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.
 
Hi,

For one special case.
in every case...

the average FIFO write:read rate need to be 1:1, otherwise you get corrupt/lost data.
* You can´t read more data than available.
* You can´t continously store more data into the buffer than you read.

The question needs to be how the stream timing looks like. How long is a burst time, what burst data rate, and so on...

Without clear values no on can answer your question.

Klaus
 
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.
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
 
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
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.
 
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.
In that case fifo depth has to be 1000,000 * 80 = 80Million locations.
No problem.
 
(vainly, I guess)
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
 
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
@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.

The question by the OP was ‘how deep does my FIFO need to be’, and the answer is : there’s not enough information to answer that.
 
Should the Moderators mark this thread as not open to answers because the OP has failed to provide sufficient info?
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top