run.tcl 内容如下 :
# ------------------------------------------------------------------------------
# Vitis Vision and OpenCV Libary Path Information
# ------------------------------------------------------------------------------
set XF_PROJ_ROOT "D:/ProgramFiles/xfopencv/Vitis_Libraries-master/vision"
set OPENCV_INCLUDE "D:/ProgramFiles/xfopencv/install-build-ok-opencv/install/include"
set OPENCV_LIB "D:/ProgramFiles/xfopencv/install-build-ok-opencv/install/x64/mingw/lib"
# ------------------------------------------------------------------------------
# PROJECT SETTINGS
# ------------------------------------------------------------------------------
set PROJ_DIR "./"
set PROJ_NAME "shift_led"
set PROJ_TOP_NAME "shift_led.cpp"
set PROJ_TB_NAME "tb.cpp"
set INPUT_PARAM "testcase55.jpg"
# ------------------------------------------------------------------------------
# Vitis HLS Project Information
# ------------------------------------------------------------------------------
set PROJ_TOP "${PROJ_NAME}"
set SOLUTION_NAME "solution1"
set SOLUTION_PART "xczu3eg-sfvc784-1-i"
set SOLUTION_CLKP 10
# ------------------------------------------------------------------------------
# OpenCV C Simulation / CoSimulation Library References
# ------------------------------------------------------------------------------
set VISION_INC_FLAGS "-I $XF_PROJ_ROOT/L1/include -std=c++0x"
set OPENCV_INC_FLAGS "-I $OPENCV_INCLUDE"
set OPENCV_LIB_FLAGS "-L $OPENCV_LIB"
# Windows OpenCV Include Style:
set OPENCV_LIB_REF "-lopencv_imgcodecs341 -lopencv_imgproc341 -lopencv_core341 -lopencv_highgui341 -lopencv_flann341 -lopencv_features2d341"
# Linux OpenCV Include Style:
#set OPENCV_LIB_REF "-lopencv_imgcodecs -lopencv_imgproc -lopencv_core -lopencv_highgui -lopencv_flann -lopencv_features2d"
# ------------------------------------------------------------------------------
# Create Project
# ------------------------------------------------------------------------------
open_project -reset $PROJ_NAME
# ------------------------------------------------------------------------------
# Add C++ source and Testbench files with Vision and OpenCV includes
# ------------------------------------------------------------------------------
add_files "${PROJ_DIR}/source/${PROJ_TOP_NAME}" -cflags "${VISION_INC_FLAGS} -I${PROJ_DIR}/build" -csimflags "${VISION_INC_FLAGS} -I${PROJ_DIR}/build"
add_files -tb "${PROJ_DIR}/source/${PROJ_TB_NAME}" -cflags "${OPENCV_INC_FLAGS} ${VISION_INC_FLAGS} -I${PROJ_DIR}/build" -csimflags "${OPENCV_INC_FLAGS} ${VISION_INC_FLAGS} -I${PROJ_DIR}/build"
# ------------------------------------------------------------------------------
# Create Project and Solution
# ------------------------------------------------------------------------------
set_top $PROJ_TOP
open_solution -reset $SOLUTION_NAME
set_part $SOLUTION_PART
create_clock -period $SOLUTION_CLKP
# ------------------------------------------------------------------------------
# Run Vitis HLS Stages
# Note: CSim and CoSim require datafiles to be included
# ------------------------------------------------------------------------------
csim_design -ldflags "-L ${OPENCV_LIB} ${OPENCV_LIB_REF}" -argv "${PROJ_DIR}/source/${INPUT_PARAM}"
# csynth_design
# cosim_design -ldflags "-L ${OPENCV_LIB} ${OPENCV_LIB_REF}" -argv "${PROJ_DIR}/source/${INPUT_PARAM}"
# export_design -flow syn -rtl verilog
# export_design -flow impl -rtl verilog
Vitis hls使用tcl创建工程
最新推荐文章于 2024-05-20 23:30:51 发布