AI Engine Stall Analysis with Vitis Analyzer - 2022.2 English

Vitis Tutorials: AI Engine Development

Document ID
XD100
Release Date
2022-12-01
Version
2022.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 (99.161%), and tile (25,0) has a large percentage of stream stall (98.627%). 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 can give an indication of where the stall has happened in the design. By understanding the design behavior, it is also possible to estimate what the cause of the hang might be.

For example, as the following figure shows, 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 Graph View

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

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).