RTL Studio Open IDE

Bus Interfaces

AXI-Stream 1-to-2 Demux

AXI-Stream 1-to-2 Demux routing TDATA/TKEEP/TLAST based on TDEST[0]

About this block

Simulate it in the Verilog IDE

Hardverilogsimsyn

AXI-Stream 1-to-2 Demux is a Verilog reference block in the Bus Interfaces catalog. AXI, APB, Wishbone, and other on-chip bus interface adapters. Marked Hard: a larger reference. Simulate the packaged testbench before you change the RTL.

This IP core implements a robust AXI-Stream 1-to-2 demultiplexer. It routes incoming AXI-Stream data from a single slave interface to one of two master interfaces based on the TDEST[0] signal. The design supports full AXI-Stream protocol features, including backpressure propagation, registered outputs for timing closure, and comprehensive verification.

Key Benefits:

  • Protocol Compliance: Fully compliant with AXI-Stream specifications.
  • Backpressure Handling: Correctly propagates TREADY from the selected master back to the slave.
  • Timing Safe: Registered outputs ensure stable timing for downstream logic.
  • Verified: Includes a comprehensive testbench covering routing, backpressure, and error scenarios.
  1. Choose Open in IDE. RTL Studio loads the packaged workspace for AXI-Stream 1-to-2 Demux.
  2. Read the Verilog module in the editor. The catalog line for this block: AXI-Stream 1-to-2 Demux routing TDATA/TKEEP/TLAST based on TDEST[0].
  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

  • Routing Logic: Routes TDATA, TKEEP, TLAST, and TDEST signals.
  • Selection Signal: Uses s_axis_tdest[0] to select Master 0 (value 0) or Master 1 (value 1).
  • Backpressure: Handles TREADY signals from both masters to prevent data loss.
  • Registered Outputs: Outputs are registered to improve timing performance.
  • Verification: Verified with a self-checking testbench covering 5 distinct test cases.

Interface

The module consists of one slave interface (s_axis) and two master interfaces (m0_axis, m1_axis).

Signal GroupDirectionWidthDescription
aclkinput1Clock input
aresetninput1Active-low reset
s_axis_tvalidinput1Slave valid
s_axis_treadyoutput1Slave ready
s_axis_tdatainput8Slave data
s_axis_tkeepinput1Slave keep mask
s_axis_tlastinput1Slave last
s_axis_tdestinput1Destination selector (0=M0, 1=M1)
m0_axis_tvalidoutput1Master 0 valid
m0_axis_treadyinput1Master 0 ready
m0_axis_tdataoutput8Master 0 data
m0_axis_tkeepoutput1Master 0 keep mask

Architecture

The demux uses a finite state machine (FSM) to manage transactions. It checks TDEST[0] to determine the target master. If the selected master is not ready (TREADY is low), the slave interface is held back (TREADY is low), effectively implementing backpressure.

Verification

The testbench (tb_axi_stream_demux_1to2.v) covers the following scenarios:

Test CaseDescriptionResult
TC1Route to M0PASS
TC2Route to M1PASS
TC3Backpressure on M0, Route to M1PASS
TC4Backpressure on M1, Route to M0PASS
TC5Alternating PacketsPASS

More in Bus Interfaces

All Bus Interfaces blocks