2001mar28 Mem CT An1 PDF
2001mar28 Mem CT An1 PDF
2001mar28 Mem CT An1 PDF
Introduction
Synchronous FIFOs have quickly become the FIFOs of
choice for new designs. This movement to synchronous
FIFOs from their asynchronous predecessors is due mainly
to speed and ease of operation. However, there are also
many other advantages which these devices bring such as
synchronous flags, programmable almost empty and almost
full flags, depth expansion, and retransmit. Synchronous
FIFOs are easier to use at high speeds since they can be
operated by free running clocks. Asynchronous FIFOs required read and write pulses to be generated as data is
moved through the part, and generating these pulses is difficult to do at high speed. Synchronous FIFOs can be used just
as their asynchronous counterparts by tying the read and
write strobes to the RCLK and WCLK lines respectively. This
makes migration to synchronous FIFOs very easy, even for
designers who are mostly familiar with asynchronous FIFOs.
Scope
Due to the large number of synchronous FIFOs available from
Cypress, this application note will not discuss features of individual part numbers, but rather discuss the general operation of and the features available with these devices. The data
sheets should be referenced for a specific device to determine which of the features discussed below are supported by
that device.
Applications for Synchronous FIFOs
A FIFOs largest benefit is its ability to pass data between two
data buses that are asynchronous from each other. This includes buses running at different rates as well as buses that
are running at the same rate, but whose clock is generated
from different sources. Although two crystals may be labeled
with the same value, small variations in the crystals cause
them to oscillate at slightly different rates.
Often when data is passed between two boards, each board
is operating from a different crystal. Incoming data must be
synchronized to the local clock before it is usable. By passing
that data through a FIFO, the synchronization is done automatically. This synchronization is possible since the FIFOs
are built from dual ported memory cells. Dual ported memory
cells allow unconstrained simultaneous access through both
ports without any timing restrictions.
In many board to board communication schemes, error
checking is done to insure proper transmission. Synchronous
FIFOs have a retransmit feature which allows the board which
is sending the data to re-send or retransmit the data when
an error occurs.
Another popular use for FIFOs is interprocessor communication. Often processors run at different bus rates, so passing
data through a FIFO allows each processor to burst data into
and out of the FIFO at their maximum speeds.
FIFOs have no address lines, which saves pin count and
therefore board space. Because of this, FIFOs are often used
to buffer sequential data such as video or voice. Telecommunication and datacommunication information possesses this
sequential ordering as well. Often FIFOs are used on the front
end of each network port to synchronize incoming network
packets.
San Jose
CA 95134
408-943-2600
January 1995
D 017
INPUT
REGISTER
WCLK
WEN
FLAG
PROGRAM
REGISTER
WRITE
CONTROL
DUAL
PORT
WRITE
POINTER
RS
RAM
ARRAY
PAE
PAF
SMODE
READ
POINTER
RESET
LOGIC
FL/RT
WXI
WXO/HF
RXI
RXO
FF
EF
FLAG
LOGIC
EXPANSION
LOGIC
THREESTATE
OUTPUT REGISTER
READ
CONTROL
OE
Q017
RCLK
REN
Note: Reset is an asynchronous operation and does not require transitions of WCLK or RCLK to complete.
Status Flags
Status flags such as the empty flag, programmable almost
empty flag, half full flag, programmable almost full flag, and
full flag (EF, PAE, HF, PAF, FF) are used to determine the
number of words in the FIFO. These flags are generated by
comparing the values in the read and write address pointers.
These flags should be used by control logic to determine if
read or write operations are to be performed to the FIFO. The
flag logic in the FIFO also inhibits reading from an empty FIFO
and writing to a full FIFO. When reading an empty FIFO the
outputs will always show that last valid data read from the
device. Writes to a full FIFO are discarded.
The half full flag (HF) is asynchronous since its not determined whether this flag will be used by the read or write control logic.
Flag Update Cycle
Since the empty and full flags are synchronous, they require
a rising edge on their respective clock to update them to their
out the first word. Once for the flag update cycle, and the
second to read out the first word.
Note: The flag update cycle occurs on both the empty and full
boundaries. Also, there are no flag update cycles associated with the PAE and PAF flags.
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.
For example, lets say we have an empty FIFO. After you write
one word into the part it is no longer empty. Since the empty
flag (EF) is synchronized to the read clock, the flag will not be
asserted until the part receives a RCLK rising edge. No read
operations are performed to the device until after the EF is
deasserted (the first RCLK rising edge updates the flags and
the second RCLK rising edge reads the first word out). This
dead cycle insures that the assertion and deassertion of the
empty flag (EF) will always be at least one cycle long. Under
asynchronous conditions of the RCLK and WCLK (very common for FIFO applications), the flag assertion could be infinitely small without this dead cycle. See Figure 2.
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 physical location
zero. Note in order for the retransmit feature to operate correctly, the FIFO must first be reset before data is written to the
FIFO that might be retransmitted.
Heres an example. Lets say you have a 1K deep packet of
data that you want to send 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. The 1K words of data are then written to the
FIFO. Once writing to the FIFO begins and the EF deasserts
the serial transceiver device can begin reading from the FIFO.
For applications that use free running clocks, this dead cycle
or flag update cycle is transparent and of no concern. The
read control logic will not assert the read enable (REN) until
the empty flag (EF) deasserts. The first rising edge of RCLK
after REN is asserted will read the first word from the FIFO.
For applications which do not use free running clocks. The
RCLK will have to transition from LOW to HIGH twice to read
Empty Flag Timing
WCLK
tDS
tDS
D0
D0 D17
tENS
D1
tENH
tENS
tENH
WEN
tFRL[1]
tFRL[1]
RCLK
tSKEW2
tREF
tREF
tREF
tSKEW2
EF
REN
OE
tA
D0
Q0 Q17
FLAG UPDATE
CYCLE
FIRST READ
CYCLE
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).
As data is read from the FIFO the read address pointer increments until it reaches location 1024 and the FIFO becomes
empty. Note, 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.
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. Control logic which drives the REN and
WEN should deassert these enables in the event that one of
the composite flags becomes asserted.
To expand multiple FIFOs in width, the flags must be combined to create composite flags. This is done by ANDing
flags between each of the FIFOs. Composite flags must be
generated for both the empty and full flags. By combining the
RESET (RS)
DATA IN (D) 36
RESET (RS)
18
18
WRITECLOCK (WCLK)
WRITEENABLE (WEN)
OUTPUTENABLE (OE)
LOAD (LD)
PROGRAMMABLE(PAE)
HALF FULL FLAG (HF)
FF
FULL FLAG (FF)
7C4425
7C4205
7C4215
7C4225
7C4235
7C4235
FL WXI
7C4425
7C4205
7C4215
7C4225
7C4235
7C4235
FF
EF
RXI
FL WXI
18
PROGRAMMABLE(PAF)
18
36
Depth Expansion
pulse is driven on the WXO pin. The WXO pin of the first
device is tied to the WXI pin of the next device which sees the
expansion pulse and takes responsibility for performing subsequent write operations. Likewise when the read address
pointer reaches its maximum value, it passes a token via the
RXO, to the RXI pin of the next device. See Figure 4 for a
diagram of depth expansion configuration of the CY7C42x5
FIFOs.
WXO RXO
7C4425
7C4205
7C4215
7C4225
7C4235
7C4235
VCC
FIRSTLOAD (FL)
FF
EF
PAE
PAF
WXI RXI
WXO RXO
7C4425
7C4205
7C4215
7C4225
7C4235
7C4235
DATA IN (D)
VCC
FIRSTLOAD (FL)
DATAOUT (Q)
FF
EF
PAE
PAF
WXI RXI
WRITECLOCK (WCLK)
WXO RXO
RESET(RS)
LOAD (LD)
FF
FF
PAF
EF
EF
PAFWXI RXIPAE
PAE
FIRSTLOAD (FL)
Figure 4. Depth Expansion of Synchronous FIFOs (CY7C42x5)
Decoupling
Decoupling capacitors are used to provide instantaneous current required by CMOS devices. In general it is good practice
to have one decoupling cap per VCC pin of the device. The
Cypress Semiconductor Corporation, 1997. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use
of any circuitry other than circuitry embodied in a Cypress Semiconductor product. Nor does it convey or imply any license under patent or other rights. Cypress Semiconductor does not authorize
its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress
Semiconductor products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress Semiconductor against all charges.