Using the Vitis IDE for Software Emulation Debug - 2023.1 English

Vitis Tutorials: AI Engine Development

Document ID
XD100
Release Date
2023-10-03
Version
2023.1 English

This section walks you through debugging the Vitis IDE for software emulation. Before going through this section, it is expected to complete the Debug Using the Vitis IDE Debugger section which gives quick idea on how to use the Vitis IDE debugger.

  1. Once the build completes, you can right-click the system project, PeakDetect_system and select Debug As -> Launch SW Emulator.

  2. In the Launch on Emulator window, select Start Emulator and Debug.

  3. You can observe the Linux boot and application run messages in the console. Once the boot completes and application run starts, the debugger stops after the main() function as follows. debugger bp

  4. Also observe in the Breakpoints view, two other breakpoints that the tool automatically adds on to the mm2s and s2mm kernels.

  5. Place some breakpoints in your AI Engine source code, and try to observe the intermediate values. Open the src/kernels/peak_detect.cc file at line 31.

  6. Click the Resume button, and now the debugger waits at the breakpoint in mm2s. Optionally, you can also try placing the breakpoint in the mm2s function.

  7. Click Resume again, and observe debugger and console output, waiting at the s2mm kernel. Continue clicking Resume until the breakpoint in peak_detect.cc hits. Now, do step-over and observe values in variables view as follows. variable view

    Also note an error message if you try to access the vector variable values. This is not fully supported in software emulation and recommended to use the x86simulator to inspect the variable values.

  8. After your debug, remove all breakpoints, and click Resume to complete the run and stop emulation.

    NOTE: All the limitations from x86simulator are applicable in software emulation.