RTL Studio Open IDE

Memory & FIFOs

Pointer-Based Sync FIFO with Flush

Compact single-clock FIFO using extra-bit read/write pointers for full/empty detection, enable-style w_en/r_en ports, synchronous flush, and default depth 16 with 32-bit data.

About this block

Simulate it in the Verilog IDE

Hardverilogsimsyn

Pointer-Based Sync FIFO with Flush is a Verilog reference block in the Memory & FIFOs catalog. SRAM models, FIFOs, register files, and memory-style storage. Marked Hard: a larger reference. Simulate the packaged testbench before you change the RTL.

Compact single-clock FIFO that detects full and empty by comparing extra-bit read/write pointers rather than maintaining a separate occupancy counter. Control uses w_en / r_en plus full, empty, and read-side valid. A synchronous flush clears pointers and status in one cycle without chip-wide reset.

Default configuration is 32-bit data and depth 16 (parameter DEPTH). Verified with Icarus Verilog.

Use this block for a small on-chip queue where software or hardware may need to drop pending data via flush. Check full before writes and empty / valid before reads.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Pointer-Based Sync FIFO with Flush.
  2. Read the Verilog module in the editor. The catalog line for this block: Compact single-clock FIFO using extra-bit read/write pointers for full/empty detection, enable-style w_en/r_en ports, synchronous flush, and default depth 16 with 32-bit data.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Features

  • Pointer compare full/empty logic (classic small FIFO style).
  • flush input for fast queue discard.
  • Enable-style write/read ports (no dedicated wready).
  • Read valid tied to !empty.
  • Parameterized depth (default 16) and data width (default 32).

Ports

PortDirectionWidthDescription
clkInput1Single clock for read and write
rst_nInput1Active-low reset
flushInput1Clear FIFO contents
w_enInput1Write enable
w_dataInput32Write data
fullOutput1FIFO full
validOutput1Read data valid (!empty)
r_enInput1Read enable
r_dataOutput32Read data
emptyOutput1FIFO empty

Verification

Test CaseDescriptionStatus
TC1Single write/readPASS
TC2Burst write to fullPASS
TC3Burst read to emptyPASS
TC4Back-to-back read/writePASS
TC5Flush during active operationPASS

Simulation: make sim in the IP leaf.

More in Memory & FIFOs

All Memory & FIFOs blocks