Software Emulation Debug from the Vitis IDE - 2022.1 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
Release Date
2022.1 English
Prior to running the application in software emulation, you need to build the system project using the Emulation-SW build target. To run and debug the application in the Emulation-SW build target, you must use the following steps.
  1. Start the QEMU emulation environment by selecting the Xilinx > Start/Stop Emulator.

    This will launch the emulator and then wait until Linux is booted within QEMU. The Emulation console shows a transcript of the QEMU launch and Linux boot process. You can tell when the process has completed when the progress dialog closes and the Emulation Console window shows a blank qemu% prompt. You can examine the transcript for details of the process.

    When launching software emulation, you can specify options for the AI Engine simulator that runs the graph application. As described in Reusing x86 Simulator Options, the options can be specified in the Emulator Arguments field shown in the previous image by specifying the following command.
    -x86-sim-options ${FULL_PATH}/x86sim.options
    Note: ${FULL_PATH} is the full path to the location of the x86sim.options file.
    Important: Open up the host application source file. Right-click on the side of the int main() to set a breakpoint because the IDE does not automatically set the breakpoint at main().
  2. Right-click on the top-level system project, and select the Debug As > Launch SW Emulator command. This opens the Debug Configurations dialog box.
  3. Click Debug to proceed.
    This opens the Debug perspective in the Vitis IDE, and connects to the PS application and AI Engine graph running on their respective threads in the QEMU.
    Note: See Vitis IDE Layout for Software Emulation Debug for additional details on the views used during debugging.
  4. Click the Resume button to go to the next breakpoint. Looking at the Debug view, you can see the various threads spawned.

    Note: The Debug view also shows which thread has hit a breakpoint with the info (Suspended : Breakpoint).
  5. Review the Variables view. This view shows all the variables and objects, and in the following figure, an AI Engine kernel. For example, the following figure shows the expanded sbuff shows how a v32cint16 datatype is formatted.

  6. Click the Registers view. With a breakpoint triggered in an AI Engine kernel, this view shows all of the relevant registers.

    Note: If a breakpoint is triggered in the host application source, it shows the PS registers.