Simple FIFO implementations in Verilog:
Sync_FIFO.v(synchronous FIFO)simple_async_fifo.v(asynchronous FIFO, dual-clock)
This repository currently includes one testbench file for the synchronous FIFO.
-
Sync_FIFO.v
Synchronous FIFO with:- single clock (
clock) wr_en/rd_enbuf_empty,buf_fullfifo_cnt
- single clock (
-
Test_Sync_FIFO.v
Testbench forSync_FIFOwith push/pop tasks and mixed read/write stimulus. -
simple_async_fifo.v
Asynchronous FIFO with:- write clock
wr_clkand read clockrd_clk - Gray-code pointer logic
- synchronized pointers across clock domains
full,empty,overflow,underflow
- write clock
- Data width is 8-bit in both designs by default.
Sync_FIFO.vuses:`define bufwidth 3`define bufsize (1<<`bufwidth)
simple_async_fifo.vuses parameters:DATA_WIDTH = 8DEPTH = 512
No simulator scripts are included in this repo.
Use your preferred Verilog simulator and compile the files you want to test.
For synchronous FIFO simulation, use:
Sync_FIFO.vTest_Sync_FIFO.v
- Synchronous FIFO: implementation + testbench included.
- Asynchronous FIFO: implementation included.