Trace capability is used for debugging simulation hangs without the need for instrumenting kernel code or using the GDB.
Consider Scenario 1 in the Deadlock Detection section, where the stream data from the producer kernel does not match with the consumer kernel. Now see how to visualize the information using the trace feature of the x86simulator.
Make the 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 the Enable trace option.
Run x86simulation by selecting the Run option under X86SIMULATION in Flow navigator.
Once 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
$(COMPONENT_NAME)/Output/x86sim/x86simulator_output/trace/x86sim_event_trace.data.txtfile, and observe the trace events.
Observe the events corresponding to all the kernels. Say, for
mygraph.d_s. Go to the last but one timestamp on that kernel, and locate the
stream stall begin infollowed by
thread terminated, as the deadlock happened.
You can also add
–dumpto the simulator options, open the
.txtfiles, and observe the
iterationvalues to understand how many samples of data got processed.
For more details on the kind of events that are recorded, refer to the Trace Report section in the AI Engine Tools and Flows User Guide (UG1076).