Note: This is part 4 of a series on working with FPGAs and in particular the Xilinx Zynq-7000S Programmable System-on-Chip with ARM Cortex-A9 processing core. For part 1, click here: Xilinx ZYNQ System-on-Chip - Getting to know the MiniZed Board
For all parts, click here: Path to Programmable
Introduction
The MiniZedMiniZed is a coaster- (or MiniDisc - who remembers those : ) -sized board containing a Xilinx Zynq chip which contains an FPGA alongside an ARM Cortex-A9 applications processor. Along with my Path to Programmable colleagues I'm doing a training course to get up to speed with it all. The board also contains Flash memory, SDRAM, Wireless, and many other features - for more information, Blog 1 contained a tour of the board.
In the previous couple of blog posts, I covered how to use the hardware development environment (Xilinx Vivado) and the software development environment (called Xilinx SDK) in order to get the ARM processor internally configured to talk to the RAM on the MiniZed circuit board, and to be able to execute simple programs. All of the hardware configuration steps were done using the Vivado graphical interface, which is great, but for a major project you’d want to be able to run custom scripts to save having to click through each time you wanted to make changes and redo things.
There is a scripting language built-in to Vivado, called Tcl. It doesn’t seem to be as popular as Python these days, but there was a point in time (in the 1990’s and early 2000’s) when Tcl was used tremendously by engineers. Although Python overtook it, Tcl can be considered a very mature language and there is lots of documentation and example software out there. An accompanying graphical environment called Tk is also available.
This blog post describes how these scripting features are useful for programmable functionality, automation and backups. These are all the kind of things that are very important for things like working on a commercial project, as part of a team, creating hardware variations and encoding revision numbers into a project, or where version control could be required.
Using Tcl
When using Vivado graphically, Tcl CLI commands appear in a pane. Vivado translates each GUI action into Tcl commands (you can see them in blue in the screenshot below). So, you don’t need to use the GUI, you could just type the commands into the command line bar under the pane yourself.
There is also tab completion, and also all the matches are listed as you type more and more characters in a CLI command. Detailed help information is available too, by prefixing the command with the word help (you’ll want to temporarily maximise the Tcl pane to view the help more easily).
Note that it’s not necessary to type commands in the pane inside Vivado; you could also launch a Tcl shell and execute the commands there, and there are also various options to run script files, including specially named files that will automatically execute at a certain stages in the process, e.g. before synthesis.
Interestingly, you could even create your own graphical user interface using Tcl and Tk, so that it interacts with Vivado. How is this useful? Say, if you had a project which was going to ship in three versions of memory size. You could as part of the build script, have a GUI which appears and prompts the user to select the board size (small/medium/large). The script would then take the results from the GUI, and configure the Zynq chip accordingly.
I still need to learn how to fully do all this (my Tcl knowledge is rusty – and Tk knowledge is almost non-existent) but I cannot imagine it would take long for anyone dedicated. Today I’d much prefer it if Vivado used Python, but it is what it is, and it’s not that hard at picking up another scripting language, to get stuff done.
The documentation for Tcl is available within Vivado's Help menu. Click on Help->Documentation and Tutorials and then in the window that appears, there are hundreds of documents accessible. To narrow down, you could type Tcl in the search box at the top labelled Find in Grid. The relevant documentation for Tcl are document IDs: UG894 and UG835.
Tcl Basics
Here is some example Tcl usage, setting variables and printing Hello World type stuff:
Basic Stuff
set name “Bob” puts “Hello $name” puts {Hello World} set sentence [“Hello $name”]
Doing maths
The expr command is used for this. Note how for the last example here, floating point was forced by typing numbers like 1.0 instead of just 1:
expr {5 * 100} set clockspeed [expr {2*2*333E6}] expr {1.0/10.0}
Using if-else statements
The example here also shows line continuation using a backslash at the end of a line. This is needed if entering Tcl into the single line available in the Vivado Tcl pane:
if {$clockspeed>1000E6} \ { \ puts “clockspeed is too high!”; \ } \ elseif {$clockspeed >1E6} \ { \ puts “clockspeed is $clockspeed”; \ } \ else \ { \ puts “clockspeed is too low!”; \ }
Using while statements
set i 1 while {$i<=3} \ { \ puts "option $i"; \ incr i; }
Using for loops
In this example, the variable i is incremented by 0.5 each time:
for {set i 1.0} {$i <= 3.0} {set i [expr {$i + 0.5}]} \ { \ puts "value is $i"; \ }
File input/output
It could be useful to read parameters from files. An example could be to insert a version number into a build. The code here shows how to write to a file and to read from it.
Writing to a file:
set outfile [open "c:/xilinx/testfile.txt" w] puts $outfile "bob" puts $outfile "bob2" close $outfile
Reading from a file:
set infile [open "c:/xilinx/testfile.txt" r] gets $infile line1 puts $line1 close $infile
Saving and Recreating the Design from Tcl Files
In the earlier blog posts, the design as mentioned was created using the graphical interface. The entire block design (which included the connections to the memory, clock speed settings, UART configuration and so on) can be exported as a tcl file using a single command. The commands below show how to do this, and also save the project settings too.
cd c:/xilinx/Training/ZynqHW/2017_4/ZynqDesign write_bd_tcl basic_design.tcl write_project_tcl -paths_relative_to c:/xilinx/Training/ZynqHW/2017_4/ZynqDesign project_setup.tcl
If you’re curious, this is what is contained inside the basic_design.tcl file (for the block design from the previous blog post):
################################################################ # This is a generated script based on design: Z_system # # 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.4 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 Z_system_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 xc7z007sclg225-1 } # CHANGE DESIGN NAME HERE variable design_name set design_name Z_system # 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 <design_name> 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 <design_name> 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 <design_name> 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 <design_name> 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 <design_name> 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:processing_system7:5.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 <hier>."} 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 # Create instance: processing_system7_0, and set properties set processing_system7_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:processing_system7:5.5 processing_system7_0 ] set_property -dict [ list \ CONFIG.PCW_ACT_APU_PERIPHERAL_FREQMHZ {666.666687} \ 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 {10.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_PCAP_PERIPHERAL_FREQMHZ {200.000000} \ CONFIG.PCW_ACT_QSPI_PERIPHERAL_FREQMHZ {200.000000} \ CONFIG.PCW_ACT_SDIO_PERIPHERAL_FREQMHZ {25.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_UART_PERIPHERAL_FREQMHZ {100.000000} \ CONFIG.PCW_ACT_WDT_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ARMPLL_CTRL_FBDIV {40} \ CONFIG.PCW_CAN_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_CAN_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_CLK0_FREQ {10000000} \ CONFIG.PCW_CLK1_FREQ {10000000} \ CONFIG.PCW_CLK2_FREQ {10000000} \ CONFIG.PCW_CLK3_FREQ {10000000} \ CONFIG.PCW_CPU_CPU_PLL_FREQMHZ {1333.333} \ CONFIG.PCW_CPU_PERIPHERAL_DIVISOR0 {2} \ CONFIG.PCW_DCI_PERIPHERAL_DIVISOR0 {15} \ CONFIG.PCW_DCI_PERIPHERAL_DIVISOR1 {7} \ CONFIG.PCW_DDRPLL_CTRL_FBDIV {32} \ CONFIG.PCW_DDR_DDR_PLL_FREQMHZ {1066.667} \ CONFIG.PCW_DDR_PERIPHERAL_DIVISOR0 {2} \ CONFIG.PCW_DDR_RAM_HIGHADDR {0x1FFFFFFF} \ CONFIG.PCW_ENET0_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_ENET0_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_ENET0_RESET_ENABLE {0} \ CONFIG.PCW_ENET1_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_ENET1_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_ENET1_RESET_ENABLE {0} \ CONFIG.PCW_ENET_RESET_ENABLE {0} \ CONFIG.PCW_EN_CLK0_PORT {0} \ CONFIG.PCW_EN_CLK1_PORT {0} \ CONFIG.PCW_EN_CLK2_PORT {0} \ CONFIG.PCW_EN_CLK3_PORT {0} \ CONFIG.PCW_EN_EMIO_SDIO1 {0} \ CONFIG.PCW_EN_GPIO {1} \ CONFIG.PCW_EN_QSPI {1} \ CONFIG.PCW_EN_SDIO1 {1} \ CONFIG.PCW_EN_UART1 {1} \ CONFIG.PCW_EN_USB0 {1} \ CONFIG.PCW_FCLK0_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK0_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK1_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK1_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK2_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK2_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK3_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK3_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK_CLK0_BUF {FALSE} \ 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 {150} \ CONFIG.PCW_FPGA3_PERIPHERAL_FREQMHZ {25} \ CONFIG.PCW_FPGA_FCLK0_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK1_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK2_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK3_ENABLE {0} \ CONFIG.PCW_GPIO_MIO_GPIO_ENABLE {1} \ CONFIG.PCW_GPIO_MIO_GPIO_IO {MIO} \ CONFIG.PCW_I2C0_RESET_ENABLE {0} \ CONFIG.PCW_I2C1_RESET_ENABLE {0} \ CONFIG.PCW_I2C_PERIPHERAL_FREQMHZ {25} \ CONFIG.PCW_I2C_RESET_ENABLE {0} \ CONFIG.PCW_IOPLL_CTRL_FBDIV {42} \ CONFIG.PCW_IO_IO_PLL_FREQMHZ {1400.000} \ CONFIG.PCW_MIO_0_DIRECTION {inout} \ CONFIG.PCW_MIO_0_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_0_PULLUP {enabled} \ CONFIG.PCW_MIO_0_SLEW {slow} \ CONFIG.PCW_MIO_10_DIRECTION {inout} \ CONFIG.PCW_MIO_10_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_10_PULLUP {enabled} \ CONFIG.PCW_MIO_10_SLEW {slow} \ CONFIG.PCW_MIO_11_DIRECTION {inout} \ CONFIG.PCW_MIO_11_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_11_PULLUP {enabled} \ CONFIG.PCW_MIO_11_SLEW {slow} \ CONFIG.PCW_MIO_12_DIRECTION {inout} \ CONFIG.PCW_MIO_12_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_12_PULLUP {enabled} \ CONFIG.PCW_MIO_12_SLEW {slow} \ CONFIG.PCW_MIO_13_DIRECTION {inout} \ CONFIG.PCW_MIO_13_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_13_PULLUP {enabled} \ CONFIG.PCW_MIO_13_SLEW {slow} \ CONFIG.PCW_MIO_14_DIRECTION {inout} \ CONFIG.PCW_MIO_14_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_14_PULLUP {enabled} \ CONFIG.PCW_MIO_14_SLEW {slow} \ CONFIG.PCW_MIO_15_DIRECTION {inout} \ CONFIG.PCW_MIO_15_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_15_PULLUP {enabled} \ CONFIG.PCW_MIO_15_SLEW {slow} \ CONFIG.PCW_MIO_1_DIRECTION {out} \ CONFIG.PCW_MIO_1_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_1_PULLUP {enabled} \ CONFIG.PCW_MIO_1_SLEW {slow} \ CONFIG.PCW_MIO_28_DIRECTION {inout} \ CONFIG.PCW_MIO_28_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_28_PULLUP {enabled} \ CONFIG.PCW_MIO_28_SLEW {slow} \ CONFIG.PCW_MIO_29_DIRECTION {in} \ CONFIG.PCW_MIO_29_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_29_PULLUP {enabled} \ CONFIG.PCW_MIO_29_SLEW {slow} \ CONFIG.PCW_MIO_2_DIRECTION {inout} \ CONFIG.PCW_MIO_2_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_2_PULLUP {disabled} \ CONFIG.PCW_MIO_2_SLEW {slow} \ CONFIG.PCW_MIO_30_DIRECTION {out} \ CONFIG.PCW_MIO_30_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_30_PULLUP {enabled} \ CONFIG.PCW_MIO_30_SLEW {slow} \ CONFIG.PCW_MIO_31_DIRECTION {in} \ CONFIG.PCW_MIO_31_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_31_PULLUP {enabled} \ CONFIG.PCW_MIO_31_SLEW {slow} \ CONFIG.PCW_MIO_32_DIRECTION {inout} \ CONFIG.PCW_MIO_32_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_32_PULLUP {enabled} \ CONFIG.PCW_MIO_32_SLEW {slow} \ CONFIG.PCW_MIO_33_DIRECTION {inout} \ CONFIG.PCW_MIO_33_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_33_PULLUP {enabled} \ CONFIG.PCW_MIO_33_SLEW {slow} \ CONFIG.PCW_MIO_34_DIRECTION {inout} \ CONFIG.PCW_MIO_34_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_34_PULLUP {enabled} \ CONFIG.PCW_MIO_34_SLEW {slow} \ CONFIG.PCW_MIO_35_DIRECTION {inout} \ CONFIG.PCW_MIO_35_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_35_PULLUP {enabled} \ CONFIG.PCW_MIO_35_SLEW {slow} \ CONFIG.PCW_MIO_36_DIRECTION {in} \ CONFIG.PCW_MIO_36_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_36_PULLUP {enabled} \ CONFIG.PCW_MIO_36_SLEW {slow} \ CONFIG.PCW_MIO_37_DIRECTION {inout} \ CONFIG.PCW_MIO_37_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_37_PULLUP {enabled} \ CONFIG.PCW_MIO_37_SLEW {slow} \ CONFIG.PCW_MIO_38_DIRECTION {inout} \ CONFIG.PCW_MIO_38_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_38_PULLUP {enabled} \ CONFIG.PCW_MIO_38_SLEW {slow} \ CONFIG.PCW_MIO_39_DIRECTION {inout} \ CONFIG.PCW_MIO_39_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_39_PULLUP {enabled} \ CONFIG.PCW_MIO_39_SLEW {slow} \ CONFIG.PCW_MIO_3_DIRECTION {inout} \ CONFIG.PCW_MIO_3_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_3_PULLUP {disabled} \ CONFIG.PCW_MIO_3_SLEW {slow} \ CONFIG.PCW_MIO_48_DIRECTION {out} \ CONFIG.PCW_MIO_48_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_48_PULLUP {enabled} \ CONFIG.PCW_MIO_48_SLEW {slow} \ CONFIG.PCW_MIO_49_DIRECTION {in} \ CONFIG.PCW_MIO_49_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_49_PULLUP {enabled} \ CONFIG.PCW_MIO_49_SLEW {slow} \ CONFIG.PCW_MIO_4_DIRECTION {inout} \ CONFIG.PCW_MIO_4_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_4_PULLUP {disabled} \ CONFIG.PCW_MIO_4_SLEW {slow} \ CONFIG.PCW_MIO_52_DIRECTION {inout} \ CONFIG.PCW_MIO_52_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_52_PULLUP {enabled} \ CONFIG.PCW_MIO_52_SLEW {slow} \ CONFIG.PCW_MIO_53_DIRECTION {inout} \ CONFIG.PCW_MIO_53_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_53_PULLUP {enabled} \ CONFIG.PCW_MIO_53_SLEW {slow} \ CONFIG.PCW_MIO_5_DIRECTION {inout} \ CONFIG.PCW_MIO_5_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_5_PULLUP {disabled} \ CONFIG.PCW_MIO_5_SLEW {slow} \ CONFIG.PCW_MIO_6_DIRECTION {out} \ CONFIG.PCW_MIO_6_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_6_PULLUP {disabled} \ CONFIG.PCW_MIO_6_SLEW {slow} \ CONFIG.PCW_MIO_7_DIRECTION {out} \ CONFIG.PCW_MIO_7_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_7_PULLUP {disabled} \ CONFIG.PCW_MIO_7_SLEW {slow} \ CONFIG.PCW_MIO_8_DIRECTION {out} \ CONFIG.PCW_MIO_8_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_8_PULLUP {disabled} \ CONFIG.PCW_MIO_8_SLEW {slow} \ CONFIG.PCW_MIO_9_DIRECTION {inout} \ CONFIG.PCW_MIO_9_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_9_PULLUP {enabled} \ CONFIG.PCW_MIO_9_SLEW {slow} \ CONFIG.PCW_MIO_TREE_PERIPHERALS {GPIO#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#USB Reset#Quad SPI Flash#GPIO#SD 1#SD 1#SD 1#SD 1#SD 1#SD 1#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#UART 1#UART 1#Unbonded#Unbonded#GPIO#GPIO} \ CONFIG.PCW_MIO_TREE_SIGNALS {gpio[0]#qspi0_ss_b#qspi0_io[0]#qspi0_io[1]#qspi0_io[2]#qspi0_io[3]/HOLD_B#qspi0_sclk#reset#qspi_fbclk#gpio[9]#data[0]#cmd#clk#data[1]#data[2]#data[3]#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#data[4]#dir#stp#nxt#data[0]#data[1]#data[2]#data[3]#clk#data[5]#data[6]#data[7]#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#tx#rx#Unbonded#Unbonded#gpio[52]#gpio[53]} \ CONFIG.PCW_NAND_GRP_D8_ENABLE {0} \ CONFIG.PCW_NAND_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_NOR_GRP_A25_ENABLE {0} \ CONFIG.PCW_NOR_GRP_CS0_ENABLE {0} \ CONFIG.PCW_NOR_GRP_CS1_ENABLE {0} \ CONFIG.PCW_NOR_GRP_SRAM_CS0_ENABLE {0} \ CONFIG.PCW_NOR_GRP_SRAM_CS1_ENABLE {0} \ CONFIG.PCW_NOR_GRP_SRAM_INT_ENABLE {0} \ CONFIG.PCW_NOR_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_PCAP_PERIPHERAL_DIVISOR0 {7} \ CONFIG.PCW_QSPI_GRP_FBCLK_ENABLE {1} \ CONFIG.PCW_QSPI_GRP_FBCLK_IO {MIO 8} \ CONFIG.PCW_QSPI_GRP_IO1_ENABLE {0} \ CONFIG.PCW_QSPI_GRP_SINGLE_SS_ENABLE {1} \ CONFIG.PCW_QSPI_GRP_SINGLE_SS_IO {MIO 1 .. 6} \ CONFIG.PCW_QSPI_GRP_SS1_ENABLE {0} \ CONFIG.PCW_QSPI_PERIPHERAL_DIVISOR0 {7} \ CONFIG.PCW_QSPI_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_QSPI_PERIPHERAL_FREQMHZ {200} \ CONFIG.PCW_QSPI_QSPI_IO {MIO 1 .. 6} \ CONFIG.PCW_SD1_GRP_CD_ENABLE {0} \ CONFIG.PCW_SD1_GRP_POW_ENABLE {0} \ CONFIG.PCW_SD1_GRP_WP_ENABLE {0} \ CONFIG.PCW_SD1_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_SD1_SD1_IO {MIO 10 .. 15} \ CONFIG.PCW_SDIO_PERIPHERAL_DIVISOR0 {56} \ CONFIG.PCW_SDIO_PERIPHERAL_FREQMHZ {25} \ CONFIG.PCW_SDIO_PERIPHERAL_VALID {1} \ CONFIG.PCW_SINGLE_QSPI_DATA_MODE {x4} \ CONFIG.PCW_SMC_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_SPI_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_TPIU_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_UART1_GRP_FULL_ENABLE {0} \ CONFIG.PCW_UART1_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_UART1_UART1_IO {MIO 48 .. 49} \ CONFIG.PCW_UART_PERIPHERAL_DIVISOR0 {14} \ CONFIG.PCW_UART_PERIPHERAL_FREQMHZ {100} \ CONFIG.PCW_UART_PERIPHERAL_VALID {1} \ CONFIG.PCW_UIPARAM_ACT_DDR_FREQ_MHZ {533.333374} \ CONFIG.PCW_UIPARAM_DDR_BANK_ADDR_COUNT {3} \ CONFIG.PCW_UIPARAM_DDR_BL {8} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY0 {0.234} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY1 {0.234} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY2 {0.100} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY3 {0.100} \ CONFIG.PCW_UIPARAM_DDR_CL {7} \ CONFIG.PCW_UIPARAM_DDR_COL_ADDR_COUNT {10} \ CONFIG.PCW_UIPARAM_DDR_CWL {6} \ CONFIG.PCW_UIPARAM_DDR_DEVICE_CAPACITY {4096 MBits} \ CONFIG.PCW_UIPARAM_DDR_DQS_TO_CLK_DELAY_0 {0.054} \ CONFIG.PCW_UIPARAM_DDR_DQS_TO_CLK_DELAY_1 {0.054} \ CONFIG.PCW_UIPARAM_DDR_DRAM_WIDTH {16 Bits} \ CONFIG.PCW_UIPARAM_DDR_MEMORY_TYPE {DDR 3 (Low Voltage)} \ CONFIG.PCW_UIPARAM_DDR_PARTNO {MT41K256M16 RE-125} \ CONFIG.PCW_UIPARAM_DDR_ROW_ADDR_COUNT {15} \ CONFIG.PCW_UIPARAM_DDR_SPEED_BIN {DDR3_1066F} \ CONFIG.PCW_UIPARAM_DDR_T_FAW {40.0} \ CONFIG.PCW_UIPARAM_DDR_T_RAS_MIN {35.0} \ CONFIG.PCW_UIPARAM_DDR_T_RC {48.75} \ CONFIG.PCW_UIPARAM_DDR_T_RCD {7} \ CONFIG.PCW_UIPARAM_DDR_T_RP {7} \ CONFIG.PCW_UIPARAM_GENERATE_SUMMARY {NONE} \ CONFIG.PCW_USB0_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_USB0_PERIPHERAL_FREQMHZ {60} \ CONFIG.PCW_USB0_RESET_ENABLE {1} \ CONFIG.PCW_USB0_RESET_IO {MIO 7} \ CONFIG.PCW_USB0_USB0_IO {MIO 28 .. 39} \ CONFIG.PCW_USB1_RESET_ENABLE {0} \ CONFIG.PCW_USB_RESET_ENABLE {1} \ CONFIG.PCW_USB_RESET_SELECT {Share reset pin} \ CONFIG.PCW_USE_M_AXI_GP0 {0} \ ] $processing_system7_0 # Create interface connections connect_bd_intf_net -intf_net processing_system7_0_DDR [get_bd_intf_ports DDR] [get_bd_intf_pins processing_system7_0/DDR] connect_bd_intf_net -intf_net processing_system7_0_FIXED_IO [get_bd_intf_ports FIXED_IO] [get_bd_intf_pins processing_system7_0/FIXED_IO] # Create port connections # Create address segments # Restore current instance current_bd_instance $oldCurInst save_bd_design } # End of create_root_design() ################################################################## # MAIN FLOW ################################################################## create_root_design ""
This is the contents of the project_setup.tcl file:
#***************************************************************************************** # Vivado (TM) v2017.4 (64-bit) # # project_setup.tcl: Tcl script for re-creating project 'ZynqDesign' # # Generated by Vivado on Tue Nov 20 00:20:02 +0000 2018 # IP Build 2085800 on Fri Dec 15 22:25:07 MST 2017 # # This file contains the Vivado Tcl commands for re-creating the project to the state* # when this script was generated. In order to re-create the project, please source this # file in the Vivado Tcl Shell. # # * Note that the runs in the created project will be configured the same way as the # original project, however they will not be launched automatically. To regenerate the # run results please launch the synthesis/implementation runs as needed. # #***************************************************************************************** # NOTE: In order to use this script for source control purposes, please make sure that the # following files are added to the source control system:- # # 1. This project restoration tcl script (project_setup.tcl) that was generated. # # 2. The following source(s) files that were local or imported into the original project. # (Please see the '$orig_proj_dir' and '$origin_dir' variable setting below at the start of the script) # # "C:/xilinx/Training/ZynqHW/2017_4/ZynqDesign/ZynqDesign.srcs/sources_1/bd/Z_system/hdl/Z_system_wrapper.vhd" # # 3. The following remote source files that were added to the original project:- # # <none> # #***************************************************************************************** # Set the reference directory for source file relative paths (by default the value is script directory path) set origin_dir "C:/xilinx/Training/ZynqHW/2017_4/ZynqDesign" # Use origin directory path location variable, if specified in the tcl shell if { [info exists ::origin_dir_loc] } { set origin_dir $::origin_dir_loc } # Set the project name set project_name "ZynqDesign" # Use project name variable, if specified in the tcl shell if { [info exists ::user_project_name] } { set project_name $::user_project_name } variable script_file set script_file "project_setup.tcl" # Help information for this script proc help {} { variable script_file puts "\nDescription:" puts "Recreate a Vivado project from this script. The created project will be" puts "functionally equivalent to the original project for which this script was" puts "generated. The script contains commands for creating a project, filesets," puts "runs, adding/importing sources and setting properties on various objects.\n" puts "Syntax:" puts "$script_file" puts "$script_file -tclargs \[--origin_dir <path>\]" puts "$script_file -tclargs \[--project_name <name>\]" puts "$script_file -tclargs \[--help\]\n" puts "Usage:" puts "Name Description" puts "-------------------------------------------------------------------------" puts "\[--origin_dir <path>\] Determine source file paths wrt this path. Default" puts " origin_dir path value is \".\", otherwise, the value" puts " that was set with the \"-paths_relative_to\" switch" puts " when this script was generated.\n" puts "\[--project_name <name>\] Create project with the specified name. Default" puts " name is the name of the project from where this" puts " script was generated.\n" puts "\[--help\] Print help information for this script" puts "-------------------------------------------------------------------------\n" exit 0 } if { $::argc > 0 } { for {set i 0} {$i < [llength $::argc]} {incr i} { set option [string trim [lindex $::argv $i]] switch -regexp -- $option { "--origin_dir" { incr i; set origin_dir [lindex $::argv $i] } "--project_name" { incr i; set project_name [lindex $::argv $i] } "--help" { help } default { if { [regexp {^-} $option] } { puts "ERROR: Unknown option '$option' specified, please type '$script_file -tclargs --help' for usage info.\n" return 1 } } } } } # Set the directory path for the original project from where this script was exported set orig_proj_dir "[file normalize "$origin_dir/"]" # Create project create_project ${project_name} ./${project_name} -part xc7z007sclg225-1 # Set the directory path for the new project set proj_dir [get_property directory [current_project]] # Reconstruct message rules # None # Set project properties set obj [current_project] set_property -name "default_lib" -value "xil_defaultlib" -objects $obj set_property -name "dsa.num_compute_units" -value "60" -objects $obj set_property -name "ip_cache_permissions" -value "read write" -objects $obj set_property -name "ip_output_repo" -value "$proj_dir/${project_name}.cache/ip" -objects $obj set_property -name "part" -value "xc7z007sclg225-1" -objects $obj set_property -name "sim.ip.auto_export_scripts" -value "1" -objects $obj set_property -name "simulator_language" -value "Mixed" -objects $obj set_property -name "target_language" -value "VHDL" -objects $obj set_property -name "xpm_libraries" -value "XPM_FIFO XPM_MEMORY" -objects $obj # Create 'sources_1' fileset (if not found) if {[string equal [get_filesets -quiet sources_1] ""]} { create_fileset -srcset sources_1 } # Set 'sources_1' fileset object set obj [get_filesets sources_1] # Import local files from the original project set files [list \ "[file normalize "$origin_dir/ZynqDesign.srcs/sources_1/bd/Z_system/hdl/Z_system_wrapper.vhd"]"\ ] set imported_files [import_files -fileset sources_1 $files] # Set 'sources_1' fileset file properties for remote files # None # Set 'sources_1' fileset file properties for local files set file "hdl/Z_system_wrapper.vhd" set file_obj [get_files -of_objects [get_filesets sources_1] [list "*$file"]] set_property -name "file_type" -value "VHDL" -objects $file_obj # Set 'sources_1' fileset properties set obj [get_filesets sources_1] set_property -name "top" -value "Z_system_wrapper" -objects $obj # Create 'constrs_1' fileset (if not found) if {[string equal [get_filesets -quiet constrs_1] ""]} { create_fileset -constrset constrs_1 } # Set 'constrs_1' fileset object set obj [get_filesets constrs_1] # Empty (no sources present) # Set 'constrs_1' fileset properties set obj [get_filesets constrs_1] # Create 'sim_1' fileset (if not found) if {[string equal [get_filesets -quiet sim_1] ""]} { create_fileset -simset sim_1 } # Set 'sim_1' fileset object set obj [get_filesets sim_1] # Empty (no sources present) # Set 'sim_1' fileset properties set obj [get_filesets sim_1] set_property -name "top" -value "Z_system_wrapper" -objects $obj # Adding sources referenced in BDs, if not already added # Proc to create BD Z_system proc cr_bd_Z_system { parentCell } { # CHANGE DESIGN NAME HERE set design_name Z_system 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 set bCheckIPsPassed 1 ################################################################## # CHECK IPs ################################################################## set bCheckIPs 1 if { $bCheckIPs == 1 } { set list_check_ips "\ xilinx.com:ip:processing_system7:5.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 } 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 <hier>."} 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 # Create instance: processing_system7_0, and set properties set processing_system7_0 [ create_bd_cell -type ip -vlnv xilinx.com:ip:processing_system7:5.5 processing_system7_0 ] set_property -dict [ list \ CONFIG.PCW_ACT_APU_PERIPHERAL_FREQMHZ {666.666687} \ 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 {10.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_PCAP_PERIPHERAL_FREQMHZ {200.000000} \ CONFIG.PCW_ACT_QSPI_PERIPHERAL_FREQMHZ {200.000000} \ CONFIG.PCW_ACT_SDIO_PERIPHERAL_FREQMHZ {25.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_UART_PERIPHERAL_FREQMHZ {100.000000} \ CONFIG.PCW_ACT_WDT_PERIPHERAL_FREQMHZ {111.111115} \ CONFIG.PCW_ARMPLL_CTRL_FBDIV {40} \ CONFIG.PCW_CAN_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_CAN_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_CLK0_FREQ {10000000} \ CONFIG.PCW_CLK1_FREQ {10000000} \ CONFIG.PCW_CLK2_FREQ {10000000} \ CONFIG.PCW_CLK3_FREQ {10000000} \ CONFIG.PCW_CPU_CPU_PLL_FREQMHZ {1333.333} \ CONFIG.PCW_CPU_PERIPHERAL_DIVISOR0 {2} \ CONFIG.PCW_DCI_PERIPHERAL_DIVISOR0 {15} \ CONFIG.PCW_DCI_PERIPHERAL_DIVISOR1 {7} \ CONFIG.PCW_DDRPLL_CTRL_FBDIV {32} \ CONFIG.PCW_DDR_DDR_PLL_FREQMHZ {1066.667} \ CONFIG.PCW_DDR_PERIPHERAL_DIVISOR0 {2} \ CONFIG.PCW_DDR_RAM_HIGHADDR {0x1FFFFFFF} \ CONFIG.PCW_ENET0_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_ENET0_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_ENET0_RESET_ENABLE {0} \ CONFIG.PCW_ENET1_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_ENET1_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_ENET1_RESET_ENABLE {0} \ CONFIG.PCW_ENET_RESET_ENABLE {0} \ CONFIG.PCW_EN_CLK0_PORT {0} \ CONFIG.PCW_EN_CLK1_PORT {0} \ CONFIG.PCW_EN_CLK2_PORT {0} \ CONFIG.PCW_EN_CLK3_PORT {0} \ CONFIG.PCW_EN_EMIO_SDIO1 {0} \ CONFIG.PCW_EN_GPIO {1} \ CONFIG.PCW_EN_QSPI {1} \ CONFIG.PCW_EN_SDIO1 {1} \ CONFIG.PCW_EN_UART1 {1} \ CONFIG.PCW_EN_USB0 {1} \ CONFIG.PCW_FCLK0_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK0_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK1_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK1_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK2_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK2_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK3_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_FCLK3_PERIPHERAL_DIVISOR1 {1} \ CONFIG.PCW_FCLK_CLK0_BUF {FALSE} \ 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 {150} \ CONFIG.PCW_FPGA3_PERIPHERAL_FREQMHZ {25} \ CONFIG.PCW_FPGA_FCLK0_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK1_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK2_ENABLE {0} \ CONFIG.PCW_FPGA_FCLK3_ENABLE {0} \ CONFIG.PCW_GPIO_MIO_GPIO_ENABLE {1} \ CONFIG.PCW_GPIO_MIO_GPIO_IO {MIO} \ CONFIG.PCW_I2C0_RESET_ENABLE {0} \ CONFIG.PCW_I2C1_RESET_ENABLE {0} \ CONFIG.PCW_I2C_PERIPHERAL_FREQMHZ {25} \ CONFIG.PCW_I2C_RESET_ENABLE {0} \ CONFIG.PCW_IOPLL_CTRL_FBDIV {42} \ CONFIG.PCW_IO_IO_PLL_FREQMHZ {1400.000} \ CONFIG.PCW_MIO_0_DIRECTION {inout} \ CONFIG.PCW_MIO_0_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_0_PULLUP {enabled} \ CONFIG.PCW_MIO_0_SLEW {slow} \ CONFIG.PCW_MIO_10_DIRECTION {inout} \ CONFIG.PCW_MIO_10_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_10_PULLUP {enabled} \ CONFIG.PCW_MIO_10_SLEW {slow} \ CONFIG.PCW_MIO_11_DIRECTION {inout} \ CONFIG.PCW_MIO_11_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_11_PULLUP {enabled} \ CONFIG.PCW_MIO_11_SLEW {slow} \ CONFIG.PCW_MIO_12_DIRECTION {inout} \ CONFIG.PCW_MIO_12_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_12_PULLUP {enabled} \ CONFIG.PCW_MIO_12_SLEW {slow} \ CONFIG.PCW_MIO_13_DIRECTION {inout} \ CONFIG.PCW_MIO_13_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_13_PULLUP {enabled} \ CONFIG.PCW_MIO_13_SLEW {slow} \ CONFIG.PCW_MIO_14_DIRECTION {inout} \ CONFIG.PCW_MIO_14_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_14_PULLUP {enabled} \ CONFIG.PCW_MIO_14_SLEW {slow} \ CONFIG.PCW_MIO_15_DIRECTION {inout} \ CONFIG.PCW_MIO_15_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_15_PULLUP {enabled} \ CONFIG.PCW_MIO_15_SLEW {slow} \ CONFIG.PCW_MIO_1_DIRECTION {out} \ CONFIG.PCW_MIO_1_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_1_PULLUP {enabled} \ CONFIG.PCW_MIO_1_SLEW {slow} \ CONFIG.PCW_MIO_28_DIRECTION {inout} \ CONFIG.PCW_MIO_28_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_28_PULLUP {enabled} \ CONFIG.PCW_MIO_28_SLEW {slow} \ CONFIG.PCW_MIO_29_DIRECTION {in} \ CONFIG.PCW_MIO_29_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_29_PULLUP {enabled} \ CONFIG.PCW_MIO_29_SLEW {slow} \ CONFIG.PCW_MIO_2_DIRECTION {inout} \ CONFIG.PCW_MIO_2_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_2_PULLUP {disabled} \ CONFIG.PCW_MIO_2_SLEW {slow} \ CONFIG.PCW_MIO_30_DIRECTION {out} \ CONFIG.PCW_MIO_30_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_30_PULLUP {enabled} \ CONFIG.PCW_MIO_30_SLEW {slow} \ CONFIG.PCW_MIO_31_DIRECTION {in} \ CONFIG.PCW_MIO_31_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_31_PULLUP {enabled} \ CONFIG.PCW_MIO_31_SLEW {slow} \ CONFIG.PCW_MIO_32_DIRECTION {inout} \ CONFIG.PCW_MIO_32_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_32_PULLUP {enabled} \ CONFIG.PCW_MIO_32_SLEW {slow} \ CONFIG.PCW_MIO_33_DIRECTION {inout} \ CONFIG.PCW_MIO_33_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_33_PULLUP {enabled} \ CONFIG.PCW_MIO_33_SLEW {slow} \ CONFIG.PCW_MIO_34_DIRECTION {inout} \ CONFIG.PCW_MIO_34_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_34_PULLUP {enabled} \ CONFIG.PCW_MIO_34_SLEW {slow} \ CONFIG.PCW_MIO_35_DIRECTION {inout} \ CONFIG.PCW_MIO_35_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_35_PULLUP {enabled} \ CONFIG.PCW_MIO_35_SLEW {slow} \ CONFIG.PCW_MIO_36_DIRECTION {in} \ CONFIG.PCW_MIO_36_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_36_PULLUP {enabled} \ CONFIG.PCW_MIO_36_SLEW {slow} \ CONFIG.PCW_MIO_37_DIRECTION {inout} \ CONFIG.PCW_MIO_37_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_37_PULLUP {enabled} \ CONFIG.PCW_MIO_37_SLEW {slow} \ CONFIG.PCW_MIO_38_DIRECTION {inout} \ CONFIG.PCW_MIO_38_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_38_PULLUP {enabled} \ CONFIG.PCW_MIO_38_SLEW {slow} \ CONFIG.PCW_MIO_39_DIRECTION {inout} \ CONFIG.PCW_MIO_39_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_39_PULLUP {enabled} \ CONFIG.PCW_MIO_39_SLEW {slow} \ CONFIG.PCW_MIO_3_DIRECTION {inout} \ CONFIG.PCW_MIO_3_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_3_PULLUP {disabled} \ CONFIG.PCW_MIO_3_SLEW {slow} \ CONFIG.PCW_MIO_48_DIRECTION {out} \ CONFIG.PCW_MIO_48_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_48_PULLUP {enabled} \ CONFIG.PCW_MIO_48_SLEW {slow} \ CONFIG.PCW_MIO_49_DIRECTION {in} \ CONFIG.PCW_MIO_49_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_49_PULLUP {enabled} \ CONFIG.PCW_MIO_49_SLEW {slow} \ CONFIG.PCW_MIO_4_DIRECTION {inout} \ CONFIG.PCW_MIO_4_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_4_PULLUP {disabled} \ CONFIG.PCW_MIO_4_SLEW {slow} \ CONFIG.PCW_MIO_52_DIRECTION {inout} \ CONFIG.PCW_MIO_52_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_52_PULLUP {enabled} \ CONFIG.PCW_MIO_52_SLEW {slow} \ CONFIG.PCW_MIO_53_DIRECTION {inout} \ CONFIG.PCW_MIO_53_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_53_PULLUP {enabled} \ CONFIG.PCW_MIO_53_SLEW {slow} \ CONFIG.PCW_MIO_5_DIRECTION {inout} \ CONFIG.PCW_MIO_5_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_5_PULLUP {disabled} \ CONFIG.PCW_MIO_5_SLEW {slow} \ CONFIG.PCW_MIO_6_DIRECTION {out} \ CONFIG.PCW_MIO_6_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_6_PULLUP {disabled} \ CONFIG.PCW_MIO_6_SLEW {slow} \ CONFIG.PCW_MIO_7_DIRECTION {out} \ CONFIG.PCW_MIO_7_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_7_PULLUP {disabled} \ CONFIG.PCW_MIO_7_SLEW {slow} \ CONFIG.PCW_MIO_8_DIRECTION {out} \ CONFIG.PCW_MIO_8_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_8_PULLUP {disabled} \ CONFIG.PCW_MIO_8_SLEW {slow} \ CONFIG.PCW_MIO_9_DIRECTION {inout} \ CONFIG.PCW_MIO_9_IOTYPE {LVCMOS 3.3V} \ CONFIG.PCW_MIO_9_PULLUP {enabled} \ CONFIG.PCW_MIO_9_SLEW {slow} \ CONFIG.PCW_MIO_TREE_PERIPHERALS {GPIO#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#Quad SPI Flash#USB Reset#Quad SPI Flash#GPIO#SD 1#SD 1#SD 1#SD 1#SD 1#SD 1#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#USB 0#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#UART 1#UART 1#Unbonded#Unbonded#GPIO#GPIO} \ CONFIG.PCW_MIO_TREE_SIGNALS {gpio[0]#qspi0_ss_b#qspi0_io[0]#qspi0_io[1]#qspi0_io[2]#qspi0_io[3]/HOLD_B#qspi0_sclk#reset#qspi_fbclk#gpio[9]#data[0]#cmd#clk#data[1]#data[2]#data[3]#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#data[4]#dir#stp#nxt#data[0]#data[1]#data[2]#data[3]#clk#data[5]#data[6]#data[7]#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#Unbonded#tx#rx#Unbonded#Unbonded#gpio[52]#gpio[53]} \ CONFIG.PCW_NAND_GRP_D8_ENABLE {0} \ CONFIG.PCW_NAND_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_NOR_GRP_A25_ENABLE {0} \ CONFIG.PCW_NOR_GRP_CS0_ENABLE {0} \ CONFIG.PCW_NOR_GRP_CS1_ENABLE {0} \ CONFIG.PCW_NOR_GRP_SRAM_CS0_ENABLE {0} \ CONFIG.PCW_NOR_GRP_SRAM_CS1_ENABLE {0} \ CONFIG.PCW_NOR_GRP_SRAM_INT_ENABLE {0} \ CONFIG.PCW_NOR_PERIPHERAL_ENABLE {0} \ CONFIG.PCW_PCAP_PERIPHERAL_DIVISOR0 {7} \ CONFIG.PCW_QSPI_GRP_FBCLK_ENABLE {1} \ CONFIG.PCW_QSPI_GRP_FBCLK_IO {MIO 8} \ CONFIG.PCW_QSPI_GRP_IO1_ENABLE {0} \ CONFIG.PCW_QSPI_GRP_SINGLE_SS_ENABLE {1} \ CONFIG.PCW_QSPI_GRP_SINGLE_SS_IO {MIO 1 .. 6} \ CONFIG.PCW_QSPI_GRP_SS1_ENABLE {0} \ CONFIG.PCW_QSPI_PERIPHERAL_DIVISOR0 {7} \ CONFIG.PCW_QSPI_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_QSPI_PERIPHERAL_FREQMHZ {200} \ CONFIG.PCW_QSPI_QSPI_IO {MIO 1 .. 6} \ CONFIG.PCW_SD1_GRP_CD_ENABLE {0} \ CONFIG.PCW_SD1_GRP_POW_ENABLE {0} \ CONFIG.PCW_SD1_GRP_WP_ENABLE {0} \ CONFIG.PCW_SD1_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_SD1_SD1_IO {MIO 10 .. 15} \ CONFIG.PCW_SDIO_PERIPHERAL_DIVISOR0 {56} \ CONFIG.PCW_SDIO_PERIPHERAL_FREQMHZ {25} \ CONFIG.PCW_SDIO_PERIPHERAL_VALID {1} \ CONFIG.PCW_SINGLE_QSPI_DATA_MODE {x4} \ CONFIG.PCW_SMC_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_SPI_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_TPIU_PERIPHERAL_DIVISOR0 {1} \ CONFIG.PCW_UART1_GRP_FULL_ENABLE {0} \ CONFIG.PCW_UART1_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_UART1_UART1_IO {MIO 48 .. 49} \ CONFIG.PCW_UART_PERIPHERAL_DIVISOR0 {14} \ CONFIG.PCW_UART_PERIPHERAL_FREQMHZ {100} \ CONFIG.PCW_UART_PERIPHERAL_VALID {1} \ CONFIG.PCW_UIPARAM_ACT_DDR_FREQ_MHZ {533.333374} \ CONFIG.PCW_UIPARAM_DDR_BANK_ADDR_COUNT {3} \ CONFIG.PCW_UIPARAM_DDR_BL {8} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY0 {0.234} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY1 {0.234} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY2 {0.100} \ CONFIG.PCW_UIPARAM_DDR_BOARD_DELAY3 {0.100} \ CONFIG.PCW_UIPARAM_DDR_CL {7} \ CONFIG.PCW_UIPARAM_DDR_COL_ADDR_COUNT {10} \ CONFIG.PCW_UIPARAM_DDR_CWL {6} \ CONFIG.PCW_UIPARAM_DDR_DEVICE_CAPACITY {4096 MBits} \ CONFIG.PCW_UIPARAM_DDR_DQS_TO_CLK_DELAY_0 {0.054} \ CONFIG.PCW_UIPARAM_DDR_DQS_TO_CLK_DELAY_1 {0.054} \ CONFIG.PCW_UIPARAM_DDR_DRAM_WIDTH {16 Bits} \ CONFIG.PCW_UIPARAM_DDR_MEMORY_TYPE {DDR 3 (Low Voltage)} \ CONFIG.PCW_UIPARAM_DDR_PARTNO {MT41K256M16 RE-125} \ CONFIG.PCW_UIPARAM_DDR_ROW_ADDR_COUNT {15} \ CONFIG.PCW_UIPARAM_DDR_SPEED_BIN {DDR3_1066F} \ CONFIG.PCW_UIPARAM_DDR_T_FAW {40.0} \ CONFIG.PCW_UIPARAM_DDR_T_RAS_MIN {35.0} \ CONFIG.PCW_UIPARAM_DDR_T_RC {48.75} \ CONFIG.PCW_UIPARAM_DDR_T_RCD {7} \ CONFIG.PCW_UIPARAM_DDR_T_RP {7} \ CONFIG.PCW_UIPARAM_GENERATE_SUMMARY {NONE} \ CONFIG.PCW_USB0_PERIPHERAL_ENABLE {1} \ CONFIG.PCW_USB0_PERIPHERAL_FREQMHZ {60} \ CONFIG.PCW_USB0_RESET_ENABLE {1} \ CONFIG.PCW_USB0_RESET_IO {MIO 7} \ CONFIG.PCW_USB0_USB0_IO {MIO 28 .. 39} \ CONFIG.PCW_USB1_RESET_ENABLE {0} \ CONFIG.PCW_USB_RESET_ENABLE {1} \ CONFIG.PCW_USB_RESET_SELECT {Share reset pin} \ CONFIG.PCW_USE_M_AXI_GP0 {0} \ ] $processing_system7_0 # Create interface connections connect_bd_intf_net -intf_net processing_system7_0_DDR [get_bd_intf_ports DDR] [get_bd_intf_pins processing_system7_0/DDR] connect_bd_intf_net -intf_net processing_system7_0_FIXED_IO [get_bd_intf_ports FIXED_IO] [get_bd_intf_pins processing_system7_0/FIXED_IO] # Create port connections # Create address segments # Restore current instance current_bd_instance $oldCurInst save_bd_design close_bd_design $design_name } # End of cr_bd_Z_system() cr_bd_Z_system "" set_property GENERATE_SYNTH_CHECKPOINT "0" [get_files Z_system.bd ] # Create 'synth_1' run (if not found) if {[string equal [get_runs -quiet synth_1] ""]} { create_run -name synth_1 -part xc7z007sclg225-1 -flow {Vivado Synthesis 2017} -strategy "Vivado Synthesis Defaults" -report_strategy {No Reports} -constrset constrs_1 } else { set_property strategy "Vivado Synthesis Defaults" [get_runs synth_1] set_property flow "Vivado Synthesis 2017" [get_runs synth_1] } set obj [get_runs synth_1] set_property set_report_strategy_name 1 $obj set_property report_strategy {Vivado Synthesis Default Reports} $obj set_property set_report_strategy_name 0 $obj # Create 'synth_1_synth_report_utilization_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs synth_1] synth_1_synth_report_utilization_0] "" ] } { create_report_config -report_name synth_1_synth_report_utilization_0 -report_type report_utilization:1.0 -steps synth_design -runs synth_1 } set obj [get_report_configs -of_objects [get_runs synth_1] synth_1_synth_report_utilization_0] if { $obj != "" } { } set obj [get_runs synth_1] set_property -name "part" -value "xc7z007sclg225-1" -objects $obj set_property -name "strategy" -value "Vivado Synthesis Defaults" -objects $obj # set the current synth run current_run -synthesis [get_runs synth_1] # Create 'impl_1' run (if not found) if {[string equal [get_runs -quiet impl_1] ""]} { create_run -name impl_1 -part xc7z007sclg225-1 -flow {Vivado Implementation 2017} -strategy "Vivado Implementation Defaults" -report_strategy {No Reports} -constrset constrs_1 -parent_run synth_1 } else { set_property strategy "Vivado Implementation Defaults" [get_runs impl_1] set_property flow "Vivado Implementation 2017" [get_runs impl_1] } set obj [get_runs impl_1] set_property set_report_strategy_name 1 $obj set_property report_strategy {Vivado Implementation Default Reports} $obj set_property set_report_strategy_name 0 $obj # Create 'impl_1_init_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_init_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_init_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps init_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_init_report_timing_summary_0] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_opt_report_drc_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_opt_report_drc_0] "" ] } { create_report_config -report_name impl_1_opt_report_drc_0 -report_type report_drc:1.0 -steps opt_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_opt_report_drc_0] if { $obj != "" } { } # Create 'impl_1_opt_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_opt_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_opt_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps opt_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_opt_report_timing_summary_0] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_power_opt_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_power_opt_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_power_opt_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps power_opt_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_power_opt_report_timing_summary_0] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_place_report_io_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_io_0] "" ] } { create_report_config -report_name impl_1_place_report_io_0 -report_type report_io:1.0 -steps place_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_io_0] if { $obj != "" } { } # Create 'impl_1_place_report_utilization_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_utilization_0] "" ] } { create_report_config -report_name impl_1_place_report_utilization_0 -report_type report_utilization:1.0 -steps place_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_utilization_0] if { $obj != "" } { } # Create 'impl_1_place_report_control_sets_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_control_sets_0] "" ] } { create_report_config -report_name impl_1_place_report_control_sets_0 -report_type report_control_sets:1.0 -steps place_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_control_sets_0] if { $obj != "" } { } # Create 'impl_1_place_report_incremental_reuse_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_incremental_reuse_0] "" ] } { create_report_config -report_name impl_1_place_report_incremental_reuse_0 -report_type report_incremental_reuse:1.0 -steps place_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_incremental_reuse_0] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_place_report_incremental_reuse_1' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_incremental_reuse_1] "" ] } { create_report_config -report_name impl_1_place_report_incremental_reuse_1 -report_type report_incremental_reuse:1.0 -steps place_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_incremental_reuse_1] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_place_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_place_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps place_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_place_report_timing_summary_0] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_post_place_power_opt_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_post_place_power_opt_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_post_place_power_opt_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps post_place_power_opt_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_post_place_power_opt_report_timing_summary_0] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_phys_opt_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_phys_opt_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_phys_opt_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps phys_opt_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_phys_opt_report_timing_summary_0] if { $obj != "" } { set_property -name "is_enabled" -value "0" -objects $obj } # Create 'impl_1_route_report_drc_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_drc_0] "" ] } { create_report_config -report_name impl_1_route_report_drc_0 -report_type report_drc:1.0 -steps route_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_drc_0] if { $obj != "" } { } # Create 'impl_1_route_report_methodology_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_methodology_0] "" ] } { create_report_config -report_name impl_1_route_report_methodology_0 -report_type report_methodology:1.0 -steps route_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_methodology_0] if { $obj != "" } { } # Create 'impl_1_route_report_power_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_power_0] "" ] } { create_report_config -report_name impl_1_route_report_power_0 -report_type report_power:1.0 -steps route_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_power_0] if { $obj != "" } { } # Create 'impl_1_route_report_route_status_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_route_status_0] "" ] } { create_report_config -report_name impl_1_route_report_route_status_0 -report_type report_route_status:1.0 -steps route_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_route_status_0] if { $obj != "" } { } # Create 'impl_1_route_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_route_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps route_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_timing_summary_0] if { $obj != "" } { } # Create 'impl_1_route_report_incremental_reuse_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_incremental_reuse_0] "" ] } { create_report_config -report_name impl_1_route_report_incremental_reuse_0 -report_type report_incremental_reuse:1.0 -steps route_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_incremental_reuse_0] if { $obj != "" } { } # Create 'impl_1_route_report_clock_utilization_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_clock_utilization_0] "" ] } { create_report_config -report_name impl_1_route_report_clock_utilization_0 -report_type report_clock_utilization:1.0 -steps route_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_route_report_clock_utilization_0] if { $obj != "" } { } # Create 'impl_1_post_route_phys_opt_report_timing_summary_0' report (if not found) if { [ string equal [get_report_configs -of_objects [get_runs impl_1] impl_1_post_route_phys_opt_report_timing_summary_0] "" ] } { create_report_config -report_name impl_1_post_route_phys_opt_report_timing_summary_0 -report_type report_timing_summary:1.0 -steps post_route_phys_opt_design -runs impl_1 } set obj [get_report_configs -of_objects [get_runs impl_1] impl_1_post_route_phys_opt_report_timing_summary_0] if { $obj != "" } { } set obj [get_runs impl_1] set_property -name "part" -value "xc7z007sclg225-1" -objects $obj set_property -name "strategy" -value "Vivado Implementation Defaults" -objects $obj set_property -name "steps.write_bitstream.args.readback_file" -value "0" -objects $obj set_property -name "steps.write_bitstream.args.verbose" -value "0" -objects $obj # set the current impl run current_run -implementation [get_runs impl_1] puts "INFO: Project created:$project_name"
To recreate the design from these TCL files is quite easy, although I felt the training didn’t explain it well. All you need is the two tcl files. Start up Vivado, and select to create a new project, in a totally new folder. The project name doesn’t matter, because after the Tcl scripts are run, the correct project name is created from the Tcl files. In fact nothing matters at this stage – you could even select the wrong chip, because the scripts will select the correct one.
Then, the scripts are run as shown below (first I just copy-pasted the scripts into the new folder):
cd c:/xilinx/Training/ZynqHW/2017_4/TempProject2 source project_setup.tcl source basic_design.tcl
Once this is done, you can close the project without saving, because a new project with the original name will have been created inside the new folder.
Open that project in Vivado and you can go straight to Generate Bitstream and it will synthesize the entire design as in the earlier blog posts!
Custom Graphical User Interfaces
I was curious to see if Tk could be used with Vivado. According to the documentation it is possible, using some example code called tk_tunnel. The way it works, is that it starts another separate Tcl server, and then makes a communications connection (socket) to it. Any Tcl/Tk command can then be sent via that connection or tunnel, and responses can come back too. Some Tk message boxes have shortcuts that can be used if desired.
The available commands are listed here.
To use it, first the tk_tunnel package needs to be loaded into the Tcl interpreter. Then, the launch_server command is used to create the separate Tcl instance and get it listening. The start_client command is used to connect to it. It is all shown here:
lappend auto_path "C:/xilinx/Vivado/2017.4/data/XilinxTclStore" package require ::tclapp::xilinx::tk_tunnel namespace import ::tclapp::xilinx::tk_tunnel::* launch_server "C:/xilinx/Vivado/2017.4/tps/win64/git-1.9.5/bin/tclsh85.exe" start_client
Next, any other command from the available list can be used. To create a Tk message prompt box for instance and to read in the button-click into a variable called response, then this CLI can be used:
set response [ rexec_wait {tk_messageBox -type "yesno" -message "Build project?" -icon question -title "Project ZynqDesign"} ]
As mentioned there are some shortcuts, so it could also have been implemented as follows:
set response [ rexec_wait {ask "Build project??"} ]
When this command executes, a custom message prompt box appears!
The screenshot here shows what goes on in the server Tcl shell view for the example above:
I didn’t explore this feature much further, but either there is a bug or I don’t entirely understand how to use it, because although it worked and I could successfully retrieve the button-press result from the variable, I couldn’t re-issue the command a second time without closing down the socket and server first : ( And since there doesn’t seem to be any commands to do that, I had to manually do it by pressing Ctrl-C in the server window.
Still, I guess this is a more advanced feature that I don’t really need just yet. It would be handy for commercial projects though, to make it easier for people to use the entire system. For those interested, there is more information on tk_tunnel in the Readme file at this location when Vivado is installed:
C:\xilinx\Vivado\2017.4\data\XilinxTclStore\tclapp\xilinx\tk_tunnel
Summary
Through using the scripting language it is possible to do anything that is possible via the Vivado graphical interface. Vivado makes it easy to see what CLI is needed, because each GUI action results in commands appearing in the Tcl pane, and they can be observed or copied.
It was great that the entire project settings, and block design could be saved off into Tcl files, and then they could be used to subsequently recreate the project either on the same computer or a different machine. This is very handy for version control. It could be envisaged that there is a script that when run, checks out the correct copies of the Tcl files, and then runs them and generates the bitstream.
Also, since standard Tcl is used, it is possible to do things like take input from files. This could be handy to automatically place revision numbers into the implemented hardware project for example!
It was also noted that there is capability to extend the scripts to include graphical elements such as message prompts and user input. Some basic things were done with this, but more experimentation would be needed.
Thanks for reading!
Top Comments