Software-Emulation Debug Walkthrough - 2024.1 English

Vitis Tutorials: AI Engine

Document ID
XD100
Release Date
2024-10-30
Version
2024.1 English

Software-Emulation Debug Walkthrough

Introduction

Generally, software emulation is the first step to building and testing the system in a functional process through the custom host code you create rather than the simulator test host code.

Software emulation for a system with an AI Engine can be useful in:

  • Checking initial system behavior with a limited known data set

  • Functional integration and debugging of the processing system (PS), programmable logic (PL), and ADF graph using the GNU debugger (GDB)

  • Testing the system with the external traffic generator using Python or C++

  • Running system with C-based models for register-transfer level (RTL) kernels

  • Applying AI Engine simulation options through the x86 options file in Work/options

Features

The following are some of the software emulation features this section covers.

Build for Software Emulation Using the Vitis IDE Explains how to create system project, build for sofware emulation, and run.
Debug Using the Vitis IDE Debugger for Software Emulation Explains how to debug for software emulation using the Vitis IDE.

Section 1

Build for Software Emulation Using the Vitis IDE

Before getting into this section, you must follow the GCC requirements to build the Software Application from here.

Also it is expected that you created an AI Engine application in the Vitis IDE and ran x86simulation Build and Simulate in the Vitis IDE.

Create a system project manually using the steps mentioned in Port Command Line Project to the Vitis IDE System Project

  1. To build the system project, click system_project and go to Flow Navigator pane and select SW EMULATION. Click Build All for SW Emulation. The top-level project uses an incremental build approach that recognizes the state of the subprojects and provides option to rebuild the projects that must be updated.

  2. Once the build completes, hover the mouse over Run and click settings icon, select New Launch Configuration, add the SW Emulation configuration, and hit Run.

launch sw_emu

  1. Notice the run log of SW Emulation on the Debug Console sw_emu_runlog

Section 2

Debug using the Vitis IDE Debugger for Software Emulation

This section walks you through debugging in the software emulationflow using the Vitis IDE Debugger. 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. After the design is built for the SW Emulation target, click on Flow Navigator -> SW Emulation -> Debug option.

  2. This gets you to the debug mode in the Vitis IDE and waits in the host.cpp file Debug View

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

  4. 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.

  5. Click Resume again, and observe debugger and console output, waiting at the s2mm kernel. Continue clicking Resume until the breakpoint in s2mm.cpp hits.