This section uses the command-line flow to build for hardware emulation.
Before starting this tutorial:
Make sure that you cloned the git repository and the design files are ready to build.
Make sure that you set the environment variables as described in Introduction.
Navigate to the tutorial directory,
cmd_src/, and open the Makefile.To debug the project, add the
--pakcage.enable_aie_debugoption in the packaging step as follows:package: guard-PLATFORM_REPO_PATHS guard-IMAGE guard-ROOTFS cd ./sw v++ -p -t ${TARGET} \ -f ${BASE_PLATFORM} \ --package.rootfs=${ROOTFS} \ --package.image_format=ext4 \ --package.boot_mode=sd \ --package.kernel_image=${IMAGE} \ --package.defer_aie_run \ --package.sd_file embedded_exec.sh --package.enable_aie_debug \ --package.sd_file host.exe ../tutorial.xsa ../libadf.aOpen the workspace in Vitis IDE: {project_path}/cmd_src, and select
Set WorkspaceRight click in the
CMD_SRCsection in EXPLORER, and selectEdit Build ConfigurationEnter the make command to build the system and clean the generated outputs in the
Build commandandClean command, respectively.Right click in the
CMD_SRCsection in EXPLORER, and selectBuild.The build step performs the following:
Compiles the AI Engine kernels and generates
libadf.a.Compiles the PL kernels
s2mm,mm2sand generates.xo.Hardware linking step to link AI Engine kernels and PL kernels using the
system.cfgfile. This generates the.xsafile.Compiles the host application and generates the executable file
host.exe.Packages
libadf.a,.xsa, andhost.exefiles.
The following message indicates that the emulation package is created and the build completed successfully.
COMPLETE: emulation package created. Build Finished successfully
To launch emulation: Right click in the
CMD_SRCsection in EXPLORER, and selectEdit Launch ConfigurationsSelect the
host.exeanda.xclbinpaths correctly. Start the Emulator by right-clicking in theCMD_SRCand selectingStart Emulator. Run the scriptembedded_exec.shfrom /mnt as shown below. Check the log to confirm progress.Test Result:
TEST PASSEDindicates that launch emulation result. Close the emulation.Steps to debug
host.cppin Vitis IDE:a. Start the Emulator as shown in step 5, and wait for emulation to finish.
b. Click the
Debugicon inlaunch.json. The Vitis IDE enters debug mode as follows and waits in themainfunction inhost.cpp:You can add breakpoints in the host code and observe the values in the Variable window by doing step-in or step-over.
Refer to Debugging the System Project and AI Engine in Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393) for more details to debug AI Engine.