R
LogiCORE™ IP
FIFO Generator v4.3
User Guide
UG175 March 24, 2008
FIFO Generator v4.3 User Guide www.xilinx.com
UG175 March 24, 2008
Xilinx is disclosing this user guide, manual, release note, and/or specification (the "Documentation") to you solely for use in the development
of designs to operate with Xilinx hardware devices. You may not reproduce, distribute, republish, download, display, post, or transmit the
Documentation in any form or by any means including, but not limited to, electronic, mechanical, photocopying, recording, or otherwise,
without the prior written consent of Xilinx. Xilinx expressly disclaims any liability arising out of your use of the Documentation. Xilinx reserves
the right, at its sole discretion, to change the Documentation without notice at any time. Xilinx assumes no obligation to correct any errors
contained in the Documentation, or to advise you of any corrections or updates. Xilinx expressly disclaims any liability in connection with
technical support or assistance that may be provided to you in connection with the Information.
THE DOCUMENTATION IS DISCLOSED TO YOU “AS-IS” WITH NO WARRANTY OF ANY KIND. XILINX MAKES NO OTHER
WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY, REGARDING THE DOCUMENTATION, INCLUDING ANY
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT OF THIRD-PARTY
RIGHTS. IN NO EVENT WILL XILINX BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, EXEMPLARY, SPECIAL, OR INCIDENTAL
DAMAGES, INCLUDING ANY LOSS OF DATA OR LOST PROFITS, ARISING FROM YOUR USE OF THE DOCUMENTATION.
© 2005–2008 Xilinx, Inc. All rights reserved.
XILINX, the Xilinx logo, the Brand Window, and other designated brands included herein are trademarks of Xilinx, Inc. All other trademarks
are the property of their respective owners.
Revision History
The following table shows the revision history for this document.
R
Date Version Revision
04/28/05 1.1 Initial Xilinx release.
8/31/05 2.0 Updated guide for release v2.2, added SP3 to ISE v7.1i, incorporated edits from
engineering specific for this release, including FWFT, and Built-in FIFO flags, etc.
1/11/06 3.0 Updated for v2.3 release, ISE v8.1i.
7/13/06 4.0 Added Virtex-5 support, reorganized Chapter 5, added ISE v8.2i, version to 3.1
9/21/06 5.0 Core version updated to v3.2; support added for Spartan-3A.
2/15/07 6.0 Core version updated to 3.3; Xilinx tools updated to 9.1i.
4/02/07 6.5 Added support for Spartan-3A DSP devices.
8/8/07 6.6 Updated core to v4.1, ISE tools 9.2i, Cadence IUS v5.8.
10/10/07 7.0 Updated core to v4.2, IUS to v6.1, Xilinx trademark references.
3/24/08 8.0 Updated core to v4.3, ISE tools 10.1, ModelSim® v6.3c.
FIFO Generator v4.3 User Guide www.xilinx.com
UG175 March 24, 2008
Preface: About This Guide
Guide Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Typographical. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Online Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 1: Introduction
About the Core. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Recommended Design Experience. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Technical Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Feedback. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
FIFO Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 2: Core Overview
Feature Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Clock Implementation Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Virtex-5 FPGA Built-in FIFO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Virtex-4 FPGA Built-in FIFO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
First-Word Fall-Through. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Memory Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Non-Symmetric Aspect Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Embedded Registers in block RAM and FIFO Macros (Virtex-4 and
Virtex-5 Devices) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Error Correction Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Core Configuration and Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Common Clock: Block RAM, Distributed RAM, Shift Register . . . . . . . . . . . . . . . . . . 21
Common Clock: Virtex-5 or Virtex-4 FPGA Built-in FIFO . . . . . . . . . . . . . . . . . . . . . . 21
Independent Clocks: Block RAM and Distributed RAM . . . . . . . . . . . . . . . . . . . . . . . . 22
Independent Clocks: Built-in FIFO for Virtex-5 or Virtex-4 FPGAs . . . . . . . . . . . . . . . 22
FIFO Generator Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Using Block RAM FIFOs Instead of Built-in FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . 23
FIFO Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Interface Signals: FIFOs With Independent Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Interface Signals: FIFOs with Common Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Chapter 3: Generating the Core
CORE Generator Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
FIFO Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Component Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
FIFO Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Common Clock (CLK), Block RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Common Clock (CLK), Distributed RAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Table of Contents
www.xilinx.com FIFO Generator v4.3 User Guide
UG175 March 24, 2008
R
Common Clock (CLK), Shift Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Common Clock (CLK), Built-in FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Independent Clocks (RD_CLK, WR_CLK), Block RAM . . . . . . . . . . . . . . . . . . . . . . . . . 35
Independent Clocks (RD_CLK, WR_CLK), Distributed RAM . . . . . . . . . . . . . . . . . . . . 35
Independent Clocks (RD_CLK, WR_CLK), Built-in FIFO. . . . . . . . . . . . . . . . . . . . . . . . 35
Performance Options and Data Port Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Read Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Standard FIFO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
First-Word Fall-Through FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Built-in FIFO Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Read/Write Clock Frequencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Data Port Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Write Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Write Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Read Width. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Read Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Implementation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Error Correction Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Use Embedded Registers in Block RAM or FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Optional Flags, Handshaking, and Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Optional Flags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Almost Full Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Almost Empty Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Handshaking Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Write Port Handshaking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Read Port Handshaking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Initialization and Programmable Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Reset Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Use Dout Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Programmable Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Programmable Full Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Programmable Empty Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Data Count. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Data Count Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Use Extra Logic For More Accurate Data Counts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Data Count (Synchronized With Clk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Write Data Count* (Synchronized with Write Clk). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Read Data Count* (Synchronized with Read Clk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Chapter 4: Designing with the Core
General Design Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Know the Degree of Difficulty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Understand Signal Pipelining and Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Synchronization Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Initializing the FIFO Generator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
FIFO Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Independent Clocks: Block RAM and Distributed RAM . . . . . . . . . . . . . . . . . . . . . . . . 47
Independent Clocks: Built-in FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Common Clock: Built-in FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Common Clock FIFO: Block RAM and Distributed RAM . . . . . . . . . . . . . . . . . . . . . . . 50
FIFO Generator v4.3 User Guide www.xilinx.com
UG175 March 24, 2008
R
Common Clock FIFO: Shift Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
FIFO Usage and Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Write Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
ALMOST_FULL and FULL Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Example Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Read Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
ALMOST_EMPTY and EMPTY Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Modes of Read Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Handshaking Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Write Acknowledge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Valid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Example Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Underflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Overflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Example Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Programmable Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Programmable Full . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Programmable Empty. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Data Counts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Data Count (Common Clock FIFO Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Read Data Count (Independent Clock FIFO Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Write Data Count (Independent Clock FIFO Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
First-Word Fall-Through Data Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Example Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Non-symmetric Aspect Ratios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Non-symmetric Aspect Ratio and First-Word Fall-Through . . . . . . . . . . . . . . . . . . . . . 70
Embedded Registers in block RAM and FIFO Macros
(Virtex-4 and Virtex-5 FPGAs). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Standard FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Block RAM Based FWFT FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Built-in Based FWFT FIFOs (Common Clock Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Built-in Error Correction Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Reset Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Asynchronous Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Synchronous Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Actual FIFO Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Block RAM, Distributed RAM and Shift RAM FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Virtex-5 FPGA Built-In FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Virtex-4 FPGA Built-In FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Non-Built-in FIFOs: Common Clock and Standard Read Mode Implementations . . 79
Non-Built-in FIFOs: Common CLock and FWFT Read Mode Implementations . . . . 81
Non-Built-in FIFOs: Independent Clock and Standard
Read Mode Implementations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Non-Built-in FIFOs: Independent Clock and FWFT Read Mode Implementations . 83
Virtex-5 FPGA Built-in FIFOs: Common Clock and Standard
Read Mode Implementations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Virtex-5 FPGA Built-in FIFOs: Common Clock and FWFT
Read Mode Implementations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Virtex-5 FPGA Built-in FIFOs: Independent Clocks and Standard
Read Mode Implementations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Virtex-5 FPGA Built-in FIFOs: Independent Clocks and FWFT
Read Mode Implementations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88