-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_xsa.tcl
43 lines (32 loc) · 1.21 KB
/
create_xsa.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# Generate HW
#
set PRJ_DIR _vivado
set PRJ_NAME sd_blk
set BD_NAME system
set SRC_DIR src
# Num. of parallel jobs - change this to suit your environment
set NUM_JOBS 2
# Add board repo path
set_param board.repoPaths $::env(RDI_DATADIR)/xhub/boards/XilinxBoardStore/boards/snickerdoodle-board-files
# Remove existing directory
file delete -force ${PRJ_DIR}
# Create Vivado project
create_project ${PRJ_NAME} ${PRJ_DIR} -part xc7z020clg400-3
set_property board_part krtkl.com:snickerdoodle_black:part0:1.0 [current_project]
# Create block design
source ${SRC_DIR}/bd.tcl
# Set top-level source
make_wrapper -files [get_files ${PRJ_DIR}/${PRJ_NAME}.srcs/sources_1/bd/${BD_NAME}/${BD_NAME}.bd] -top
add_files -norecurse ${PRJ_DIR}/${PRJ_NAME}.srcs/sources_1/bd/${BD_NAME}/hdl/${BD_NAME}_wrapper.v
set_property top ${BD_NAME}_wrapper [current_fileset]
# Generate block design
generate_target all [get_files [current_bd_design].bd]
update_compile_order -fileset sources_1
# Generate bitstream
launch_runs synth_1 -jobs ${NUM_JOBS}
wait_on_run synth_1
launch_runs impl_1 -to_step write_bitstream -jobs ${NUM_JOBS}
wait_on_run impl_1
# Generate .xsa
write_hw_platform -fixed -include_bit -force -file ${PRJ_NAME}.xsa