Create and Build AI Engine Component - Create and Build AI Engine Component - 2026.1 English - UG1702

Vitis Reference Guide (UG1702)

Document ID
UG1702
Release Date
2026-06-23
Version
2026.1 English

The Vitis Unified IDE supports Python APIs for creating and building an AI Engine component.

You can either create and build the component through the GUI or use Python APIs. The following table contains Python APIs AI Engine for creating and building AI Engine components. For details of all Vitis supported Python APIs, refer to <vitis_install_path>cli/api_docs/build/html/vitis.html.

The Vitis Unified IDE does not support multiple config files for creating the component. If you need to use a custom config file to create the component, remove the default configuration file the Vitis tool generates.
  1. Remove the configuration file using the Python command.
    remove_cfg_file('<config_file.cfg>')
  2. Add the custom configuration file using the Python command.
    add_cfg_file('<custom_config_file.cfg>')
Table 1. Python APIs: AI Engine Component
Python API Description Python API Example
create_aie_component Creates an AI Engine component aie_comp=client.create_aie_component(name=my_component, platfrom=<.xpfm or .xsa>, template="empty")
import_files Imports files to the AI Engine component To import files:

aie_comp.import_files(from_loc="<input_folder_path>", files=['file1.cpp','file2.txt'])

To import folders:

aie_comp.import_files(from_loc="<input_folder_path>)
add_cfg_file Adds configuration file to the AI Engine component aie_comp.add_cfg_file('<.cfg file path'>)
remove_cfg_file Removes configuration file from the component. aie_comp.remove_cfg_file('<.cfg file>')
update_top_level_file Updates the top level file of AI Engine component aie_comp.update_top_level_file('<main_graph>.cpp')
build Initiates the build of AI Engine component for x86 and AIESIM/HW

aie_comp.build(target=hw)

For x86 simulator (default): target=x86sim

For hardware: target=hw

report Prints the component information aie_comp.report()
clean Cleans the AI Engine component for the specified build target aie_comp.clean(target=<hw OR x86sim>)
The Python script to create an AI Engine component and build for target=Hardware is described below:
# Add package: Vitis Python CLI
import vitis

# Create a Vitis client object -
client = vitis.create_client()

# Set Vitis Workspace
client.set_workspace(path=<workspace_location>)

# Create aie component.
aie_test_comp = client.create_aie_component(name = comp_name, platform = <absolute path of platform>, template = "empty_aie_component")

# Import source files to the component
aie_test_comp.import_files(from_loc = <absolute path of source folder>, files = ['file1.cpp', 'file2.h', 'file3.h', 'kernel1.cc', 'kernel2.cc'])

# Set top file from the imported source
aie_test_comp.update_top_level_file(top_level_file = 'main_graph.cpp')

# Build component on target Hardware
aie_test_comp.build(target="hw")

# Print component information
aie_test_comp.report()

After the build, you can find the AI Engine component outputs (libadf.a, Work folder etc) at: <workspace>/<comp_name>/build/hw/