Quartus与vivado fifo IP核需要额外注意的几个点

使用 Quartus与vivado fifo IP核需要额外注意的几个点

IP different input and output width

Quartus fifo different input and output width

Writing 16-bit Words and Reading 8-bit Words

This figure shows an example of a wide write port (16-bit input) and a narrow read port (8-bit output).
在这里插入图片描述
In this example, the read port is operating at twice the frequency of the write port. Writing two 16-bit words to the FIFO buffer increases the wrusedw flag to two and the rusedw flag to four. Four 8-bit read operations empty the FIFO buffer. The read begins with the least-significant 8 bits from the 16-bit word written followed by the mostsignificant 8 bits.

Writing 8-Bit Words and Reading 16-Bit Words

This figure shows an example of a narrow write port (8-bit input) with a wide read port (16-bit output).
在这里插入图片描述
In this example, the read port is operating at half the frequency of the write port. Writing four 8-bit words to the FIFO buffer increases the wrusedw flag to four and the rusedw flag to two. Two 16-bit read operations empty the FIFO. The first and second 8-bit word written are equivalent to the LSB and MSB of the 16-bit output words, respectively. The rdempty signal stays asserted until enough words are written on the narrow write port to fill an entire word on the wide read port.

Vivado fifo ip different input and output width

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.

Writing 8-bit Words and Reading 2-bit Words

This is an example of 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.
在这里插入图片描述
This is an example which 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.
在这里插入图片描述

Writing 2-bit Words and Reading 8-bit Words

This 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.
在这里插入图片描述
This is an example which 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.
在这里插入图片描述

从上面的的官方文档说明,两家的fifo IP 核不同位宽读写数据的数据填充方式是相反的.
简单来说:

  • 大位宽写入,小位宽读出: altera FPGA先从被写入数据的低位部分开始取数,xilinx FPGA先从被写入数据的高位部分开始取数
  • 小位宽写入,大位宽读出:altera FPGA会从被读取数据的低位开始填充,xilinx FPGA则会会从被读取数据的高位开始填充.

复位问题

Quartus FIFO sclr 信号

Quartus FIFO Synchronous Clear and Asynchronous Clear Effect

The FIFO Intel FPGA IP core supports the synchronous clear (sclr) and asynchronous clear (aclr) signals, depending on the FIFO modes.The effects of these signals are varied for different FIFO configurations. The SCFIFO supports both synchronous and asynchronous clear signals while the DCFIFO support asynchronous clear signal and asynchronous clear signal that synchronized with the write and read clocks.

Synchronous Clear and Asynchronous Clear in the SCFIFO

在这里插入图片描述

  • The read and write pointers reset to zero upon assertion of either the sclr or aclr signal.
  • The first data word shown after the reset is not a valid Show-ahead data. It reflects the data where the read pointer is pointing to because the q output is not registered. To obtain a valid show-ahead data, perform a valid write after the reset.
Asynchronous Clear in DCFIFO

在这里插入图片描述

  • The wrreq signal must be low when the DCFIFO comes out of reset (the instant when the aclr signal is deasserted) at the rising edge of the write clock to avoid a race condition between write and reset. If this condition cannot be guaranteed in your design, the aclr signal needs to be synchronized with the write clock. This can be done by setting the Add circuit to synchronize ‘aclr’ input with ‘wrclk’ option from the FIFO parameter editor, or setting the WRITE_ACLR_SYNCH parameter to ON.
  • Even though the aclr signal is synchronized with the write clock, asserting the aclr signal still affects all the status flags asynchronously.
  • Even though the aclr signal is synchronized with the read clock, asserting the aclr signal affects all the status flags asynchronously.
  • For Stratix and Cyclone series, the DCFIFO only supports registered q output in Normal mode,and unregistered q output in Show-ahead mode. For other devices, you have an option to register or unregister the q output (regardless of the Normal mode or Show-ahead mode) in the FIFO parameter editor or set through the ADD_RAM_OUTPUT_REGISTER parameter.

xilinx fifo Resets

Synchronous Reset

The synchronous reset (srst) synchronously resets all counters, output registers and memories when asserted. Because the reset pin is synchronous to the input clock and there is only one clock domain in the FIFO, no additional synchronization logic is necessary.
image

  • For FIFOs built with First-Word-Fall-Through and ECC configurations, the sbiterr and dbiterr may be high until a valid read is performed after the de-assertion of both wr_rst and rd_rst.
Asynchronous Reset

The asynchronous reset (rst) input asynchronously resets all counters, output registers,and memories when asserted. When reset is implemented, it is synchronized internally to the core with each respective clock domain for setting the internal logic of the FIFO to a known state. This synchronization logic allows for proper timing of the reset logic within the core to avoid glitches and metastable behavior.

Note: If the asynchronous reset is one slowest clock wide and the assertion happens very close tothe rising edge of slowest clock, then the reset detection may not happen properly causingunexpected behavior. To avoid such situations, it is always recommended to have the asynchronous reset asserted for at least 3 or C_SYNCHRONIZER_STAGE (whichever is maximum) slowest clock cycles, though this guide talks about one clock wide reset at some places.
FIFO Asynchronous Reset Timing With Safety Circui
image
image

