Using Python APIs to Manage AI Engine Components - Using Python APIs to Manage AI Engine Components - 2026.1 English - UG1702

Vitis Reference Guide (UG1702)

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

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:

  1. Create AI Engine Components.

    Use the create_aie_component Python 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.
    Define the template value as "empty" (default) or "empty_aie_component". You can also define the value as the location and name of the AI Engine example, for example "installed_aie_examples/simple". For values of "empty" and "empty_aie_component", Vitis creates the AI Engine component from an empty template.
    Note: Use double quotes (" ") when defining a template value.


    The Python API command is as follows for the example above.

    aie_test_comp = client.create_aie_component(name = aie_component, platform=<abs path of xilinx_vck190_base_202420_1.xpfm>, template="installed_aie_examples/simple")
  2. Import source files into an AI Engine component.

    Use the import_files Python 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_loc path.
  3. Build AI Engine components.

    Use the build Python API to build AI Engine components. The API supports two targets: hw, and x86sim.

    • 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.