Packet Sender - Packet Sender - 2026.1 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2026-07-20
Version
2026.1 English

The packet_sender is an HLS kernel that bridges between the continuous data stream from DDR memory and the AI Engine’s packet-switched interface. It performs two critical functions:

  1. Data Reorganization: The consumer function reads continuous cint16 sample streams and reorganizes them into an interleaved pattern optimized for packet distribution. Samples are read from two input streams alternately and written to stream-of-blocks buffers (ss0 and ss1) in a specific pattern that ensures balanced packet timing downstream.

  2. Packet Formation: The producer function reads from the buffered data and formats AXI-Stream packets with proper headers and sideband signals. Each packet consists of:

    • Header beat: 32-bit AI Engine packet header (containing routing ID) + first 3 cint16 samples

    • Middle beats: 31 beats of continuous data (4 samples per beat)

    • Last beat: Final sample with TLAST=1 and TKEEP=0x000F to mark packet boundary

Key implementation details:

  • Dataflow architecture: Consumer and producer run concurrently using HLS dataflow pragma

  • Stream-of-blocks: Two 512-word × 128-bit LUTRAM buffers (zero BRAM usage) synchronize the consumer and producer

  • Interleaved ordering: Packets are distributed in stride-8 pattern (0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15) to minimize latency delta between the 4 AI Engine output ports of the packet-switched TDM FIR (~0.091us vs 0.84us for linear ordering, as described earlier). This reduces downstream stalls when connecting the TDM FIR to the IFFT, avoiding the need for large FIFOs to absorb timing skew between streams.

  • TKEEP signaling: Critical for width converter compatibility - uses 0xFFFF for valid data and 0x000F for partial last beat

  • Performance: Achieves 2.5 Gsps total throughput (1.25 Gsps per stream) at 312.5 MHz with 128-bit interfaces

The kernel processes 4096 input samples per stream and generates 16 packets per stream, with each packet containing 128 samples. Packet headers are generated from routing IDs defined in packet_ids_c.h, which is produced by the AI Engine compiler.