AI Engine Stall Analysis in the Vitis IDE - 2023.2 English

AI Engine Tools and Flows User Guide (UG1076)

Document ID
Release Date
2023.2 English

AI Engine execution can be stalled by stall logic from multiple sources include the following.

External memory-mapped AXI4 master
Any external AXI4 master (for example, PS) can issue a stall signal to a specific AI Engine.
Lock modules
AI Engine has access to locks for hardware synchronization. When acquiring a lock, if the core does not get a lock, then the AI Engine will be stalled until the lock becomes unlocked.
Empty or full AXI4-Stream interfaces
The AI Engine can be stalled when reading from an empty input FIFO or writing to a full output FIFO.
Data memory collisions
Memory stall can occur between two different AI Engines or when one AI Engine tries to access a single memory bank (for example, trying to load and store in the same cycle to the same memory bank).
Event actions from the event unit
The AI Engine can be stalled by event actions from the event unit.

When an AI Engine stalls, all memory interfaces to AI Engine including program memory interface are stalled. The stall is resolved when the cause of the stall has been fixed.

The IDE can use the VCD trace from AI Engine simulation to do stall analysis that shows an overview of the stall status in metrics. It also helps you detect where the stall happens and the possible causes.

To do stall analysis in the IDE, it is advised that you run the AI Engine simulator with --online -wdb -text options to generate event trace information in the background.

aiesimulator --pkg-dir=./Work --online -wdb -text
Note: If the VCD file is needed for analysis, --dump-vcd option of AI Engine simulator can be used instead. However, note that the IDE takes time to generate event trace from the VCD file. Especially when the design is large, the time becomes non-negligible. Therefore, it is recommended to use vcdanalyze together with AI Engine simulator to prepare event trace for the IDE to perform AI Engine stall analysis.
aiesimulator --pkg-dir=./Work --dump-vcd foo
vcdanalyze --vcd=foo.vcd --wdb --text
Note: Do not use --outdir option of vcdanalyze to place output data in directories other than default.

For the steps to launch the IDE to view the AI Engine simulation result, see Viewing the Run Summary in the Vitis IDE.

vitis -a ./aiesimulator_output/default.aierun_summary

The following additional settings are required for AI Engine stall analysis in the Vitis IDE working in the HW emulation flow.

  1. Write a simulator option file (for example, sim_options.txt) with content:
  2. Launch HW emulation with options:
    ./ -aie-sim-options <ABSOLUTE_PATH_TO>/sim_options.txt
  3. Optionally run vcdanalyze:
    cd ./sim/behav_waveform/xsim/; vcdanalyze --pkg-dir=../../../Work --vcd=foo.vcd --wdb –text
  4. Launch the Vitis IDE:
    vitis -a ./sim/behav_waveform/xsim/default.aierun_summary