Prepare Data and Run AI Engine Simulator - 2023.2 English

Vitis Tutorials: AI Engine (XD100)

Document ID
XD100
Release Date
2024-03-05
Version
2023.2 English

When constructing the input data file for the AI Engine simulator, the data file should contain the sequence of packets. Each packet contains the packet header, followed by the data. The last data has the TLAST keyword in a separate line just above the data. The data is in 32-bit integer format, including the header. The following is an example of a packet in the data file (data/input.txt).

    2415853568
    0
    1
    2
    3
    4
    5
    6
    TLAST
    7

In this packet, 2415853568 is an integer. The hex value for 2415853568 is 0x8FFF0000, which has packet ID of 0 (the last five bits). It is useful for you to have your own program to convert the original data into the data file with packet headers in the required format.

When the input PLIO is not 32 bits wide, it can include multiple 32-bit integers in a line to construct wider bit words, with spaces between them. For example, the following is an example packet for a 64-bit width PLIO.

    2415853568 0
    1 2
    3 4
    5 6
    TLAST
    7

Run the AI Engine simulator with following make command. The detailed information for the AI Engine compiler and AI Engine simulator commands can be found in the AI Engine Documentation.

make aiesim

The output data is in aiesimulator_output/data/output.txt. The output data is also arranged as successive packets, for example:

    T 413 ns
    50462720 
    T 416 ns
    4 
    T 417 ns
    8 
    T 418 ns
    12 
    T 419 ns
    16 
    T 420 ns
    20 
    T 421 ns
    24 
    T 422 ns
    28 
    T 423 ns
    TLAST
    32 

The packet header is the first 32-bit word 50462720. Its hex value is 0x3020000. Therefore, the packet ID is 0 (the last 5 bits). You can look at the packet switching header files (Work/temp/packet_ids_c.h and Work/temp/packet_ids_v.h) to find out which AI Engine kernel has produced it. The Work/temp/packet_ids_c.h has defined:

    #define Dataout0_3 0

Here, Dataout0_3 denotes that the packet ID 0 comes from pktmerge.in[3]. By looking at the graph code (aie/graph.h) or graph view in Vitis analyzer, you can find which AI Engine kernel actually produced it. In this example result, it is kernel core[3] (aie/aie_core4.cpp).