The Vitis Unified IDE works on the server-client
architecture. To create any component, you must first create a client object. Create the
component using the create_aie_component API of the
client. For more information on using the Python command line interface, see Vitis Interactive Python Shell.
The general steps to manage AI Engine component are as follows:
- Create AI Engine
Components.
Use the
create_aie_componentPython API to create AI Engine components. For example:aie_test_comp = client.create_aie_component(name = aie_component, platform=<abs path of xilinx_vck190_base_202420_1.xpfm>, template="empty_aie_component")Arguments for the API are as follows.
-
name=<aie_component_name> - Name of the AI Engine component.
-
platform=<.xpfm> or <.xsa> - The hardware design for compiling the AI Engine graph. Alternatively, Vitis also supports the device part.
-
template= "empty_aie_component" - You can use a component example from the Installed AI Engine Examples as the template.
-
- Import source files into an AI Engine component.
Use the
import_filesPython API to import the source files. For example:aie_test_comp.import_files(from_loc = sources_dir, files = ['graph.cpp', 'graph.h', 'kernels.h', 'include.h', 'classify.cc', 'hb27_2i.cc'])Arguments for the API are as follows:
-
from_loc=<location of source or configuration file> - The path to the location of the source files can be an absolute path or a relative path to the current working directory. The location can be a directory or a file.
-
files=['file1','file2',...] - List of files to be imported from the
from_locpath.
-
- Build AI Engine
components.
Use the
buildPython API to build AI Engine components. The API supports two targets:hw, andx86sim.- To build the component for AI Engine simulator for hardware, use:
aie_test_comp.build(target="hw") - To build the component for x86 simulator, use:
aie_test_comp.build(target="x86sim")
The default target is
x86sim. - To build the component for AI Engine simulator for hardware, use: