################################################################ # This is a generated script based on design: design_2 # # 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 2017.3 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 design_2_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 em.avnet.com:zed:part0:0.9 [current_project] } # CHANGE DESIGN NAME HERE set design_name design_2 # 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 } ################################################################## # 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 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 axi [ create_bd_intf_port -mode Slave -vlnv xilinx.com:interface:aximm_rtl:1.0 axi ] set_property -dict [ list \ CONFIG.ADDR_WIDTH {32} \ CONFIG.ARUSER_WIDTH {0} \ CONFIG.AWUSER_WIDTH {0} \ CONFIG.BUSER_WIDTH {0} \ CONFIG.DATA_WIDTH {32} \ CONFIG.FREQ_HZ {200000000} \ CONFIG.HAS_BRESP {1} \ CONFIG.HAS_BURST {1} \ CONFIG.HAS_CACHE {1} \ CONFIG.HAS_LOCK {1} \ CONFIG.HAS_PROT {1} \ CONFIG.HAS_QOS {1} \ CONFIG.HAS_REGION {0} \ CONFIG.HAS_RRESP {1} \ CONFIG.HAS_WSTRB {1} \ CONFIG.ID_WIDTH {6} \ CONFIG.MAX_BURST_LENGTH {16} \ CONFIG.NUM_READ_OUTSTANDING {8} \ CONFIG.NUM_READ_THREADS {1} \ CONFIG.NUM_WRITE_OUTSTANDING {8} \ CONFIG.NUM_WRITE_THREADS {1} \ CONFIG.PROTOCOL {AXI3} \ CONFIG.READ_WRITE_MODE {READ_WRITE} \ CONFIG.RUSER_BITS_PER_BYTE {0} \ CONFIG.RUSER_WIDTH {0} \ CONFIG.SUPPORTS_NARROW_BURST {1} \ CONFIG.WUSER_BITS_PER_BYTE {0} \ CONFIG.WUSER_WIDTH {0} \ ] $axi set bus_axi [ create_bd_intf_port -mode Slave -vlnv xilinx.com:interface:aximm_rtl:1.0 bus_axi ] set_property -dict [ list \ CONFIG.ADDR_WIDTH {13} \ CONFIG.ARUSER_WIDTH {0} \ CONFIG.AWUSER_WIDTH {0} \ CONFIG.BUSER_WIDTH {0} \ CONFIG.DATA_WIDTH {32} \ CONFIG.FREQ_HZ {200000000} \ CONFIG.HAS_BRESP {1} \ CONFIG.HAS_BURST {0} \ CONFIG.HAS_CACHE {0} \ CONFIG.HAS_LOCK {0} \ CONFIG.HAS_PROT {0} \ CONFIG.HAS_QOS {0} \ CONFIG.HAS_REGION {0} \ CONFIG.HAS_RRESP {1} \ CONFIG.HAS_WSTRB {1} \ CONFIG.ID_WIDTH {0} \ CONFIG.MAX_BURST_LENGTH {1} \ CONFIG.NUM_READ_OUTSTANDING {1} \ CONFIG.NUM_READ_THREADS {1} \ CONFIG.NUM_WRITE_OUTSTANDING {1} \ CONFIG.NUM_WRITE_THREADS {1} \ CONFIG.PROTOCOL {AXI4LITE} \ CONFIG.READ_WRITE_MODE {READ_WRITE} \ CONFIG.RUSER_BITS_PER_BYTE {0} \ CONFIG.RUSER_WIDTH {0} \ CONFIG.SUPPORTS_NARROW_BURST {0} \ CONFIG.WUSER_BITS_PER_BYTE {0} \ CONFIG.WUSER_WIDTH {0} \ ] $bus_axi set mem_axi [ create_bd_intf_port -mode Master -vlnv xilinx.com:interface:aximm_rtl:1.0 mem_axi ] set_property -dict [ list \ CONFIG.ADDR_WIDTH {32} \ CONFIG.DATA_WIDTH {32} \ CONFIG.FREQ_HZ {200000000} \ CONFIG.PROTOCOL {AXI4} \ ] $mem_axi # Create ports set axi_clk [ create_bd_port -dir I -type clk axi_clk ] set_property -dict [ list \ CONFIG.ASSOCIATED_BUSIF {bus_axi:axi:mem_axi} \ CONFIG.FREQ_HZ {200000000} \ ] $axi_clk set processor_clk [ create_bd_port -dir O processor_clk ] set processor_reset [ create_bd_port -dir O processor_reset ] set resetn [ create_bd_port -dir I -type rst resetn ] set sin [ create_bd_port -dir I sin ] set sout [ create_bd_port -dir O sout ] # Create instance: axi_interconnect_0, and set properties set axi_interconnect_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axi_interconnect:2.1 axi_interconnect_0 ] set_property -dict [ list \ CONFIG.NUM_MI {1} \ ] $axi_interconnect_0 # Create instance: axi_uart16550_0, and set properties set axi_uart16550_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:axi_uart16550:2.0 axi_uart16550_0 ] set_property -dict [ list \ CONFIG.C_EXTERNAL_XIN_CLK_HZ {25000000} \ CONFIG.C_S_AXI_ACLK_FREQ_HZ {200000000} \ ] $axi_uart16550_0 # Need to retain value_src of defaults set_property -dict [ list \ CONFIG.C_EXTERNAL_XIN_CLK_HZ.VALUE_SRC {DEFAULT} \ ] $axi_uart16550_0 # Create instance: microblaze_0_axi_periph, and set properties set microblaze_0_axi_periph [ create_bd_cell -type ip -vlnv xilinx.com:ip:axi_interconnect:2.1 microblaze_0_axi_periph ] set_property -dict [ list \ CONFIG.NUM_MI {1} \ ] $microblaze_0_axi_periph # Create instance: rst_clk_wiz_1_100M, and set properties set rst_clk_wiz_1_100M [ create_bd_cell -type ip -vlnv xilinx.com:ip:proc_sys_reset:5.0 rst_clk_wiz_1_100M ] # Create interface connections connect_bd_intf_net -intf_net S00_AXI_1 [get_bd_intf_ports bus_axi] [get_bd_intf_pins microblaze_0_axi_periph/S00_AXI] connect_bd_intf_net -intf_net S00_AXI_2 [get_bd_intf_ports axi] [get_bd_intf_pins axi_interconnect_0/S00_AXI] connect_bd_intf_net -intf_net axi_interconnect_0_M00_AXI [get_bd_intf_ports mem_axi] [get_bd_intf_pins axi_interconnect_0/M00_AXI] connect_bd_intf_net -intf_net microblaze_0_axi_periph_M00_AXI [get_bd_intf_pins axi_uart16550_0/S_AXI] [get_bd_intf_pins microblaze_0_axi_periph/M00_AXI] # Create port connections connect_bd_net -net axi_uart16550_0_sout [get_bd_ports sout] [get_bd_pins axi_uart16550_0/sout] connect_bd_net -net microblaze_0_Clk [get_bd_ports axi_clk] [get_bd_ports processor_clk] [get_bd_pins axi_interconnect_0/ACLK] [get_bd_pins axi_interconnect_0/M00_ACLK] [get_bd_pins axi_interconnect_0/S00_ACLK] [get_bd_pins axi_uart16550_0/s_axi_aclk] [get_bd_pins microblaze_0_axi_periph/ACLK] [get_bd_pins microblaze_0_axi_periph/M00_ACLK] [get_bd_pins microblaze_0_axi_periph/S00_ACLK] [get_bd_pins rst_clk_wiz_1_100M/slowest_sync_clk] connect_bd_net -net resetn_1 [get_bd_ports resetn] [get_bd_pins rst_clk_wiz_1_100M/ext_reset_in] connect_bd_net -net rst_clk_wiz_1_100M_interconnect_aresetn [get_bd_pins microblaze_0_axi_periph/ARESETN] [get_bd_pins rst_clk_wiz_1_100M/interconnect_aresetn] connect_bd_net -net rst_clk_wiz_1_100M_mb_reset [get_bd_ports processor_reset] [get_bd_pins rst_clk_wiz_1_100M/mb_reset] connect_bd_net -net rst_clk_wiz_1_100M_peripheral_aresetn [get_bd_pins axi_interconnect_0/ARESETN] [get_bd_pins axi_interconnect_0/M00_ARESETN] [get_bd_pins axi_interconnect_0/S00_ARESETN] [get_bd_pins axi_uart16550_0/s_axi_aresetn] [get_bd_pins microblaze_0_axi_periph/M00_ARESETN] [get_bd_pins microblaze_0_axi_periph/S00_ARESETN] [get_bd_pins rst_clk_wiz_1_100M/peripheral_aresetn] connect_bd_net -net sin_1 [get_bd_ports sin] [get_bd_pins axi_uart16550_0/sin] # Create address segments create_bd_addr_seg -range 0x10000000 -offset 0x80000000 [get_bd_addr_spaces axi] [get_bd_addr_segs mem_axi/Reg] SEG_M00_AXI_Reg create_bd_addr_seg -range 0x00002000 -offset 0x00000000 [get_bd_addr_spaces bus_axi] [get_bd_addr_segs axi_uart16550_0/S_AXI/Reg] SEG_axi_uart16550_0_Reg # Perform GUI Layout regenerate_bd_layout -layout_string { guistr: "# # String gsaved with Nlview 6.6.5b 2016-09-06 bk=1.3687 VDI=39 GEI=35 GUI=JA:1.6 # -string -flagsOSRD preplace port bus_axi -pg 1 -y 30 -defaultsOSRD preplace port processor_clk -pg 1 -y 500 -defaultsOSRD preplace port sin -pg 1 -y 440 -defaultsOSRD preplace port resetn -pg 1 -y 100 -defaultsOSRD preplace port axi -pg 1 -y 250 -defaultsOSRD preplace port sout -pg 1 -y 280 -defaultsOSRD preplace port processor_reset -pg 1 -y 460 -defaultsOSRD preplace port axi_clk -pg 1 -y 170 -defaultsOSRD preplace port mem_axi -pg 1 -y 310 -defaultsOSRD preplace inst microblaze_0_axi_periph -pg 1 -lvl 3 -y 90 -defaultsOSRD preplace inst axi_interconnect_0 -pg 1 -lvl 1 -y 310 -defaultsOSRD preplace inst rst_clk_wiz_1_100M -pg 1 -lvl 2 -y 80 -defaultsOSRD preplace inst axi_uart16550_0 -pg 1 -lvl 2 -y 270 -defaultsOSRD preplace netloc sin_1 1 0 3 NJ 440 NJ 440 1060 preplace netloc microblaze_0_Clk 1 0 4 -40 -30 340J -30 1090 -30 1410 preplace netloc axi_uart16550_0_sout 1 2 2 N 280 NJ preplace netloc microblaze_0_axi_periph_M00_AXI 1 1 3 350 -70 NJ -70 1400 preplace netloc resetn_1 1 0 2 -30J 60 N preplace netloc rst_clk_wiz_1_100M_interconnect_aresetn 1 2 1 1080 preplace netloc S00_AXI_1 1 0 3 -50J -10 NJ -10 1070J preplace netloc rst_clk_wiz_1_100M_peripheral_aresetn 1 0 3 -30 430 350 430 1100 preplace netloc rst_clk_wiz_1_100M_mb_reset 1 2 2 1070 460 NJ preplace netloc axi_interconnect_0_M00_AXI 1 1 3 340J 350 NJ 350 1420J preplace netloc S00_AXI_2 1 0 1 N levelinfo -pg 1 -70 200 890 1260 1450 -top -110 -bot 1110 ", } # Restore current instance current_bd_instance $oldCurInst save_bd_design } # End of create_root_design() ################################################################## # MAIN FLOW ################################################################## create_root_design ""