A Synchronous FIFO is a memory buffer used to store and retrieve data sequentially, where both write and read operations occur under the same clock domain. This design is commonly used in digital systems to buffer data between two subsystems that operate with the same clock but at different data processing speeds.
- Single Clock: One clock signal controls both read and write operations.
- Sequential Access: Data is written into the FIFO sequentially.
- Order Preservation: The first data written is the first data read (FIFO property), ensuring predictable and reliable data flow.
The FIFO ensures data integrity in pipelined and buffered systems by maintaining the exact order of data.
- Write Operation: Data is written at the
write_pointerlocation. The pointer increments after a successful write. This is only permitted whenfullis low. - Read Operation: Data is retrieved from the
read_pointerlocation. The pointer increments after a successful read. This is only permitted whenemptyis low. - Status Flags: * Full: Triggered when the write pointer catches up to the read pointer.
- Empty: Triggered when the read pointer catches up to the write pointer.
| Signal Name | Description |
|---|---|
clk |
Clock signal (common for read and write) |
reset |
System reset (active high/low depending on RTL) |
cs |
Chip Select |
wr_en |
Write Enable |
rd_en |
Read Enable |
data_input |
Input data bus |
data_output |
Output data bus |
full |
FIFO full indicator (prevents overflows) |
empty |
FIFO empty indicator (prevents underflows) |
- Clock Domains: Single clock domain.
- Read Type: Registered read output.
- Parameterization: Supports configurable Data Width and FIFO Depth.
- Detection: Count-based Full/Empty detection.
- Wrap Handling: Pointer wraparound supported (suitable for power-of-two and non-power-of-two depths).
. ├── rtl/ │ └── sync_fifo.v # Core FIFO Logic ├── tb/ │ └── sync_fifo_tb.v # Testbench ├── build/ │ └── (generated files) # Simulation artifacts ├── Makefile # Build automation └── README.md # Documentation
- Verilator: RTL simulation
- GTKWave: Waveform viewing
- C++ Compiler: C++20 support required for Verilator timing
- Clean previous build artifacts:
make clean
- To display waveforms:
make wave