Skip to content

Commit 7b425c5

Browse files
GiuseppeDiGuglielmojmduarte
authored andcommitted
Update Vivado to integrate a VivadoAccelerator on Pynq-Z2
1 parent 4d44359 commit 7b425c5

File tree

1 file changed

+93
-1
lines changed

1 file changed

+93
-1
lines changed
Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,93 @@
1-
puts("This is a placeholder!")
1+
set tcldir [file dirname [info script]]
2+
source [file join $tcldir project.tcl]
3+
4+
# Project names
5+
set design_name "design_1"
6+
set hls_solution_name "solution1"
7+
set ps_name "processing_system7_0"
8+
set acc_name "${project_name}_axi_0"
9+
10+
# Board and chip part names
11+
create_project ${project_name} ${project_name}_vivado_accelerator -part xc7z020clg400-1 -force
12+
set_property board_part tul.com.tw:pynq-z2:part0:1.0 [current_project]
13+
14+
# Create block design
15+
create_bd_design ${design_name}
16+
17+
# Setup IP repo
18+
#set_property ip_repo_paths ${project_name}_prj [current_project]
19+
set_property ip_repo_paths ${project_name}_prj/${hls_solution_name}/impl/ip [current_project]
20+
update_ip_catalog
21+
22+
# Create and setup PS
23+
create_bd_cell -type ip -vlnv xilinx.com:ip:processing_system7:5.5 ${ps_name}
24+
apply_bd_automation -rule xilinx.com:bd_rule:processing_system7 -config " \
25+
make_external {FIXED_IO, DDR} \
26+
apply_board_preset {1} \
27+
Master {Disable} \
28+
Slave {Disable} " [get_bd_cells ${ps_name}]
29+
set_property -dict [list \
30+
CONFIG.PCW_USE_S_AXI_GP0 {1} \
31+
CONFIG.PCW_USE_FABRIC_INTERRUPT {1} \
32+
CONFIG.PCW_IRQ_F2P_INTR {1}\
33+
] [get_bd_cells ${ps_name}]
34+
35+
# Create accelerator
36+
create_bd_cell -type ip -vlnv xilinx.com:hls:myproject_axi:1.0 ${acc_name}
37+
38+
# Wiring
39+
apply_bd_automation -rule xilinx.com:bd_rule:axi4 -config " \
40+
Clk_master {Auto} \
41+
Clk_slave {Auto} \
42+
Clk_xbar {Auto} \
43+
Master /${ps_name}/M_AXI_GP0 \
44+
Slave /${acc_name}/s_axi_CTRL_BUS \
45+
intc_ip {New AXI Interconnect} \
46+
master_apm {0}" [get_bd_intf_pins ${acc_name}/s_axi_CTRL_BUS]
47+
48+
apply_bd_automation -rule xilinx.com:bd_rule:axi4 -config " \
49+
Clk_master {Auto} \
50+
Clk_slave {Auto} \
51+
Clk_xbar {Auto} \
52+
Master /${acc_name}/m_axi_IN_BUS \
53+
Slave /${ps_name}/S_AXI_GP0 \
54+
intc_ip {Auto} \
55+
master_apm {0}" [get_bd_intf_pins ${ps_name}/S_AXI_GP0]
56+
57+
apply_bd_automation -rule xilinx.com:bd_rule:axi4 -config " \
58+
Clk_master /${ps_name}/FCLK_CLK0 (100 MHz) \
59+
Clk_slave /${ps_name}/FCLK_CLK0 (100 MHz) \
60+
Clk_xbar /${ps_name}/FCLK_CLK0 (100 MHz) \
61+
Master /${acc_name}/m_axi_OUT_BUS \
62+
Slave /${ps_name}/S_AXI_GP0 \
63+
intc_ip {/axi_smc} \
64+
master_apm {0}" [get_bd_intf_pins ${acc_name}/m_axi_OUT_BUS]
65+
66+
# Wiring interrupt signal
67+
connect_bd_net [get_bd_pins ${acc_name}/interrupt] [get_bd_pins ${ps_name}/IRQ_F2P]
68+
69+
# Top level wrapper
70+
make_wrapper -files [get_files ./${project_name}_vivado_accelerator/${project_name}.srcs/sources_1/bd/${design_name}/${design_name}.bd] -top
71+
add_files -norecurse ./${project_name}_vivado_accelerator/${project_name}.srcs/sources_1/bd/${design_name}/hdl/${design_name}_wrapper.v
72+
73+
# Memory mapping
74+
delete_bd_objs [get_bd_addr_segs ${project_name}/Data_m_axi_IN_BUS/SEG_${ps_name}_GP0_QSPI_LINEAR]
75+
delete_bd_objs [get_bd_addr_segs -excluded ${acc_name}/Data_m_axi_IN_BUS/SEG_${ps_name}_GP0_IOP]
76+
delete_bd_objs [get_bd_addr_segs -excluded ${acc_name}/Data_m_axi_IN_BUS/SEG_${ps_name}_GP0_M_AXI_GP0]
77+
delete_bd_objs [get_bd_addr_segs ${acc_name}/Data_m_axi_OUT_BUS/SEG_${ps_name}_GP0_QSPI_LINEAR]
78+
delete_bd_objs [get_bd_addr_segs -excluded ${acc_name}/Data_m_axi_OUT_BUS/SEG_${ps_name}_GP0_IOP]
79+
delete_bd_objs [get_bd_addr_segs -excluded ${acc_name}/Data_m_axi_OUT_BUS/SEG_${ps_name}_GP0_M_AXI_GP0]
80+
81+
# Run synthesis and implementation
82+
reset_run impl_1
83+
reset_run synth_1
84+
launch_runs impl_1 -to_step write_bitstream -jobs 6
85+
wait_on_run -timeout 360 impl_1
86+
87+
# Reporting
88+
open_run impl_1
89+
report_utilization -file util.rpt -hierarchical -hierarchical_percentages
90+
91+
# Export HDF file for SDK flow
92+
file mkdir ./hdf
93+
file copy -force ${project_name}_vivado_accelerator/${project_name}.runs/impl_1/${design_name}_wrapper.sysdef ./hdf/${design_name}_wrapper.hdf

0 commit comments

Comments
 (0)