- Xilinx User Community Forums
- :
- PLD Blog
- :
- FIFOs, A Tutorial Description
Announcements
--- Win Prizes for Kudos! ---
From now on, every time you provide a good solution or post valuable information on Xilinx User Community Forums, you will be awarded Special Kudos by the Forum Administrators. Every six months, the top two Kudos winners will receive a very special prize from Xilinx!
So, for a chance to claim your well-earned reward, please continue to reply to questions and post elite messages on our Forums. Your contributions are always appreciated!
FIFOs, A Tutorial Descriptio n
A FIFO is a sequential data buffer that is very easy to use:
Write a sequence of data words into the FIFO, and read them out in the same sequence. Writing and reading can overlap. There is no explicit addressing.
Most practical implementations use a dual-ported memory (RAM), writing into one port, addressed by the internal write counter, and reading through the other port, addressed by the internal read counter. This allows the use of two totally independent clocks for write and read. This is often called asynchronous operation, although writing and reading are each synchronous operation in their respective clock domain.
Most FIFO designs require free-running clocks, where the write or read operation is controlled by the respective clock enable. A typical FIFO has a DATA IN bus, a DATA OUT bus, a free-running write clock with its Enable control, and a free-running read clock with its Enable control.
The data width of the FIFO must accommodate the application, but the exact depth is irrelevant, as long as it is deep enough. The user never sees the unused locations.
A FIFO is very easy to use, since it hides all functional and timing complexity from the user.
FLAGS
The FIFO uses an EMPTY flag to signal to the user that no more read operations should be started. At the other extreme, the FULL flag tells the user that no more write operation should be started.
Generating these flags requires that the two internal addressing counters be compared for equality (identity), although they are incremented by two independent clocks. This is a very tricky operation. To avoid uncontrolled asynchronous decoding spikes, the counters usually count in a Gray sequence, where only one bit changes on any increment. And the two clocks can interact and might cause metastable delays.
Even more complex is the decoding of Almost Empty and Almost Full conditions, especially when their offset values are programmable. The “Almost” flags are useful as a “friendly early warning”, before the harsh FULL or EMPTY flags become active, which must be obeyed instantly.
The user is isolated from all these complexities, but must accept certain timing ambiguities. The FULL and EMPTY flags will always go active exactly on-time, to stop further reading or writing, but these flags must of necessity be allowed to take a few clock periods to go inactive again. The “Almost” flags have a slight uncertainty caused by the unknown phase relationship between the two clocks.
When the first word is being written into an empty FIFO, EMPTY goes low, and waits for an enabled read clock to present the Data on the DATA OUT bus.
There is a special mode of operation, called First-Word-Fall-Through (FWFT), where the first word written into the empty FIFO directly, on its own, appears at the DATA OUT port.
The conventional mode can be called Pull, while FWFT can be called Push. The two modes differ only in their response to the first write into an empty FIFO.
The preceding described the most demanding case of a high-speed dual-clock (asynchronous) FIFO. In the special case where both clocks are identical (even if individually enabled) the internal decoding is much simpler, and the binary counters and the control can be designed like a synchronous state machine.
At low clock rates, the two clocks can be synchronized to each other, or the read and write operations can be time-multiplexed in a single-port memory.
Very small FIFOs can be implemented with flip-flops or register arrays, sometimes even with shift registers.
Conceptually, a FIFO always behaves like a shift register, but with independent control of write and read operation. The very first FIFOs were actually asynchronous shift registers, but today almost all FIFOs are based on dual-ported RAMs.
For a detailed description of the dedicated FIFO controller in the Virtex-5 FPGAs, click on
http://www.xilinx.com/support/documentation/user_g
and go to page 138:
Many FPGA designs use block RAMs to implement FIFOs. In the Virtex-5 architecture, dedicated logic in the block RAM enables users to easily implement synchronous or multirate (asynchronous) FIFOs. This eliminates the need for additional CLB logic for counter, comparator, or status flag generation, and uses just one block RAM resource per FIFO. Both standard and first-word fall-through (FWFT) modes are supported.
-
kcmman
- Ken Chapman holds a first class BSc Degree with honours in Electronic and Electrical Engineering from the University of Surrey. Before obtaining his degree, he spent 4 years working in production environments, making precision instruments and working his way through all levels of a small electronics company. He spent 4 years at Racal Radar Defense Systems combining detailed digital design with all aspects of system integration. Ken joined the UK division of Xilinx in 1991, and was instrumental in developing innovative methods of implementing DSP functions in the Xilinx devices. He has filed several patents while at Xilinx, including the 'MULT_AND' gate seen in each Virtex™ and Spartan-II™ device that has made multipliers and other arithmetic functions smaller and faster.
-
peter.a
- Peter Alfke joined Xilinx in 1988 as director of applications engineering. He currently serves as Distinguished Engineer in the Advanced Products Group. He graduated in electronic engineering from the Technical University in Hannover, Germany in 1957. He went on to work in telecom and computer design with LM Ericsson and Litton Industries before moving to California in 1968. He has spent forty years in Applications Engineering with Fairchild, Zilog, AMD, and now Xilinx. He holds more than thirty patents, has authored many application notes, and given worldwide seminars on digital integrated circuits. He is active in the newsgroup comp.arch.fpga.
-
austin.lesea
- Austin graduated from UC Berkeley in 1974 and 1975 with his BS EECS in Electromagnetic (E&M) Theory and MS EECS in Communications and Information Theory. He has worked in the telecommunications field for 20 years designing optical, microwave, and copper- based transmission systems. He developed SONET/SDH GPS-based Timing Systems for 12 of those years. For the last ten years at Xilinx, Austin was in the IC Design department for the Virtex product line. His new role is working for Xilinx Research Labs, where he is looking beyond the present technology issues.
- Package Generated Alpha Particles: They are a Pro...
- Helping the Customer Drive to ‘Zero Defects’
- Targeted Platform Design
- It Is All About Quality
-
The ‘Programma
ble Imperative ’ -
Reliabilit
y - A True Winning Number Generator
- Spring Is Here!
- Happy New Year: Moore, More Moore, and More than ...
- SEU, Not Again!
-
austin.lesea
on:
SEU, Not Again!
- larthe on: Estimating Average Switching Rates
-
fpgasdr
on:
FIFOs, A Tutorial Descriptio
n -
gszakacs
on:
Terminatio
n is Never Easy -
austin.lesea
on:
Power to the PCB!
- tocktock on: Finding Stuff: Part 2
- seamusbleu on: Using Self Scanning Memory for State Machines
- brouhaha on: Finding Stuff
-
kcmman
on:
That Dangerous Asynchronous Reset! - q on: Quadrature Decoding with Resolution Options





