The Vitis Unified IDE supports Python APIs to create and build a system project. After creating the platform component and application component, the system project is created. You can then add the application components to the system project and build them. You can build host components individually. When Python APIs trigger the system project build, Vitis builds all the components associated with the system.
| Python API | Description | Python API Example |
|---|---|---|
| create_sys_project | Creates a system project for the given template. 1 |
proj =
client.create_sys_project(name='system_project',
platform=<platform_path>)
|
| add_component | Adds the specified component to the given system project |
proj.add_component(name = "host_component")
|
| build | Initiates the build of a system project for the given build target. |
proj.build(target='hw')
|
|
||
The following is the Python script to create a system project and build for target=Hardware to export Vitis metadata archive:
# Add package: Vitis Python CLI
import vitis
# Create a Vitis client object
client = vitis.create_client()
# Set Vitis Workspace
client.set_workspace(path="./workspace")
# Defining names for platform, application_component and
plat_name="vck190_embd"
comp_name="standalone_embd_app"
# Create and build platform component for vck190 for standalone_psv_cortexa72
platform_obj=client.create_platform_component(name=plat_name, hw_design="vck190", cpu="psv_cortexa72_0", os="standalone")
platform_obj.build()
# This returns the platform xpfm path
platform_xpfm=client.find_platform_in_repos(plat_name)
# Create and build application component
comp = client.create_app_component(name=comp_name, platform = platform_xpfm, domain = "standalone_psv_cortexa72_0", template = "hello_world")
comp.build()
# Create system project
sys_proj = client.create_sys_project(name="system_project", platform=platform_xpfm, template="empty_accelerated_application")
# Add application component to the system project
sys_proj_comp = sys_proj.add_component(name="hello_world")
# Build system project
sys_proj_comp.build()
vitis.dispose()
A few more Python command examples are in <VITIS_INSTALL_DIR>/2025.2/cli/examples.
For more details on all Vitis supported Python APIs, refer to the link: <vitis_install_path>cli/api_docs/build/html/vitis.html