Create and Build HLS Component - Create and Build HLS 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 creating and building components using Python APIs. You can use the following Python APIs to build HLS components.

Table 1. Python APIs: HLS Component
Python API Description Python API Example
create_hls_component Create a HLS component hls_comp = client.create_hls_component(name=<hls_comp_name>,cfg_file = ["hls_config.cfg"],template = "empty_hls_component")
add_cfg_file Add configuration file to the component hls_comp_cfg=client.add_cfg_file(cfg_file=<config_file_path.cfg>)
set_value Sets the value of the key (directive) in a specific section of a configuration file. Overwrites earlier values.

hls_comp_cfg.set_values(section='hls', key='clock', values='4')

To set value in config file:

[hls] 
clock=4
run Runs a specified operation on the HLS component hls_comp=run(operation='SYNTHESIS') Operation = SYNTHESIS

The following is the Python script to create and build a HLS component.

# 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 HLS component
hls_comp = client.create_hls_component(name='HLS_comp',cfg_file = ["hls_config.cfg"],template = "empty_hls_component")

# Add Configuration File
hls_comp_cfg = client.add_config_file(cfg_file='/hls_config.cfg')

#Add values to the configuration file
hls_comp_cfg.set_value(key='part', value=part)
hls_comp_cfg.set_value(section='hls', key='clock', value='4')
hls_comp_cfg.set_value(section='hls', key='package.output.syn', value='1')
hls_comp_cfg.set_value(section='hls', key='package.output.format', value='xo')
......

# Build HLS component in Vitis Mode
hls_comp.run(operation="SYNTHESIS")
hls_comp.run(operation="PACKAGE")

After building the HLS component, find the output files with the following command.
workspace/HLS_comp/<kernel_name>/