tcl(tool command language)是一种功能强大的脚本语言。
下面以PL1000basex的block design导出的.tcl为例进行讲述。
新建工程
# If there is no project opened, this script will create a
# project, but make sure you do not have an existing project
# <./myproj/project_1.xpr> in the current working folder.
set list_projs [get_projects -quiet]
if { $list_projs eq "" } {
create_project project_1 myproj -part xc7z035ffg676-2
}
上面的tcl命令的含义是,如果没有在一个工程里运行该tcl命令,则它会创建一个新的工程,并将名字设为“project_1”,器件设为“ xc7z035ffg676-2”.
设置 design name
# CHANGE DESIGN NAME HERE
variable design_name
set design_name PL1000basex
创建系统IP的实例
# Create instance: phy_addr_2, and set properties
set phy_addr_2 [ create_bd_cell -type ip -vlnv xilinx.com:ip:xlconstant:1.1 phy_addr_2 ]
set_property -dict [ list \
CONFIG.CONST_VAL {2} \
CONFIG.CONST_WIDTH {5} \
] $phy_addr_2
可以看出,在创建实例的时候进行了配置,如位宽和值。
信号连接
# Create interface connections
connect_bd_intf_net -intf_net axi_dma_0_M_AXIS_MM2S [get_bd_intf_pins axi_dma_0/M_AXIS_MM2S] [get_bd_intf_pins upload_fifo/S_AXIS]
端口连接
# Create port connections
connect_bd_net -net Net [get_bd_ports io_pxi_ldata] [get_bd_pins pxi_interface_0/io_pxi_ldata]
分配地址
# Create address segments
create_bd_addr_seg -range 0x40000000 -offset 0x00000000 [get_bd_addr_spaces axi_dma_0/Data_MM2S] [get_bd_addr_segs processing_system7_0/S_AXI_HP0/HP0_DDR_LOWOCM] SEG_processing_system7_0_HP0_DDR_LOWOCM
网友评论