AI Engine Stall Analysis with Vitis Analyzer - 2023.2 English

Vitis Tutorials: AI Engine (XD100)

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

Vitis Analyzer can use the event trace from the AI Engine simulation to do stall analysis that shows an overview of the stall status in metrics. It also helps you determine where the stall has happened, and the possible causes.

If you are using Vitis Analyzer to do stall analysis, run the AI Engine simulator with --online -wdb -ctf options to generate event trace information in the background:

aiesimulator --pkg-dir=./Work --online -wdb -ctf

Note: For more information about AI Engine stall analysis using Vitis Analyzer in the hardware emulation flow, refer to the Versal ACAP AI Engine Programming Environment User Guide (UG1076).

In Vitis Analyzer, the Performance Metrics view gives an overview of the stalls in the design:

Performance Metrics View

Each tile shows percentages for each type of stall. From the metrics table, it can be seen that tile (24,0) has a large percentage of lock stall (98.896%), and tile (25,0) has a large percentage of stream stall (98.380%). These metrics indicate that the design is hanging, and that analysis is required.

In the Graph view of Vitis Analzyer, you can visualize the stalled path in the graph, which gives an indication of where the stall has happened in the design. By understanding the design behavior, it is also possible to estimate the cause of the hang.

For example, select the stream stall in Trace view, and switch to Graph view. In this design, kernel k[0] hangs in stream stall. The full destination port is gr.k[1]/in, which means that the destination kernel k[1] is not receiving data from the stream.

Stream stall in Trace View

Stream stall in Graph View

Select the stall in Lock Stalls in Trace view, and switch to Graph view. The red path to kernel k[1] shows that it is trying to acquire the lock of the input buffer, but without success. The white path shows that kernel k[0] is holding the lock of the buffer.

Lock stall in Trace View

Lock stall in Graph View

From the above analysis, the cause of the hang is given. The direct resolution, without modifying kernel code, is to increase the FIFO size between the two kernels.

For more information about AI Engine stall analysis feature, refer to the Versal ACAP AI Engine Programming Environment User Guide (UG1076).