RTL Studio Open IDE

Memory & FIFOs

FWFT Sync FIFO with Almost Full/Empty

A First-Word-Fall-Through (FWFT) synchronous FIFO module with configurable almost full and almost empty threshold flags for precise flow control.

About this block

Simulate it in the Verilog IDE

Hardverilogsimsyn

FWFT Sync FIFO with Almost Full/Empty 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.

This IP implements a First-Word-Fall-Through (FWFT) synchronous FIFO with configurable almost full and almost empty threshold flags. It provides precise flow control for high-speed data paths, ensuring low latency by making data available immediately upon a valid read enable.

The module supports configurable data width, depth, and threshold levels, making it suitable for buffering data between synchronous clock domains or as a component within asynchronous clock crossing logic.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for FWFT Sync FIFO with Almost Full/Empty.
  2. Read the Verilog module in the editor. The catalog line for this block: A First-Word-Fall-Through (FWFT) synchronous FIFO module with configurable almost full and almost empty threshold flags for precise flow control.
  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

  • First-Word-Fall-Through (FWFT): Data is available on rd_data immediately when rd_en is asserted, provided the FIFO is not empty.
  • Configurable Parameters: Supports configurable DATA_WIDTH, DEPTH, AF_THRESH (Almost Full Threshold), and AE_THRESH (Almost Empty Threshold).
  • Precise Flow Control:

- almost_full asserts when the remaining space is less than or equal to AF_THRESH. - almost_empty asserts when the used space is less than or equal to AE_THRESH.

  • Robust Flag Logic:

- full prevents invalid writes. - empty prevents invalid reads.

  • Synchronous Reset: Defined initial state with full and empty asserted high upon reset.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low synchronous reset
wr_enInput1Write enable signal
rd_enInput1Read enable signal
wr_dataInput[DATA_WIDTH-1:0]Data input to be written
rd_dataOutput[DATA_WIDTH-1:0]Data output from the FIFO
fullOutput1High when FIFO is completely full
emptyOutput1High when FIFO is completely empty
almost_fullOutput1High when FIFO is near full (<= AF_THRESH)
almost_emptyOutput1High when FIFO is near empty (<= AE_THRESH)

Verification

The testbench verifies the following scenarios:

Test CaseDescriptionExpected Result
TC1Reset Stateempty and full flags are high
TC2Fill to Almost Fullalmost_full asserts at threshold
TC3Fill to Fullfull asserts when depth is reached
TC4Write to FullWrite is ignored, full remains high
TC5Drain to Almost Emptyalmost_empty asserts at threshold
TC6Drain to Emptyempty asserts when depth is cleared
TC7Read from EmptyRead is ignored, empty remains high

All test cases passed successfully in simulation.

More in Memory & FIFOs

All Memory & FIFOs blocks