Files
light-petal-recognition/hls_cnn/scripts/run_hls_qcnn.tcl
T

37 lines
1.4 KiB
Tcl

set script_dir [file normalize [file dirname [info script]]]
set project_root [file normalize [file join $script_dir ".." ".."]]
set hls_root [file normalize [file join $project_root "hls_cnn"]]
set build_root [file normalize [file join $hls_root "build"]]
set ip_repo [file normalize [file join $hls_root "ip_repo"]]
file mkdir $build_root
file mkdir $ip_repo
cd $build_root
open_project -reset "hls_qcnn_hls"
set_top hls_qcnn_accel
add_files [file join $hls_root "src" "hls_qcnn_accel.cpp"] -cflags "-I[file join $hls_root include] -I[file join $hls_root src]"
add_files -tb [file join $hls_root "tb" "hls_qcnn_tb.cpp"] -cflags "-I[file join $hls_root include] -I[file join $hls_root src]"
open_solution -reset "solution1"
set_part {xc7z020clg400-1}
create_clock -period 10 -name default
csim_design
csynth_design
set export_status [catch {
export_design -format ip_catalog -rtl verilog -description "HLS-QCNN DDR accelerator" -vendor "xilinx.com" -library "hls" -version "1.0" -output [file join $ip_repo "hls_qcnn_accel.zip"]
} export_msg]
if {$export_status != 0} {
puts "WARNING: export_design failed: $export_msg"
set ippack_tcl [file join $build_root "hls_qcnn_hls" "solution1" "impl" "ip" "run_ippack.tcl"]
if {![file exists $ippack_tcl]} {
error "export_design failed before run_ippack.tcl was generated"
}
puts "WARNING: continuing after export_design failure; wrapper will patch and package IP"
}
exit