Understanding Synchronous Fifos: Author: Cypress Associated Part Family
Understanding Synchronous Fifos: Author: Cypress Associated Part Family
AN1042 gives a brief introduction of the features and functionalities provided by synchronous FIFOs. The application
note also discusses width and depth expansion of synchronous FIFOs.
1 Introduction
Synchronous FIFOs are the ideal choice for high-performance systems due to high operating speed. Synchronous
FIFOs also offer many other advantages that improve system performance and reduce complexity. These include
status flags: synchronous flags, half-full, programmable almost-empty and almost-full flags. These FIFOs also include
features such as, width expansion, depth expansion, and retransmit. Synchronous FIFOs are easier to use at high
speeds because they use free-running clocks to time internal operations whereas asynchronous FIFOs require read
and write pulses to be generated without an external clock reference.
2 Scope
This application note gives an overview of the architecture of synchronous FIFOs and discusses key features, usage
guidelines, and typical applications.
This application note does not discuss features of individual Cypress sync FIFO devices but provides a general
overview. For information on individual devices, review the associated device datasheet on the Cypress website
(www.cypress.com).
3.1 Reset
After power-up, the FIFO must be reset. Resetting the part sets the read and write address pointers to zero, clears
the output data register, and sets the status flags to represent an empty device. The device is reset by asserting the
RS pin LOW. Synchronous FIFOs require a falling edge on RS. This allows devices, such as processor supervisory
chips, to drive RS directly. These devices assert reset as VCC ramps and hold it LOW for a minimum time to allow VCC
and all clocks to stabilize.
During RS assertion, read or write operations should not be attempted to the part. This can be done by deasserting
the read and write enables (REN, WEN), or by gating both RCLK and WCLK to a low state. Write and read operations
must also be disabled until the reset recovery time expires tRSR after the deassertion (rising) edge of RS.
Note Reset is an asynchronous operation and does not require transitions of WCLK and RCLK to complete.
The empty flag (EF) and full flag (FF) are synchronous flags, meaning they are synchronized to their respective
clocks. The empty flag (EF) is synchronized to the read clock (RCLK) and the full flag (FF) is synchronized to the write
clock (WCLK). Synchronizing the flag to the respective clock eliminates the need for external synchronization. Most
often, the logic that writes to a FIFO must ensure that the FIFO is not full before writing. Similarly, the read control
logic examines the empty flag (EF) before reading from the FIFO. The programmable almost-empty (PAE) and
programmable almost-full (PAF) flags are synchronous on the CY7C42x1 FIFOs. The PAE flag is synchronized to
RCLK and the PAF flag is synchronized with WCLK. Other FIFOs, such as the CY7C42x5, permit synchronous and
asynchronous operation of the programmable flags using the SMODE control signal. For more information on
programming PAE and PAF flags and flag operation, refer to the device datasheets on the Cypress website
(www.cypress.com).
The half full flag (HF) is asynchronous because it is not determined whether this flag will be used by the read and
write control logic.
For applications that do not use free-running clocks, the RCLK must transition from LOW to HIGH twice to read out
the first word - once for the “flag update cycle” and the second edge to read out the first word.
Note The flag update cycle occurs on both the empty and full boundaries. There are no “flag update cycles”
associated with the PAE and PAF flags.
Figure 2. Flag Update Cycle[1]
4 Retransmit
The retransmit feature is used to reread a block of data from the FIFO that was previously read. This feature is
commonly used in serial communications interfaces. If an error occurs during transmission of data, the packet can be
retransmitted from the FIFO and consequently resent through the serial media.
The retransmit feature is accessed through pulsing of the retransmit (RT) pin of the FIFO. By driving the RT pin LOW,
the read address pointer of the FIFO is set to the physical location, zero. Figure 3 shows the retransmit operation.
Note that for the retransmit feature to operate correctly, the FIFO must first be reset before data is written to the FIFO
that might be retransmitted.
Here is an example. Let us say you want to send a 1-K deep packet of data to another board. The data can be
written to a FIFO and passed to a serial transceiver, which sends the data through a serial media. The FIFO is first
reset, setting the read and write address pointers in the FIFO to location zero. 1-K data words are written to the FIFO.
EF is deasserted and the serial transceiver device begins reading from the FIFO.
As data is read from the FIFO, the read address pointer increments until it reaches location 1024 and the FIFO
becomes empty. Note that although the data has been read from the FIFO, the data is not erased from the FIFO. If a
problem occurs at any point during the read process, the RT pin can be pulsed setting the read address pointer back
to location zero, and the packet of data can be resent to its destination. This process can be repeated indefinitely.
1
When tSKEW2 > minimum specification, tFRL (maximum) = tCLK + tSKEW2. When tSKEW2 < minimum specification, tFRL
(maximum) = either (2 × tCLK + tSKEW2) or (tCLK + tSKEW2). The Latency Timing applies only at the Empty Boundary ( EF =
LOW).
Note that the RT pin does nothing more than reset the read address pointer to location zero. The FIFO does not know
where certain packets of your data are stored in the device. You must reset the device before a packet is written that
may need retransmitting.
At any time during normal FIFO operation, or any time after the RT pin has been deasserted, the FIFO can perform
both read and write transactions normally. No read or write operations may be performed during assertion of RT.
Note Retransmit is an asynchronous operation and does not require transition on the RCLK or WCLK to operate.
Figure 3. FIFO Operation on Retransmit
Write Pointer
CY7C42x1/ CY7C42x1/
CY7C42x5 CY7C42x5
Read Pointer
CY7C42x1/ CY7C42x1/ CY7C42x1/
CY7C42x5 CY7C42x5 CY7C42x5
Read Pointer
Read Pointer
RT on FIFO Operation - Flag Status on RT
FIFO Read Operation Read Pointer moves to Operation
/EF = 1 Physical Zero Location /EF = 1
/FF = 1 /EF = 1 /FF = 0
/RT = 1 /FF = 1 /RT = 0
/RT = 0
5 Expansion Configurations
5.1 Width Expansion
Width expansion is used to create FIFOs with wider data paths. Two ×18 FIFOs can be width-expanded to create
a ×36 FIFO, and so on. Read, write, and retransmit operations are the same for FIFOs in width expansion, and, in
fact, the FIFO has no knowledge that it is used in this mode.
To expand multiple FIFOs in width, the flags must be combined to create “composite flags”. This is done by
externally ANDing flags between each of the FIFOs.
Composite flags must be generated for both the empty and full flags. By combining the flags, this insures that the
FIFOs stay synchronized (each contain the same number of words.) See Figure 4.
We must first understand how the width-expanded FIFOs can lose their synchronization. The root of this problem
lies with the asynchronous relationship of the clocks, RCLK and WCLK. Consider an example where two FIFOs
a r e width-expanded and each FIFO has one word in it (one location from empty). Due to the asynchronous phase
relationship between the read and write clocks, it is possible that the FIFOs will receive both a read and write
operation almost simultaneously. If the read operation is performed first, the part becomes empty just before a
word is written to it. At this point, the device is waiting for a flag update cycle and one read cycle is essentially lost.
In the other case, if the write operation occurs just before the read, the device has two words in it for a quick instance
and then returns to having one word. Note that no flag update cycle is needed because the FIFO never became
empty.
The width-expanded FIFOs may respond differently to this scenario and, therefore, may lose synchronization. Small
clock skew and even device process variations can cause one FIFO to see the read operation first while others may
see the write first. As one or more of the devices require a flag update cycle the FIFOs are now out of
synchronization.
By combining the empty flags of the FIFOs to create a composite empty flag, the read enable (REN) can be
deasserted in the event that any of the FIFOs become empty. As long as the REN is deasserted for at least one clock
cycle, all empty FIFOs get the flag update cycle they require and the FIFOs stay synchronized.
Note the same idea applies to the full flag at the full boundary. The control logic that drives REN and WEN should
deassert these enables in the event that one of the composite flags becomes asserted.
Figure 4. Width Expansion of Synchronous FIFOs (CY7C42x5)
Composite empty and full flags must be generated for proper operation. Composite flags are generated by externally
ORing the flags of all FIFOs in the token passing chain. This ensures that all FIFOs must be full before the
composite full flag asserts. Similarly, all FIFOs must be empty for the composite empty flag to assert. The PAE, PAF,
and HF flags are not used in the depth expansion mode. Although each of these flags will be a correct indication of
the number of words in a particular FIFO, generating composites of these flags provide information about the overall
state of the depth expanded FIFO buffer.
Depth expansion can also be performed on FIFOs that do not have depth-expansion logic on chip. A ping-pong
approach is used to alternately write and read data from multiple FIFOs. Writes are performed by rotating each
transaction between devices. In a scenario where two FIFOs are depth-expanded, the first write is written to FIFO#1,
the second write to FIFO#2, the third write to FIFO#1, and so on. Read operations are handled in the same manner.
FIFOs find use in set-top box for HDTV/IPTV. It controls the dataflow between the main CPU, which performs MPEG
encoding/decoding, in addition to audio processing and the CPLD, which is a communication processor capturing an
incoming signal.
A common scenario of asymmetric bus speeds occurs in the case of data acquisition equipment where multiple
boards that operate at different local bus frequencies need to exchange data with each other, or with a master
controller using a higher system bus speed. FIFOs enable this operation through their ability to use two different
clocks for input and output. This enables synchronization of data flow to the local bus frequency. This feature results
from the use of dual-port memory cells that allow unconstrained simultaneous access from two independent ports.
FIFOs are widely used in inter-processor communication, to pass data between processors running at different
speeds without incurring excessive wait state penalties. FIFOs are also used to buffer sequential data, such as
video/voice and data packets in telecommunication systems.
FIFOs are differentiated from dual-port memories by the lack of addressing capability. FIFOs, true to their name, are
data buffers that only support sequential access and hence, eliminate the need for external addressing. This results
in reduced complexity, pin count, and board space.
7 Summary
Synchronous FIFOs ideally suited to transfer data between systems operating at different speeds or using
unsynchronized clock sources. They support high-speed operation of 100 MHz and can be used in the synchronous
mode by tying the clock inputs to free-running clocks for optimum speed. They can also be used as asynchronous
FIFOs by pulsing the clock inputs for easy integration to designs, which expect asynchronous FIFOs. Features, such
as retransmit and synchronous flags, make the devices versatile and easier to use. These FIFOs can also be
cascaded together in width or depth to create FIFO configurations, not available in single devices. Hence, Cypress’s
synchronous FIFOs are ideal for buffering and synchronizing data in high-performance applications.
Document History
Document Title: AN1042 - Understanding Synchronous FIFOs
Document Number: 001-19979
** 1409104 ADMU 08/23/2007 Obtain spec# for note to be added to spec system. This note had no technical
updates. Kindly replace existing .pdf file on cypress.com
*A 3075539 ADMU 11/02/2010 Added Abstract.
Removed information about parts which are obsolete. Minor edits and updated in new
template.
*B 3124837 ADMU 01/20/2011 Created hyperlinks for the application notes references in this spec.
*C 3561632 ADMU 03/26/2012 Updated template.
Minor text edits.
Removed Decoupling and Clock Termination sections.
*D 4197417 SMCH 11/20/2013 Updated the applications for synchronous FIFOs.
Added figure 4.
*E 5536200 NILE 11/29/2016 Updated template
*F 5848814 GNKK 07/31/2017 Updated the Cypress logo and copyright notice.
Products
ARM® Cortex® Microcontrollers cypress.com/arm
PSoC® Solutions
Automotive cypress.com/automotive PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP | PSoC 6
All other trademarks or registered trademarks referenced herein are the property of their respective owners.
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
© Cypress Semiconductor Corporation, 2007-2017. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including
Spansion LLC (“Cypress”). This document, including any software or firmware included or referenced in this document (“Software”), is owned by
Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such
laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other
intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with
Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to
sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for
use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end
users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of
Cypress’s patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for
use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited.
TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD
TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to
make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or
circuit described in this document. Any information provided in this document, including any sample design information or programming code, is
provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and
safety of any application made of this information and any resulting product. Cypress products are not designed, intended, or authorized for use as
critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or
systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances
management, or other uses where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”). A
critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or
system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim,
damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and
against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of
Cypress products.
Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, WICED, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are
trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit
cypress.com. Other names and brands may be claimed as property of their respective owners.