Overview

The AxiStreamPacketizer takes incoming AxiStreams and breaks them into smaller sub-frames (packets). The AxiStreamDepacketizer does the reverse, reassembling a packetized stream into the original frames. 

The packetization protocol also takes AXI-Stream sideband data (TDEST, TID, TUSER) and inserts it in the data stream as part of the packetization format.

Together these features are very useful for sending an AXI-Stream over an external transport such as UDP.


Version 2 of the packetizer has been designed to allow interleaving of packet chunks.

Version 2 requires a 64-bit axi-stream, not more or less. If your AXI stream has a different configuration, it will need to be adapted to 8 bytes before it is fed into the AxiStreamDepacketizer.

Details

Packet Header

The Packetizer breaks stream frames in to smaller chunks called packets. Each packet contains an 8 byte header as follows:

WordBitsNameDescription
03:0VERSIONVersion info. Should always be 0x2.
07:4CRC_TYPE

0: No CRC
1: CRC over just DATA
2: Calculate CRC over HEAD, TAIL, and DATA

015:8TUSER_FIRST

The TUSER of the AXI-Stream frame

023:16TDESTTDEST of AXI-Stream frame
031:24TIDTID of AXI-Stream frame
115:0SEQPacket sequence number of frame
130:16UNUSED
131SOFFlag indicates first packet of a frame


Packet Tail

Each packet also has a 8 byte tail appended:

WordBitsNameDescription
07:0TUSER_LASTTUSER of last transaction of the AXI-Stream frame.
08EOFIndicates that this is the last packet of a frame.
015:9UNUSED
019:16LAST_BYTE_CNTNumber of valid bytes (0-8) in last transaction of frame
031:20UNUSED
131:0CRCRunning CRC of the frame data

Notes


  • Having tUserLast/EOF in a tail allows the packetizer to function in streaming fashion and not have to buffer each packet worth of data in a FIFO.
  • TDest, TId and TUserFirst are placed in the header of every packet, even though they don’t change after the first packet of the frame.
  • TUserLast data is only valid if the EOF bit is 1.

CRC Notes

  • In CRC-type 2 mode the CRC computation only spans the 32 least-significant bits of the tail word (i.e., not the CRC field itself). The resulting CRC is inserted in the CRC field (byte-swapped, see below).
  • The "little-endian, ethernet" polynomial (0xedb88320) is used; the CRC is initialized with 0xffffffff (and bits are processed in lsb->msb order).
  • The resulting 32-bit CRC is byte swapped before being stored in the tail word! E.g., the example frame:


HeaderDataTail (32 lsb)
0x8000000000000222
0xAFFECAFEFEEDBEEF
0x00080102


yields a CRC of 0x9c9c571e and is transmitted as

0x8000000000000222
0xAFFECAFEFEEDBEEF
0x1E579C9C00080102


  • If CRC-support is not enabled in the firmware then the CRC bits are all zero and no CRC is checked on incoming traffic (but the CRC field must be zero).
  • If CRC-support is enabled in firmware then the peer must provide a CRC.
  • Note that the 8 - LAST_BYTE_CNT (arbitrary) bytes which are not part of the payload must be included in the CRC computation. While these bytes are not part of the payload they are still part of the (de-)packetizer frame.

Commonly Used with other Protocols

PGPv3

PGPv4

RSSI

Contact

Ben Reese

bareese@slac.stanford.edu

  • No labels