See Vitis™ Development Environment on xilinx.comSee Vitis™ AI Development Environment on xilinx.com |
This section walks you through the flow of porting your command line project to the Vitis IDE project. One advantage of porting the design from command line to the IDE project is to use the debug capabilities of the GUI-based project both at an AI Engine level and at a system level.
- Before beginning this section of tutorial, it is expected that you have run the steps to set the environment variables as described in Introduction.
- Clone the GIT repository, and navigate to the
09-debug-walkthroughtutorial directory.
-
Open the Vitis IDE tool by typing
vitisin the console, set the workspace, and the IDE opens withWelcomepage. -
Select the Create Application Project and click Next.
-
Select the
xilinx_vck190_base_20xxx0_1platform from the list of platforms, and click Next. -
Enter the Application project as
PeakDetect, and click Next. -
Leave the domain as
aiengine, and click Next. -
Select the Empty Application and Finish.
-
The Application project gets created as follows.
- Expand the
PeakDetectAI Engine domain project, right-click thesrcdirectory, and choose Import Source. - Browse to the
cmd_src/aie/directory, and tick the/aieon left side, that enablesgraph.h,graph.cppfiles along with the kernel sources inkernels/directory. - Click Finish, and observe the sources added to the
PeakDetectAI Engine domain project. - Now add the input stimulus. Right-click the
data/directory -> Import sources -> browse tocmd_src/datadirectory, and choose theinx.txtfile. - Right-click the AI Engine domain project, and select the C++ Build settings. Navigate to the Input Spec, and add
../src/kernelsin the include paths.>
- You can click No in the dialog box that opens. Double-click the PeakDetect.prj file under the AI Engine domain project, and click
Click to select Top-level File. Expand thePeakDetect/src/, and select thegraph.cppfile. Click OK.
The AI Engine domain project is ready to build.
NOTE: When you change the build target from
Emulation-AIE(default) toEmulation-SW, make sure to repeat the step 5.
In this step, you will add the PL kernels, s2mm and mm2s.
- To add the PL kernels, right-click the PeakDetect_system project, and select Add Hw kernel Project.
- Name the Hw kernel project name as PeakDetect_PL, and click Finish.
- Observe the PeakDetect_PL gets added to the system project.
- Right-click the PeakDetect_PL -> src, and select Import sources. Browse to
cmd_src/pl_kernels/, and select Open. - Select both
mm2s.cppands2mm.cpp. Click the Finish button. - Double click the PeakDetect_PL -> PeakDetect_PL.prj, and in the project settings, select the Add Hardware Function.
- Choose the mm2s and s2mm functions, and click OK. Observe the hardware function gets added as follows.
-
Double click the PeakDetect_system_hw_link -> PeakDetect_system_hw_link.prj, and change the number of compute units for
s2mmas2by double-clicking and editing the value. This is because for the design, there is one input PLIO port and two output PLIO ports. -
Specify the
system.cfgfile that contains the connections between the PL and AI Engine kernels. To do this, right-click thebinary_container_1, and select Edit V++ Options.Add the v++ command line option
--config ../system.cfgas shown below and click Apply and Close. -
Right-click the PeakDetect_system_hw_link, and select Import sources.
-
Browse to the
cmd_srcdirectory, and choose thesystem.cfgfile. In the Into folder field, browse to the hw_link project. -
Click Finish.
-
While creating a HW-link project, by default, the Vitis IDE tool creates the
binary_container_1-link.cfgfile under{$PROJECT}/{BUILD_TARGET}/that contains the connectivity.[connectivity] nk=mm2s:1:mm2s_1 nk=s2mm:2:s2mm_1.s2mm_2To port a command line project to a Vitis IDE environment, make sure to remove the above connectivity statements that starts with
nkin yoursystem.cfgfile. Also make sure the compute unit names insystem.cfgfile matches with the names mentioned inconnectivity. To do this, use the following steps. -
Double-click the
system.cfgfile, and modify thesc=mm2s.s:ai_engine_0.inxtosc=mm2s_1.s:ai_engine_0.inx.
-
To add the host application project, right-click the PeakDetect_system project, and select Add Application Project.
-
Enter the Application project name as PeakDetect_host, and leave the target processor selected as
psv-cortexa72 SMP. -
In the Application settings, add
sysroot path,Root FSandKernel Imageby clicking Browse in each section, and click Next. -
Select Empty Application in the Template selection window, and click Finish.
-
Now import sources by right-clicking the PeakDetect_host -> src, browse to the
cmd_src/sw/directory, and choose the fileshost.cppanddata.h. -
Click Finish.
-
Now, right-click the PeakDetect_host, select C++ build settings, and add linker option
-
Click Apply and Close.
NOTE: When you change the build target from
Emulation-SW(default) toEmulation-HWorHardware, make sure to repeat step 7.
-
Double-click PeakDetect_system -> PeakDetect_system.sprj, and set the
sysroot,Root FS, andKernel Image. Also set the package options.As the AI Engine graph is being loaded by the host PS application, we can defer the running of the graph after the graph has been loaded using the
xrt::graphAPI. By default, the AMD platform management controller (PMC) loads and runs the graph. However the v++--package.defer_aie_runoption will let you defer the graph run until after the graph has been loaded using thexrt::graphAPI.NOTE: When you change the build target from
Emulation-SW(default) toEmulation-HWorHardware, make sure to repeat the step-35.This creates the system project which can be used to build and run for all the targets.
GitHub issues will be used for tracking requests and bugs. For questions, go to support.xilinx.com.
Copyright © 2020–2023 Advanced Micro Devices, Inc
