FIFO深度计算
主要方法
关键点: 传输的最大package/读时钟速率/写时钟速率
写入最大包的时,FIFO不发生溢出的条件:
写入的最大package = FIFO容量 + 读出的数据量
读写时间t = 写入的最大package / 写时钟速率
读出数据量 = 读时钟速率 × 读写时间t
例子
一个8bit宽的AFIFO,输入时钟为100MHz,输出时钟为95MHz,设一个package为4Kbit,且两个package之间的发送间距足够大。求AFIFO的深度?
已知量:
传输的最大package = 4 Kbit
读时钟速率 = 95 MHz
写时钟速率 = 100 MHz
套用公式:
t = 写入的最大package / 写时钟速率 = 4 Kbit / 100MHz
写入的最大package = FIFO容量 + 读出的数据量 --> 4 Kbit = x + t*95MHz
=> FIFO容量x = 205bit 约 26 x 8bit
即FIFO深度为26