This project implements an Asynchronous FIFO (First-In-First-Out) buffer using Verilog HDL, suitable for crossing data between two asynchronous clock domains. The FIFO ensures reliable data transfer by using synchronizers and Gray-coded pointers to avoid metastability and timing issues.
As one example I can give here like suppose a temporary storage element is one side, from another side if I want to comunicate between two of them then for to communicate use one FIFO. Because it is the data communication between two different clock domain. There the ethernet controller writes the data in faster clock spped in FIFO memory and that system memory reads the data form FIFO memory compared to slow clock speed.
- Asynchronous Clocks: Independent write and read clock domains.
- 2-Stage Synchronizer, binary to gray & gray to binary : Reduces metastability in pointer transfer, For safe synchronization across clock domains.
- Full and Empty Flags: Accurate detection of FIFO status.
- Configurable Parameters: Supports parameterized data width, depth, and address size.
- Testbench Included: Basic testbench for functional simulation with independent clocks.
- Synchronizes pointers between clock domains.
- Handles metastability by passing the signal through two flip-flop stages.
- Increments on each write operation.
- Outputs both binary and Gray-coded values for synchronization.
- Increments on each read operation.
- Outputs both binary and Gray-coded values for synchronization.
- Dual-port RAM for storage.
- Separate read and write addresses.
- Generates FIFO Full and FIFO Empty flags based on synchronized pointers.
- Integrates all modules.
- Handles write/read operations, pointer synchronization, and status flag generation.
- Generates asynchronous write and read clocks.
- Tests basic FIFO operations: write, read, full, and empty detection.
- Displays output on simulation waveform.
- Wtite clock domain speed(frequency) is higher than read clock domain freq..
-
$$f_{write}$$ = 100MHz,$$f_{read}$$ = 80MHz, Burst length = 50 - One clock cycle delay between two successive reads and writes (idle case)
- Time required to write one data = 10nsec.
- To write all the data in the burst into fifo mem, time need = 500nsec
- Time required to read one data = 12.5nsec.
- no. of data items can be read within the 500nesc is 40.
- So fifo mem. depth is needed = 50 - 40 = 10.
- Xilinx Vivado or any Verilog-compatible simulator (ModelSim, Synopsys VCS, etc.)
- Clone this repository:
git clone https://github.com/yourusername/async-fifo-verilog.git cd async-fifo-verilog - Open Vivado and create a new project.
- Add all Verilog source files (
*.v) and the testbench file. - Set
async_fifo_tbas the top module for simulation. - Run Behavioral Simulation:
Flow Navigator → Simulation → Run Simulation → Run Behavioral Simulation
- Write Phase:
data_inincrements onwr_clkrising edges. - Read Phase:
data_outreflects written data in the exact order. - FIFO Flags:
fifo_fullremains low unless capacity is reached.fifo_emptyasserts after all data is read.
- ✅ Data Consistency:
data_outmatchesdata_inorder (FIFO behavior). - ✅ Pointer Synchronization: Pointers cross clock domains without glitches.
- ✅ Full/Empty Flags: Trigger correctly during respective conditions.
- ✅ Latency Measurement: Delay between write and read shows expected asynchronous behavior.
🎯 Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Concepts inspired by standard asynchronous FIFO design techniques.
- Developed as part of a digital design project using Xilinx tools.
⭐ If you find this project helpful, feel free to star the repo and share your feedback! ⭐
