Packet Stream Reading and Writing - 2025.1 English - UG1079

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
UG1079
Release Date
2025-06-04
Version
2025.1 English

A data packet consists of a one word (32-bit) packet header, followed by some number of data words where the last data word has the TLAST field signaling the end-of-packet. The following operations are used to read and advance input packet streams and write and advance output packet streams.

int32 readincr(input_pktstream *w);
int32 readincr(input_pktstream *w, bool &tlast);

void writeincr(output_pktstream *w, int32 value);
void writeincr(output_pktstream *w, int32 value, bool tlast);

The API with TLAST argument help to read or write the end-of-packet condition if the packet size is not fixed.

If the packet header word has sideband TLAST equals to true, this signals that the packet is complete and there is no more data with the packet, that is, the packet has only the packet header.