FIFO Implementation | Non-symmetric Aspect Ratios Support | |
---|---|---|
Independent Clocks | Block RAM | ✓ |
Distributed RAM | ||
Built-in (UltraScale Only) | ✓ | |
Common Clock | Block RAM | ✓ |
Distributed RAM | ||
Shift Register | ||
Built-in (UltraScale Only) | ✓ |
Non-symmetric aspect ratios allow the input and output depths of the FIFO to be different. The following write-to-read aspect ratios are supported: 1:8, 1:4, 1:2, 1:1, 2:1, 4:1, 8:1. This feature is enabled by selecting unique write and read widths when customizing the FIFO using the Vivado IP Catalog. By default, the write and read widths are set to the same value (providing a 1:1 aspect ratio); but any ratio between 1:8 to 8:1 is supported, and the output depth of the FIFO is automatically calculated from the input depth and the write and read widths.
din
, dout
and the handshaking
signals for a FIFO with a 1:4 aspect ratio. After four words are written into the FIFO,
empty
is deasserted. Then after a single read operation,
empty
is asserted again.din
, dout
, and the handshaking
signals for a FIFO with an aspect ratio of 4:1. After a single write, the FIFO deasserts
empty
. Because no other writes occur, the FIFO reasserts empty
after four reads.Non-symmetric Aspect Ratio and First-Word Fall-Through
A FWFT FIFO has 2 extra read words available on the read port when compared to a
standard FIFO. For write-to-read aspect ratios that are larger or equal to 1 (1:1,
2:1, 4:1, and 8:1), the FWFT implementation also increases the number of words that
can be written into the FIFO by depth_ratio*2 (depth_ratio = write depth / read
depth). For write-to-read aspect ratios smaller than 1 (1:2, 1:4 and 1:8), the
addition of 2 extra read words only amounts to a fraction of 1 write word. The
creation of these partial words causes the behavior of the prog_empty
and
wr_data_count
signals of the FIFO to differ in behavior than as
previously described.
Programmable Empty
In general, prog_empty
is guaranteed to assert when the number of readable
words in the FIFO is less than or equal to the programmable empty assert threshold.
However, when the write-to-read aspect ratios are smaller than 1 (depending on the
read and write clock frequency) it is possible for prog_empty
to violate
this rule, but only while empty
is asserted. To avoid this condition, set
the programmable empty assert threshold to 3*depth_ratio*frequency_ratio
(depth_ratio
= write depth/read depth and frequency_ratio
=
write clock frequency / read clock frequency). If the programmable empty assert
threshold is set lower than this value, assume that prog_empty
may or can
be asserted when empty
is asserted.
Write Data Count
In general, wr_data_count
pessimistically reports the number of words
written into the FIFO and is guaranteed to never under-report the number of words in
the FIFO, to ensure that you never overflow the FIFO. However, when the
write-to-read aspect ratios are smaller than 1, if the read and write operations
result in partial write words existing in the FIFO, it is possible to under-report
the number of words in the FIFO. This behavior is most crucial when the FIFO is 1 or
2 words away from full, because in this state the wr_data_count
is
under-reporting and cannot be used to gauge if the FIFO is full. In this
configuration, you should use the full
flag to gate any write operation to
the FIFO.