Deadlock Detection - 2021.2 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
UG1076
ft:locale
English (United States)
Release Date
2021-12-17
Version
2021.2 English

AI Engine users can run into simulator hangs. A common cause is 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 windows, or wrong order of blocking protocol calls (acquisition of async window, read/write from streams).

You can use the --stop-on-deadlock option on x86simulator to detect such deadlocks. This option will enable x86simulator to automatically detect a broad category of deadlocks, stop the simulation, and print a message stating the simulation has been terminated prematurely because a deadlock has been detected. When the x86simulator is invoked with the --stop-on-deadlock option, x86simulator detects the deadlock and produces a deadlock diagnosis report.

Additionally, a graph is generated in x86simulator_output/simulator_state_post_analysis.dot. This 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 get this file transformed into a .png file, you must 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. On the other hand, if x86 simulation deadlocks, SystemC simulation deadlocks as well, so it is beneficial to fix the deadlock in x86 simulation before proceeding with SystemC simulation.
Note: The --stop-on-deadlock option is not supported for software emulation or use cases with an external test bench.