Non-symmetric Aspect Ratios - 1.0 English - PG327

Embedded FIFO Generator LogiCORE IP Product Guide (PG327)

Document ID
PG327
Release Date
2023-05-16
Version
1.0 English
The following table identifies support for non-symmetric aspect ratios.
Table 1. Implementation-specific Support for Non-symmetric Aspect Ratios
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.

For non-symmetric aspect ratios, the full and empty flags are active only when one complete word can be written or read. The FIFO does not allow partial words to be accessed. For example, assuming a full FIFO, if the write width is 8 bits and read width is 2 bits, you would have to complete four valid read operations before full deasserts and a write operation accepted. Write data count shows the number of FIFO words according to the write port ratio, and read data count shows the number of FIFO words according to the read port ratio.
Note: For non-symmetric aspect ratios where the write width is smaller than the read width (1:8, 1:4, 1:2), the most significant bits are read first as shown in the following figures.
The following figure is an example of a FIFO with a 1:4 aspect ratio (write width = 2, read width = 8). In this figure, four consecutive write operations are performed before a read operation can be performed. The first write operation is 01, followed by 00, 11, and finally 10. The memory is filling up from the left to the right (MSB to LSB). When a read operation is performed, the received data is 01_00_11_10.
Figure 1. 1:4 Aspect Ratio: Data Ordering
The following figure shows 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.
Figure 2. 1:4 Aspect Ratio: Status Flag Behavior
The following figure shows a FIFO with an aspect ratio of 4:1 (write width of 8, read width of 2). In this example, a single write operation is performed, after which four read operations are executed. The write operation is 11_00_01_11. When a read operation is performed, the data is received left to right (MSB to LSB). As shown, the first read results in data of 11, followed by 00, 01, and then 11.
Figure 3. 4:1 Aspect Ratio: Data Ordering
The following figure shows 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.
Figure 4. 4:1 Aspect Ratio: Status Flag Behavior

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.