异步 FIFO 控制器 (Asynchronous FIFO Controller)
FIFO 是设计中常用的器件,用于跨时钟域的数据传送。一般从厂家库中直接调用即可,是不需要自己设计的。 但学习和理解 FIFO 设计方法,对于理解跨时钟域异步信号的处理方法很有帮助。
项目地址:Laotzu
经典 FIFO 设计方法(见参考文档) 参数化数据宽度和 FIFO 深度 增强的同步数据有效指示 增强的首数据预读加速功能(可关闭)
Name | I/O | Description |
---|---|---|
w_rst_n | I | Reset in write-side1 is normal0 is reset |
w_clk | I | Clock in write-side |
w_en | I | Write enable1 is write0 is NOP |
w_full | O | 1 is FIFO full |
w_error | O | Error in write-side1 is error0 is normal |
w_counter [] | O | FIFO counter in write-side |
r_rst_n | I | Reset in read-side1 is normal0 is reset |
r_clk | I | Clock in read-side |
r_en | I | Read enable1 is read0 is NOP |
r_valid | O | 1 is data valid in read-side |
r_error | O | Error in read-side1 is error0 is normal |
r_counter [] | O | FIFO counter in read-side |
w_ram_addr [] | O | Write address for dual-port RAM |
w_ram_en | O | Write enable for dual-port RAM1 is enable0 is disable |
r_ram_addr [] | O | Read address for dual-port RAM |
r_ram_en | O | Read enable for dual-port RAM1 is enable0 is disable |
Name | Description |
---|---|
FWFTEN | First Word PRe-read enable1 is enable0 is disable |
ADDRWIDTH | Address bus width |
FIFODEPTH | FIFO depth |
比较下面两种情况下的时序,在 FWFTEN = 1 的情况,FIFO 从空到有数据的时候不用等到 r_en 有效,其第一个数据 (D0) 就被自动读出。相对于 FWFTEN = 0 的情况,r_valid 指示信号提前了,这样可以加快 FIFO 的吞吐率。
FWFT = 0 的情况
FWFT = 1 的情况
注: 在某些设计中,“首数据自动预读”的功能可能引起错误,可以使 FWFTEN = 0 关掉这个功能。
和传统 FIFO 控制器使用空信号 (EMPTY) 指示读数据有效不同,此控制器采用 r_valid 信号同步指示 FIFO 读数据有效,这样可以给 FIFO 应用带来一点方便。 如果 FIFO 读侧确实需要空信号或者需要进行门限控制设计,请使用 r_counter[] 替代。
注: 一般 Dual-port RAM 的时序是在 r_ram_en 和 r_ram_addr[] 有效的下一个时钟周期输出读数据。
[1] Clifford E. Cummings, “Simulation and Synthesis Techniques for Asynchronous FIFO Design”, SNUG 2002 (Synopsys Users Group Conference, San Jose, CA, 2002). Also available at www.sunburst-design.com/papers [2] Clifford E. Cummings and Peter Alfke, “Simulation and Synthesis Techniques for Asynchronous FIFO Design with Asynchronous Pointer Comparisons,” SNUG 2002 (Synopsys Users Group Conference, San Jose, CA, 2002) User Papers, March 2002, Section TB2, 3rd paper. Also available at www.sunburst-design.com/papers
新闻热点
疑难解答