Sizing the depth

You will learn

How depth follows from the write rate, the read rate and the worst burst, and what a real timed loop measures.

Depth is not a feeling: writes at rate W, reads at rate R, and the buffer must hold the worst burst times (W - R) over the time it lasts. Oversize it and it costs BRAM you could have spent; undersize it and it overflows silently, because a full FIFO drops or blocks and neither shows up in a waveform. The widget is a real loop with a measured time -- 19.06 s for router1, bitwalk, xc7frames2bit and the SRAM load, on a laptop at load average about 110 -- the same arithmetic of rate and time that sizes a buffer, measured on a run that really happened. The spec frame opens fifo.t27, whose fill_count is the number this lesson is about.

Open the interactive lesson →