An asynchronous FIFO buffer that allows for N entries, with empty/almost empty and full/almost full output status flags. Design heavily based off Clifford E. Cummings' work: http://www.sunburst-design.com/papers/CummingsSNUG2002SJ_FIFO1.pdf
FIFO parameters for testbench:
- Depth is 1024
- Data Width is 16 bits
- Read Clock 100 MHz
- Write Clock 24 MHz
The following test cases show that the FIFO buffer never gets overflowed or underflowed and confirms that the status flags are asserted immediately, but removed after a delay of 2-3 clock cycles.
Test Case #1: Only write to FIFO; try writing when FIFO is full. Check that the full/AF flags are asserted immediately, and empty/AE flags are removed pessimesstically.
Test Case #2: Only read from FIFO. Check that full/AF flags are deasserted pessimesstically, and empty/AE flags are asserted immediately.
Test Case #3: Write and read from FIFO. In this case read clock is faster than write clock, and both have no idle clock cycles. Then full/AF flags are never set, but rather empty flag cycles