FIFO简介(first-in-first-out)
一个先进先出的存储器,一般用于不同时钟域(频率/相位不同)之间的数据传输(避免数据传输过程中的亚稳态,作为缓存),也常用于来实现不同位宽的接口的数据匹配
实验任务
在FIFO中写入256个数据,然后从FIFO中读出,验证是否正确
程序设计
系统框图
重要参数:
写模块:
wrempty写空标志 wrfull写满标志
data写入数据 wrreq写使能(请求)
读模块:
rdempty读空标志 rdfull读满标志
q读出数据 rdreq读使能(请求)
(下划线均为ip核内部产生,具体原理参考以下两篇博文
https://www.cnblogs.com/BitArt/archive/2013/04/10/3010073.html
https://www.cnblogs.com/xuqing125/p/8337586.html )
//写模块
module fifo_wr(
//mudule clock
input clk , // 时钟信号
input rst_n , // 复位信号
//user interface
input wrempty, // 写空信号
input wrfull , // 写满信号
output