As shown in the figure above, this tutorial contains three AI Engine kernels: Interpolator, Polar_clip, and Classifier. Start by creating the AIE component that will contain the graph and kernels. Run the following steps:
From the main menu select File > New Component > AI Engine
This opens the Create AI Engine Component wizard on the Name and Location page.
Enter the
Component nameas aie_component (default), enter theComponent locationas the workspace (default), and click Next.
This opens the Add Source Files page.
Select
Import Sources > Add Folderand navigate to<tutorial_path>/ 05-AI-engine-versal-integration/aieand click OK.Under
Select top-level fileconfirm thatgraph.cpphas been selected and click Next.
The tool automatically selects the top-level graph from imported files. You just need to make sure it has chosen correctly. Clicking Next opens the Select Part page.
Select the
xilinx_vck190_base_202410_1platform and click Next to open the Summary page.Review the Summary page and click Finish to create the defined AI Engine component.
This results in the aie_component vitis-comp.json file being opened. This is the file associated with the component in the Vitis unified IDE as shown in the following image. The tab at the top will display vitis-comp.json, but it is the aie_component you just created.
Select the aiecompiler.cfg link and open the config file. It contains include statements for the added aie source code folder, and the [aie] section that contains configuration commands such as the xchess statement. Refer to v++ Mode AI Engine for more information on these configuration commands.
In the Vitis Components explorer, expand the aie_component and examine the included sub-folders: Settings, Includes, Sources… Notice the aie folder you imported into the Sources folder.
In the Flow Navigator the aie_component you just created is now the active component. It is currently the only component.
Select the Build command under the X86 Simulation heading.
The tool compiles the aie_component for use with the x86simulator using the following command which is displayed in the aie_component::x86sim Output window:
v++ -c --mode aie --target x86sim --config ./workAIE/aie_component/aiecompiler.cfg –platform ../base_platforms/xilinx_vck190_base_202410_1/xilinx_vck190_base_202410_1.xpfm --work_dir ./workAIE/aie_component/build/x86sim/./Work ./workAIE/aie_component/aie/graph.cpp
| Flag | Description |
|---|---|
| --target | Target how the compiler will build the graph and it is set to x86sim. Default is hw |
| --config | The configuration file containing commands to apply during the build process. |
| --platform | The platform or device to target the build to. |
| --work_dir | The location where the work directory will be created. |
Examine the Output folder of the aie_component in the Vitis Components Explorer. Notice the addition of the x86sim folder with the results of the build. It contains the Work folder, the Makefiles, the aiecompiler.log, and the libadf.a output that contains the compiled AI Engine configuration, graph, and Kernel .elf files.
After building the component the Reports view under the X86 Simulation heading displays the Summary report, the Graph report, Logs, and Guidance. The Summary view displays compilation runtime, version of the compiler used, the platform targeted, kernels created, and the command line used for compilation.
The Graph view provides an overview of your graph and how the graph is designed in a logical fashion. Clicking on any kernel in the graph diagram highlights the corresponding kernel in the GRAPH INSTANCE column. You can open the source code by clicking the file name in the SOURCE column.
You can click Log to view the compilation log for your graph.