You can experience simulator hangs with AI Engine. Some common causes of deadlock are as follows:
- Insufficient input data for the requested number of graph iterations
- Mismatch between production and consumption of stream data
- Cyclic dependency with stream
- Cascade stream or asynchronous window
- Wrong order of blocking protocol calls (acquisition of async window, read/write from streams)
The x86 simulator automatically detects deadlock, unless the --disable-stop-on-deadlock option is specified. When a
deadlock is detected, simulation stops, and the simulator prints a deadlock
diagnosis report.
Additionally, the x86 simulator generates a graph in x86simulator_output/simulator_state_post_analysis.dot. This graph is a
.dot file that encodes a description of the
graph in terms of a block diagram where the agents involved in the deadlock are
highlighted in red. To transform file into a .png
file, use the dot program as follows.
dot -Tpng x86simulator_output/simulator_state_post_analysis.dot > simulator_state_post_analysis.png
Important: Absence of deadlock for x86
simulation does not mean absence of deadlock in SystemC simulation. x86 simulation
does not model timing and resource constraints and thus there are fewer causes of
deadlock. In contrast, if x86 simulation deadlocks, SystemC simulation also
deadlocks. Therefore it is beneficial to fix the deadlock in x86 simulation before
proceeding with SystemC simulation.
Note: The
--disable-stop-on-deadlock option is not supported for use cases with
an external test bench.You can visualize the textual description of the deadlock in the Vitis IDE:
Figure 1. Deadlock Diagnosis in the Analysis View