Packet Switching and the aiesimulator - Packet Switching and the aiesimulator - 2026.1 English - UG1603

AI Engine-ML Kernel and Graph Programming Guide (UG1603)

Document ID
UG1603
Release Date
2026-07-08
Version
2026.1 English

The aiesimulator supports explicit packet switching. Consider the example of the previous graph that expects packet switched data from the PL. The data is split inside the AI Engine-ML and sent to four AI Engine kernels. On the output side the four kernel outputs merge into one output stream to the PL.

The input data file from the PL contains the packet switched data from the PL for the four AI Engine kernels in the previous example. It contains the data for different kernels, packet by packet. Each packet of data is for one iteration of an AI Engine kernel. The data format is as follows.

2415853568
0
1
2
3
4
5
6
TLAST
7
Here, 2415853568 is 0x8fff0000 in hex format. The five least significant bits are the packet ID, 0 in this case. The last data in the packet has the keyword TLAST, which denotes the last data for the input of the kernel.
Note: The packet header ID for the PL packet inputs to the aiesimulator must be an integer value.

You can construct the header for each packet manually, or write helper functions to generate the header. The AI Engine-ML compiler generates a packet switching report file Work/reports/packet_switching_report.json that lists the packet IDs used in the graph. Additionally, it also generates Work/temp/packet_ids_c.h and Work/temp/packet_ids_v.h header files. You can include these in your C or Verilog kernel code.

Note: The AI Engine kernel expects the packet header to be 32 bits. When the PLIO width is greater than 32 bits, the first PLIO beat of each packet carries the header packed together with the first payload word (and additional payload words, depending on the PLIO width). Account for this when sizing the input/output text files — the total beat count is not simply header + payload words. For example, with a 64-bit PLIO and the same packet shown above, the data file becomes:
2415853568 0
1 2
3 4
5 6
TLAST
7
Here each row is one 64-bit beat. The first beat packs the 32-bit header (2415853568 / 0x8FFF0000) with payload word 0. Subsequent beats carry payload words two-per-beat. TLAST precedes the final payload word 7 as in the 32-bit case.