The example is similar to the one used in AI Engine Execution and Measurement, except that it does not have a FIFO for the stream connection:
When the design stalls, graph::wait()
and graph::end()
hang. It needs to interrupt graph execution by:
Using
graph::wait(CYCLE_NUMBER)
: Specifying the number of cycles to wait for the API to return (if the graph does not return afterCYCLE_NUMBER
cycles, this API still returns immediately).Using
graph::end(CYCLE_NUMBER)
: Specifying the number of cycles to wait for the graph to be ended (if the graph does not return afterCYCLE_NUMBER
cycles, this API still ends the graph immediately).Using the
--simulation-cycle-timeout CYCLE_NUMBER
option foraiesimulator
.
The CYCLE_NUMBER
should be large enough for AI Engine simulator to record all the stall events, or for hardware to run into hang status.
In this example, examine
aie/graph.cpp
. We wait for 10000 cycles:gr.init(); gr.run(4); gr.wait(10000);
Run AI Engine simulator using the following command:
make aiesim
Open Trace view in Vitis Analyzer by using the following command:
vitis_analyzer aiesimulator_output/default.aierun_summary
The hang occurs after the following activities:
1: Kernel
aie_dest1
acquires the lock of read buffer (buf0
) and write buffer (buf1
).2: Kernel
aie_dest1
starts.3: Kernel hangs in stream stall.
4: S2mm is waiting for kernel
aie_dest1
to release bufferbuf0
.