Asynchronous Reset Values for Block, Distributed, and Shift RAM FIFOs

在这里插入图片描述
When reset is asserted, the full flags are asserted to prevent writes to the FIFO during reset.

总结:

  • INTEL FPGA的FIFO的clr信号 或者xilinx 家的FIFO的 reset信号在同步fifo 或者异步FIFO中的使用都有一定的时序要求。具体使用时序要求回顾上述内容或者阅读相关官方文档
  • 使用建议:一般情况下,不管使用同步fifo 还是异步fifo时,复位信号 (INTEL FPGA的FIFO的aclr信号 或者xilinx 家的FIFO的 reset信号)都在相应的(慢)时钟下置位8个时钟单元,之后再过60个相应的(慢)时钟单元后,再对fifo进行使用。当然,这样可以做到一套代码对同步fifo ,异步fifo 都起作用。

分享不易,看完点个赞呗。

参考

FIFO Intel® FPGA IP User Guide:ug_fifo.pdf
Xilinx FIFO Generator v13.2:pg057-fifo-generator

  • 5
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
### 回答1: Quartus FIFO IP核用于实现先进先出(FIFO)功能的设计。它可以存储一系列数据并保证按照它们被写入到FIFO中的顺序依次读取。Quartus FIFO IP核在许多数字系统设计中应用广泛,比如数据缓存、视频图像缓冲、有限状态机和数据流控制等方面。 ### 回答2: Quartus是一种FPGA设计软件,其可以方便地构建和设计FPGA芯片。在FPGA设计中有许多经典的模块,其中之一就是FIFO(First-In-First-Out,先进先出)模块。在Quartus中,我们可以调用FIFO IP核来创建一个FIFO模块。 第一步骤,我们需要打开Quartus软件,并创建一个FIFO IP核。打开Quartus,在工程管理器中右键单击Design,然后选择“New”,此时弹出“New Project Wizard”对话框,我们可以创建一个所需的工程管理器模板。 第二步是在新的工程中添加FIFO IP核。首先,单击工具栏中的“Library”按钮,然后选择“New Library”。接着,打开“IP Catalog”(IP目录),选择“On-chip Modules(OCMs)”,然后选择模块的类型,并将其拖到新的工程中。 第三步是设置FIFO IP核的属性。我们可以通过右键单击FIFO IP核,选择“Properties”(属性)来设置它的属性(如深度、宽度、时钟频率等)。在设置这些属性时,我们应该仔细考虑所需的FIFO特性以及目标FPGA的规格。 第四步骤涉及到设计代码。我们需要FIFO IP核添加到设计通过添加相应例化代码。这将告诉Quartus将生成的IP核用于设计中。一旦代码添加完毕,我们就可以对FIFO进行仿真和验证。 最后一步是实现。Quartus会将设计实现到FPGA上,并将FIFO模块加载到FPGA中。一旦实现成功,我们就可以通过GUI或者其他接口与FIFO交互。 总之,我们可以通过调用QuartusFIFO IP核来轻松地创建FIFO模块。需要注意的是,在设置FIFO的属性和设计代码时需仔细考虑目标FPGA的规格,以避免出现错误和不兼容问题。 ### 回答3: Quartus是目前最流行的FPGA设计软件之一,它广泛应用于电子设计自动化(EDA)领域,在FPGA设计中拥有极高的知名度和使用率。其中,FIFO IP核Quartus中一个非常常用的模块,它用于实现FIFO缓冲器,其优势在于具有存储容量大、数据读写速度快等特,可以有效地改善数据传输的稳定性和效率。 使用Quartus中的FIFO IP核并不复杂。首先,在Quartus软件的工程管理器中打开自己的工程,在该工程的设计中添加FIFO IP核模块。在添加FIFO IP核模块的时候,需要设置FIFO的各种参数,比如:存储深度、读写接口宽度、时钟速率等。这些参数可以根据实际需求进行调整,以满足具体项目的要求。 接着,将FIFO IP核模块的输入接口和输出接口正确地连接到其他模块中。一般来说,FIFO IP核模块的输入和输出都要连接到一个时钟模块,以确保数据的同步传输。此外,还需要将其他模块的数据信号连接到FIFO IP核模块的输入端口,以实现数据的写入;将FIFO IP核模块的输出端口连接到其他模块的数据输入端口,以实现数据的读取。在连接模块配置完成后,需要根据具体的项目要求,进行特定的数学计算和综合分析,以确保整个设计的正确性和可行性。 最后,实现对Quartus中的FIFO IP核的验证工作。验证是FIFO IP核FPGA系统中正常运行的必要条件,需要对设计的FIFO IP核模块进行仿真和调试等工作,以便最终得到FIFO的功效和最优的性能。当验证通过后,即可生成需要的bit文件,将其下载到目标FPGA芯片中,从而使整个设计工程得以运行及完美工作。 总而言之,在FIFO IP核的设计和调用过程中,需要考虑到多个因素,包括参数设置、模块连接、信号配置、仿真验证等,才能够成功实现系统设计的目标。因此,对于需要FPGA系统中使用FIFO缓冲器的应用,建议根据实际需要,结合个人的应用场景以及项目需求进行全面综合考虑,并通过不断地实践和优化,实现最佳效果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值