The Vitis tool's Python APIs support creating and building HLS components either from scratch or with a template.
| Python API | Description | Python API Example |
|---|---|---|
| create_hls_component | Creates an HLS component | hls_comp = client.create_hls_component(name = <comp_name>, platform = <platform_name>, part = <part>, cfg_file = <cfg_file>, template = <template>) |
| add_cfg_file | Adds a configuration file to the HLS component | status = component.add_cfg_file(cfg_file = <file>) |
| run | Runs a specified operation on the HLS component | status = component.run(operation = <operation_type>) |
The following is a Python script that creates an empty HLS component and
modifies its configuration
file:
import vitis
client = vitis.create_client()
client.set_workspace(path="vitis_2025.2_ws")
comp = client.create_hls_component(name = "mm2s",cfg_file = ["hls_config.cfg"],template = "empty_hls_component")
cfg = client.get_config_file(path="/vitis_2025.2_ws/simple_aie_application_system_project/hw_link/binary_container_1-link.cfg")
cfg = client.get_config_file(path="/vitis_2025.2_ws/mm2s/hls_config.cfg")
cfg.set_value(section="hls", key="syn.compile.clang_version", value="7")
cfg.set_value(section="hls", key="package.output.format", value="rtl")