Trace capability is used to debug simulation hangs without instrumenting kernel code or using GDB.
Consider Scenario 1 in the Deadlock Detection section, where the stream data from the producer kernel does not match the consumer kernel. Now see how to visualize the information using the trace feature of the x86simulator.
Make changes to the source code as mentioned in the Deadlock Detection section, Scenario 1, and build the project.
Open the launch configuration settings and select Enable trace.
Run x86simulation by selecting Run under X86SIMULATION in the Flow navigator.
After the run completes, you can see the following information in the console.
Processing './x86simulator_output/trace/x86sim_event_trace.data' 10% complete 50% complete 70% complete 80% complete 100% complete Wrote './x86simulator_output/trace/x86sim_event_trace.data.txt' Wrote ./x86simulator_output/simulator_state_post_analysis.dot Simulation completed successfully returning zero
Open the
$(COMPONENT_NAME)/Output/x86sim/x86simulator_output/trace/x86sim_event_trace.data.txtfile, and observe the trace events.Observe events for all kernels. For
mygraph.d_s, go to the last but one timestamp on that kernel, and locate thestream stall begin in[1]followed bythread terminated, indicating the deadlock.You can also add
–dumpto the simulator options, open the.txtfiles, and observe thesnapshotanditerationvalues to understand how many data samples were processed.
For more details on recorded events, refer to the Trace Report section in the AI Engine Tools and Flows User Guide (UG1076).