用于创建内核的 Vitis HLS 脚本 - 2022.1 简体中文

Vitis 统一软件平台文档 应用加速开发 (UG1393)

Document ID
UG1393
Release Date
2022-05-25
Version
2022.1 简体中文

如果您通过 Tcl 脚本运行 HLS 综合,则可通过编辑以下脚本来按前文所述创建 HLS 内核:

# Define variables for your HLS kernel:
set projName <proj_name>
set krnlName <kernel_name>
set krnlFile <kernel_source_code>
set krnlTB <kernel_test_bench>
set krnlPlatform <target_part>
set path <path_to_project>

#Script to create and output HLS kernel
open_project $projName
set_top $krnlName
add_files $krnlFile
add_files -tb $krnlTB
open_solution "solution1"
set_part $krnlPlatform
create_clock -period 10 -name default
config_flow -target vitis
csim_design
csynth_design
cosim_design
export_design -flow impl -format xo -output "./hlsKernel/hlsKernel.xo"

设置 Vitis 环境 中所述方式设置好您的环境后,使用以下命令运行 HLS 内核脚本。

vitis_hls -f <hls_kernel_script>.tcl