This section describes the behavior of a FIFO write operation and the associated
status flags. When write enable is asserted and the FIFO is not full, data is added to
the FIFO from the input bus (din
) and write acknowledge
(wr_ack
) is asserted. If the FIFO is continuously
written to without being read, it fills with data. Write operations are only successful
when the FIFO is not full. When the FIFO is full and a write is initiated, the request
is ignored, the overflow flag is asserted, and there is no change in the state of the
FIFO (overflowing the FIFO is non-destructive).
almost_full and full Flags
The almost full flag (almost_full
)
indicates that only one more write can be performed before full
is asserted. This flag is active-High and synchronous to the
write clock (wr_clk
).
The full flag (full
) indicates that
the FIFO is full and no more writes can be performed until data is read out. This
flag is active-High and synchronous to the write clock (wr_clk
). If a write is initiated when full
is asserted, the write request is ignored and overflow
is asserted.
Example Operation
The following figure shows a typical write operation. When you assert wr_en
, it causes a write operation to occur on the next
rising edge of the wr_clk
. Because the FIFO is not
full, wr_ack
is asserted, acknowledging a
successful write operation. When only one additional word can be written into the
FIFO, the FIFO asserts the almost_full
flag. When
almost_full
is asserted, one additional write
causes the fifo to assert full
. When a write occurs
after full
is asserted, wr_ack
is deasserted and overflow
is
asserted, indicating an overflow condition. After you perform one or more read
operations, the FIFO deasserts full
, and data can
successfully be written to the FIFO, as is indicated by the assertion of wr_ack
and deassertion of overflow
.