################################################################ # This is a generated script based on design: ps1 # # Though there are limitations about the generated script, # the main purpose of this utility is to make learning # IP Integrator Tcl commands easier. ################################################################ namespace eval _tcl { proc get_script_folder {} { set script_path [file normalize [info script]] set script_folder [file dirname $script_path] return $script_folder } } variable script_folder set script_folder [_tcl::get_script_folder] ################################################################ # Check if script is running in correct Vivado version. ################################################################ set scripts_vivado_version 2018.2 set current_vivado_version [version -short] if { [string first $scripts_vivado_version $current_vivado_version] == -1 } { puts "" catch {common::send_msg_id "BD_TCL-109" "ERROR" "This script was generated using Vivado <$scripts_vivado_version> and is being run in <$current_vivado_version> of Vivado. Please run the script in Vivado <$scripts_vivado_version> then open the design in Vivado <$current_vivado_version>. Upgrade the design by running \"Tools => Report => Report IP Status...\", then run write_bd_tcl to create an updated script."} return 1 } ################################################################ # START ################################################################ # To test this script, run the following commands from Vivado Tcl console: # source ps1_script.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 xc7z020clg484-1 set_property BOARD_PART digilentinc.com:eclypse-z7:part0:1.1 [current_project] } # CHANGE DESIGN NAME HERE variable design_name set design_name ps1 # If you do not already have an existing IP Integrator design open, # you can create a design using the following command: # create_bd_design $design_name # Creating design if needed set errMsg "" set nRet 0 set cur_design [current_bd_design -quiet] set list_cells [get_bd_cells -quiet] if { ${design_name} eq "" } { # USE CASES: # 1) Design_name not set set errMsg "Please set the variable to a non-empty value." set nRet 1 } elseif { ${cur_design} ne "" && ${list_cells} eq "" } { # USE CASES: # 2): Current design opened AND is empty AND names same. # 3): Current design opened AND is empty AND names diff; design_name NOT in project. # 4): Current design opened AND is empty AND names diff; design_name exists in project. if { $cur_design ne $design_name } { common::send_msg_id "BD_TCL-001" "INFO" "Changing value of from <$design_name> to <$cur_design> since current design is empty." set design_name [get_property NAME $cur_design] } common::send_msg_id "BD_TCL-002" "INFO" "Constructing design in IPI design <$cur_design>..." } elseif { ${cur_design} ne "" && $list_cells ne "" && $cur_design eq $design_name } { # USE CASES: # 5) Current design opened AND has components AND same names. set errMsg "Design <$design_name> already exists in your project, please set the variable to another value." set nRet 1 } elseif { [get_files -quiet ${design_name}.bd] ne "" } { # USE CASES: # 6) Current opened design, has components, but diff names, design_name exists in project. # 7) No opened design, design_name exists in project. set errMsg "Design <$design_name> already exists in your project, please set the variable to another value." set nRet 2 } else { # USE CASES: # 8) No opened design, design_name not in project. # 9) Current opened design, has components, but diff names, design_name not in project. common::send_msg_id "BD_TCL-003" "INFO" "Currently there is no design <$design_name> in project, so creating one..." create_bd_design $design_name common::send_msg_id "BD_TCL-004" "INFO" "Making design <$design_name> as current_bd_design." current_bd_design $design_name } common::send_msg_id "BD_TCL-005" "INFO" "Currently the variable is equal to \"$design_name\"." if { $nRet != 0 } { catch {common::send_msg_id "BD_TCL-114" "ERROR" $errMsg} return $nRet } set bCheckIPsPassed 1 ################################################################## # CHECK IPs ################################################################## set bCheckIPs 1 if { $bCheckIPs == 1 } { set list_check_ips "\ xilinx.com:ip:axi_bram_ctrl:4.*\ xilinx.com:ip:blk_mem_gen:8.*\ xilinx.com:ip:smartconnect:1.*\ xilinx.com:ip:processing_system7:5.*\ xilinx.com:ip:proc_sys_reset:5.*\ " set list_ips_missing "" common::send_msg_id "BD_TCL-006" "INFO" "Checking if the following IPs exist in the project's IP catalog: $list_check_ips ." foreach ip_vlnv $list_check_ips { set ip_obj [get_ipdefs -all $ip_vlnv] if { $ip_obj eq "" } { lappend list_ips_missing $ip_vlnv } } if { $list_ips_missing ne "" } { catch {common::send_msg_id "BD_TCL-115" "ERROR" "The following IPs are not found in the IP Catalog:\n $list_ips_missing\n\nResolution: Please add the repository containing the IP(s) to the project." } set bCheckIPsPassed 0 } } if { $bCheckIPsPassed != 1 } { common::send_msg_id "BD_TCL-1003" "WARNING" "Will not continue with creation of design due to the error(s) above." return 3 } ################################################################## # DESIGN PROCs ################################################################## # Procedure to create entire design; Provide argument to make # procedure reusable. If parentCell is "", will use root. proc create_root_design { parentCell } { variable script_folder variable design_name if { $parentCell eq "" } { set parentCell [get_bd_cells /] } # Get object for parentCell set parentObj [get_bd_cells $parentCell] if { $parentObj == "" } { catch {common::send_msg_id "BD_TCL-100" "ERROR" "Unable to find parent cell <$parentCell>!"} return } # Make sure parentObj is hier blk set parentType [get_property TYPE $parentObj] if { $parentType ne "hier" } { catch {common::send_msg_id "BD_TCL-101" "ERROR" "Parent <$parentObj> has TYPE = <$parentType>. Expected to be ."} return } # Save current instance; Restore later set oldCurInst [current_bd_instance .] # Set parent object as current current_bd_instance $parentObj # Create interface ports set DDR [ create_bd_intf_port -mode Master -vlnv xilinx.com:interface:ddrx_rtl:1.0 DDR ] set FIXED_IO [ create_bd_intf_port -mode Master -vlnv xilinx.com:display_processing_system7:fixedio_rtl:1.0 FIXED_IO ] # Create ports set FCLK_CLK0 [ create_bd_port -dir O -type clk FCLK_CLK0 ] set FCLK_RESET0_N [ create_bd_port -dir O -type rst FCLK_RESET0_N ] set ext_reset_n [ create_bd_port -dir I -type rst ext_reset_n ] set_property -dict [ list \ CONFIG.POLARITY {ACTIVE_LOW} \ ] $ext_reset_n # Create instance: axi_bram_ctrl, and set properties set axi_bram_ctrl [ create_bd_cell -type ip -vlnv xilinx.com:ip:axi_bram_ctrl:4.* axi_bram_ctrl ] # Create instance: axi_bram_ctrl_bram, and set properties set axi_bram_ctrl_bram [ create_bd_cell -type ip -vlnv xilinx.com:ip:blk_mem_gen:8.* axi_bram_ctrl_bram ] set_property -dict [ list \ CONFIG.Memory_Type {True_Dual_Port_RAM} \ ] $axi_bram_ctrl_bram # Create instance: axi_smc, and set properties set axi_smc [ create_bd_cell -type ip -vlnv xilinx.com:ip:smartconnect:1.* axi_smc ] set_property -dict [ list \ CONFIG.NUM_SI {1} \ ] $axi_smc # Create instance: processing_system7_0, and set properties set processing_system7_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:processing_system7:5.* processing_system7_0 ] set_property -dict [ list \ CONFIG.PCW_ACT_APU_PERIPHERAL_FREQMHZ {666.666687} \ CONFIG.PCW_ACT_CAN0_PERIPHERAL_FREQMHZ {23.8095} \ CONFIG.PCW_ACT_CAN1_PERIPHERAL_FREQMHZ {23.8095} \ CONFIG.PCW_ACT_CAN_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_DCI_PERIPHERAL_FREQMHZ {10.158730} \ CONFIG.PCW_ACT_ENET0_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_ENET1_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_FPGA0_PERIPHERAL_FREQMHZ {100.000000} \ CONFIG.PCW_ACT_FPGA1_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_FPGA2_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_FPGA3_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_I2C_PERIPHERAL_FREQMHZ {50} \ CONFIG.PCW_ACT_PCAP_PERIPHERAL_FREQMHZ {200.000000} \ CONFIG.PCW_ACT_QSPI_PERIPHERAL_FREQMHZ {200.000000} \ CONFIG.PCW_ACT_SDIO_PERIPHERAL_FREQMHZ {20.000000} \ CONFIG.PCW_ACT_SMC_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_SPI_PERIPHERAL_FREQMHZ {10.000000} \ CONFIG.PCW_ACT_TPIU_PERIPHERAL_FREQMHZ {200.000000} \ CONFIG.PCW_ACT_TTC0_CLK0_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ACT_TTC0_CLK1_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ACT_TTC0_CLK2_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ACT_TTC1_CLK0_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ACT_TTC1_CLK1_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ACT_TTC1_CLK2_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ACT_TTC_PERIPHERAL_FREQMHZ {50} \ CONFIG.PCW_ACT_UART_PERIPHERAL_FREQMHZ {100.000000} \ CONFIG.PCW_ACT_USB0_PERIPHERAL_FREQMHZ {60} \ CONFIG.PCW_ACT_USB1_PERIPHERAL_FREQMHZ {60} \ CONFIG.PCW_ACT_WDT_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_APU_CLK_RATIO_ENABLE {6:2:1} \ CONFIG.PCW_APU_PERIPHERAL_FREQMHZ {666.666666} \ CONFIG.PCW_ARMPLL_CTRL_FBDIV {40} \ CONFIG.PCW_CAN0_BASEADDR {0xE0008000} \ CONFIG.PCW_CAN0_GRP_CLK_ENABLE {0} \ CONFIG.PCW_CAN0_HIGHADDR {0xE0008FFF} \ CONFIG.PCW_CAN0_PERIPHERAL_CLKSRC {External} \ CONFIG.PCW_CAN0_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_CAN0_PERIPHERAL_FREQMHZ {-1} \ CONFIG.PCW_CAN1_BASEADDR {0xE0009000} \ CONFIG.PCW_CAN1_GRP_CLK_ENABLE {0} \ CONFIG.PCW_CAN1_HIGHADDR {0xE0009FFF} \ CONFIG.PCW_CAN1_PERIPHERAL_CLKSRC {External} \ CONFIG.PCW_CAN1_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_CAN1_PERIPHERAL_FREQMHZ {-1} \ CONFIG.PCW_CAN_PERIPHERAL_CLKSRC {IO PLL} \ CONFIG.PCW_CAN_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_CAN_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_CAN_PERIPHERAL_FREQMHZ {100} \ CONFIG.PCW_CAN_PERIPHERAL_VALID {0} \ CONFIG.PCW_CLK0_FREQ {100000000} \ CONFIG.PCW_CLK1_FREQ {10000000} \ CONFIG.PCW_CLK2_FREQ {10000000} \ CONFIG.PCW_CLK3_FREQ {10000000} \ CONFIG.PCW_CORE0_FIQ_INTR {0} \ CONFIG.PCW_CORE0_IRQ_INTR {0} \ CONFIG.PCW_CORE1_FIQ_INTR {0} \ CONFIG.PCW_CORE1_IRQ_INTR {0} \ CONFIG.PCW_CPU_CPU_6X4X_MAX_RANGE {667} \ CONFIG.PCW_CPU_CPU_PLL_FREQMHZ {1333.333} \ CONFIG.PCW_CPU_PERIPHERAL_CLKSRC {ARM PLL} \ CONFIG.PCW_CPU_PERIPHERAL_DIVISOR0 {2} \ CONFIG.PCW_CRYSTAL_PERIPHERAL_FREQMHZ {33.333333} \ CONFIG.PCW_DCI_PERIPHERAL_CLKSRC {DDR PLL} \ CONFIG.PCW_DCI_PERIPHERAL_DIVISOR0 {15} \ CONFIG.PCW_DCI_PERIPHERAL_DIVISOR1 {7} \ CONFIG.PCW_DCI_PERIPHERAL_FREQMHZ {10.159} \ CONFIG.PCW_DDRPLL_CTRL_FBDIV {32} \ CONFIG.PCW_DDR_DDR_PLL_FREQMHZ {1066.667} \ CONFIG.PCW_DDR_HPRLPR_QUEUE_PARTITION {HPR(0)/LPR(32)} \ CONFIG.PCW_DDR_HPR_TO_CRITICAL_PRIORITY_LEVEL {15} \ CONFIG.PCW_DDR_LPR_TO_CRITICAL_PRIORITY_LEVEL {2} \ CONFIG.PCW_DDR_PERIPHERAL_CLKSRC {DDR PLL} \ CONFIG.PCW_DDR_PERIPHERAL_DIVISOR0 {2} \ CONFIG.PCW_DDR_PORT0_HPR_ENABLE {0} \ CONFIG.PCW_DDR_PORT1_HPR_ENABLE {0} \ CONFIG.PCW_DDR_PORT2_HPR_ENABLE {0} \ CONFIG.PCW_DDR_PORT3_HPR_ENABLE {0} \ CONFIG.PCW_DDR_RAM_BASEADDR {0x00100000} \ CONFIG.PCW_DDR_RAM_HIGHADDR {0x3FFFFFFF} \ CONFIG.PCW_DDR_WRITE_TO_CRITICAL_PRIORITY_LEVEL {2} \ CONFIG.PCW_DM_WIDTH {4} \ CONFIG.PCW_DQS_WIDTH {4} \ CONFIG.PCW_DQ_WIDTH {32} \ CONFIG.PCW_ENET0_BASEADDR {0xE000B000} \ CONFIG.PCW_ENET0_GRP_MDIO_ENABLE {0} \ CONFIG.PCW_ENET0_HIGHADDR {0xE000BFFF} \ CONFIG.PCW_ENET0_PERIPHERAL_CLKSRC {IO PLL} \ CONFIG.PCW_ENET0_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_ENET0_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_ENET0_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_ENET0_PERIPHERAL_FREQMHZ {1000 Mbps} \ CONFIG.PCW_ENET0_RESET_ENABLE {0} \ CONFIG.PCW_ENET1_BASEADDR {0xE000C000} \ CONFIG.PCW_ENET1_GRP_MDIO_ENABLE {0} \ CONFIG.PCW_ENET1_HIGHADDR {0xE000CFFF} \ CONFIG.PCW_ENET1_PERIPHERAL_CLKSRC {IO PLL} \ CONFIG.PCW_ENET1_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_ENET1_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_ENET1_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_ENET1_PERIPHERAL_FREQMHZ {1000 Mbps} \ CONFIG.PCW_ENET1_RESET_ENABLE {0} \ CONFIG.PCW_ENET_RESET_ENABLE {0} \ CONFIG.PCW_ENET_RESET_POLARITY {Active Low} \ CONFIG.PCW_EN_4K_TIMER {0} \ CONFIG.PCW_EN_CAN0 {0} \ CONFIG.PCW_EN_CAN1 {0} \ CONFIG.PCW_EN_CLK0_PORT {1} \ CONFIG.PCW_EN_CLK1_PORT {0} \ CONFIG.PCW_EN_CLK2_PORT {0} \ CONFIG.PCW_EN_CLK3_PORT {0} \ CONFIG.PCW_EN_CLKTRIG0_PORT {0} \ CONFIG.PCW_EN_CLKTRIG1_PORT {0} \ CONFIG.PCW_EN_CLKTRIG2_PORT {0} \ CONFIG.PCW_EN_CLKTRIG3_PORT {0} \ CONFIG.PCW_EN_DDR {1} \ CONFIG.PCW_EN_EMIO_CAN0 {0} \ CONFIG.PCW_EN_EMIO_CAN1 {0} \ CONFIG.PCW_EN_EMIO_CD_SDIO0 {0} \ CONFIG.PCW_EN_EMIO_CD_SDIO1 {0} \ CONFIG.PCW_EN_EMIO_ENET0 {0} \ CONFIG.PCW_EN_EMIO_ENET1 {0} \ CONFIG.PCW_EN_EMIO_GPIO {0} \ CONFIG.PCW_EN_EMIO_I2C0 {0} \ CONFIG.PCW_EN_EMIO_I2C1 {0} \ CONFIG.PCW_EN_EMIO_MODEM_UART0 {0} \ CONFIG.PCW_EN_EMIO_MODEM_UART1 {0} \ CONFIG.PCW_EN_EMIO_PJTAG {0} \ CONFIG.PCW_EN_EMIO_SDIO0 {0} \ CONFIG.PCW_EN_EMIO_SDIO1 {0} \ CONFIG.PCW_EN_EMIO_SPI0 {0} \ CONFIG.PCW_EN_EMIO_SPI1 {0} \ CONFIG.PCW_EN_EMIO_SRAM_INT {0} \ CONFIG.PCW_EN_EMIO_TRACE {0} \ CONFIG.PCW_EN_EMIO_TTC0 {0} \ CONFIG.PCW_EN_EMIO_TTC1 {0} \ CONFIG.PCW_EN_EMIO_UART0 {0} \ CONFIG.PCW_EN_EMIO_UART1 {0} \ CONFIG.PCW_EN_EMIO_WDT {0} \ CONFIG.PCW_EN_EMIO_WP_SDIO0 {0} \ CONFIG.PCW_EN_EMIO_WP_SDIO1 {0} \ CONFIG.PCW_EN_ENET0 {0} \ CONFIG.PCW_EN_ENET1 {0} \ CONFIG.PCW_EN_GPIO {0} \ CONFIG.PCW_EN_I2C0 {0} \ CONFIG.PCW_EN_I2C1 {0} \ CONFIG.PCW_EN_MODEM_UART0 {0} \ CONFIG.PCW_EN_MODEM_UART1 {0} \ CONFIG.PCW_EN_PJTAG {0} \ CONFIG.PCW_EN_PTP_ENET0 {0} \ CONFIG.PCW_EN_PTP_ENET1 {0} \ CONFIG.PCW_EN_QSPI {1} \ CONFIG.PCW_EN_RST0_PORT {1} \ CONFIG.PCW_EN_RST1_PORT {0} \ CONFIG.PCW_EN_RST2_PORT {0} \ CONFIG.PCW_EN_RST3_PORT {0} \ CONFIG.PCW_EN_SDIO0 {1} \ CONFIG.PCW_EN_SDIO1 {0} \ CONFIG.PCW_EN_SMC {0} \ CONFIG.PCW_EN_SPI0 {0} \ CONFIG.PCW_EN_SPI1 {0} \ CONFIG.PCW_EN_TRACE {0} \ CONFIG.PCW_EN_TTC0 {0} \ CONFIG.PCW_EN_TTC1 {0} \ CONFIG.PCW_EN_UART0 {1} \ CONFIG.PCW_EN_UART1 {0} \ CONFIG.PCW_EN_USB0 {0} \ CONFIG.PCW_EN_USB1 {0} \ CONFIG.PCW_EN_WDT {0} \ CONFIG.PCW_FCLK0_PERIPHERAL_CLKSRC {IO PLL} \ CONFIG.PCW_FCLK0_PERIPHERAL_DIVISOR0 {4} \ CONFIG.PCW_FCLK0_PERIPHERAL_DIVISOR1 {3} \ CONFIG.PCW_FCLK1_PERIPHERAL_CLKSRC {IO PLL} \ CONFIG.PCW_FCLK1_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK1_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK2_PERIPHERAL_CLKSRC {IO PLL} \ CONFIG.PCW_FCLK2_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK2_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK3_PERIPHERAL_CLKSRC {IO PLL} \ CONFIG.PCW_FCLK3_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK3_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK_CLK0_BUF {TRUE} \ CONFIG.PCW_FCLK_CLK1_BUF {FALSE} \ CONFIG.PCW_FCLK_CLK2_BUF {FALSE} \ CONFIG.PCW_FCLK_CLK3_BUF {FALSE} \ CONFIG.PCW_FPGA0_PERIPHERAL_FREQMHZ {100} \ CONFIG.PCW_FPGA1_PERIPHERAL_FREQMHZ {50} \ CONFIG.PCW_FPGA2_PERIPHERAL_FREQMHZ {50} \ CONFIG.PCW_FPGA3_PERIPHERAL_FREQMHZ {50} \ CONFIG.PCW_FPGA_FCLK0_ENABLE {1} \ CONFIG.PCW_FPGA_FCLK1_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK2_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK3_ENABLE {0} \ CONFIG.PCW_GP0_EN_MODIFIABLE_TXN {1} \ CONFIG.PCW_GP0_NUM_READ_THREADS {4} \ CONFIG.PCW_GP0_NUM_WRITE_THREADS {4} \ CONFIG.PCW_GP1_EN_MODIFIABLE_TXN {1} \ CONFIG.PCW_GP1_NUM_READ_THREADS {4} \ CONFIG.PCW_GP1_NUM_WRITE_THREADS {4} \ CONFIG.PCW_GPIO_BASEADDR {0xE000A000} \ CONFIG.PCW_GPIO_EMIO_GPIO_ENABLE {0} \ CONFIG.PCW_GPIO_EMIO_GPIO_WIDTH {64} \ CONFIG.PCW_GPIO_HIGHADDR {0xE000AFFF} \ CONFIG.PCW_GPIO_MIO_GPIO_ENABLE {0} \ CONFIG.PCW_GPIO_MIO_GPIO_IO {