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
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.
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.
Notice the run log of SW Emulation on the Debug Console
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.
After the design is built for the SW Emulation target, click on Flow Navigator -> SW Emulation -> Debug option.
This gets you to the debug mode in the Vitis IDE and waits in the host.cpp file
Also observe in the Breakpoints view, two other breakpoints that the tool automatically adds on to the
mm2s
ands2mm
kernels.Click the Resume button, and now the debugger waits at the breakpoint in
mm2s
. Optionally, you can also try placing the breakpoint in themm2s
function.Click Resume again, and observe debugger and console output, waiting at the
s2mm
kernel. Continue clicking Resume until the breakpoint ins2mm.cpp
hits.