文件名称:
vivado-tcl-commands.pdf
开发工具:
文件大小: 7mb
下载次数: 0
上传时间: 2019-07-21
详细说明:
vivado tcl脚本全部命令集合,可作为工具书,方便随时查看。L XILINX
Chapter 1
Introductⅰon
Overview of Tcl Capabilities in Vivado
The Tool Command Language(tcl)is the scripting language integrated in the vivado too
environment. Tcl is a standard language in the semiconductor industry for application
programming interfaces, and is used by synopsys design Constraints (SDc)
SDC is the mechanism for communicating timing constraints for FPga synthesis tools from
Synopsys synplify as well as other vendors and is a timing constraint industry standard
consequently, the Tcl infrastructure is a best practice "for scripting language.
Tcl lets you perform interactive queries to design tools in addition to executing automated
scripts tcl offers the ability to ask" questions interactively of design databases, particularly
around tool and design settings and state examples are: querying specific timing analysis
reporting commands live, applying incremental constraints, and performing queries immediately
after to verify expected behavior without re-running any tool steps
The following sections describe some of the basic capabilities of tcl with vivado
Note: This manual is not a comprehensive reference for the tcl language. it is a reference to the specific
capabilities of the vivado design Suite tcl shell, and provides reference to additional tcl programming
resources
Launching the vivado Design Suite
You can launch the vivado Design Suite and run the tools using different methods depending on
your preference. For example, you can choose a tcl script-based compilation style method in
which you manage sources and the design process yourself, also known as non project mode.
Alternatively, you can use a project-based method to automatically manage your design process
and design data using projects and project states, also known as project Mode. Either of these
methods can be run using a tcl scripted batch mode or run interactively in the Vivado IDE For
more information on the different design flow modes, see the vivado Design Suite User Guide
Design Flows Overview(UG892
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
XILINX
Chapter 1: Introduction
Tc Shell mode
If you prefer to work directly with Tcl commands, you can interact with your design using Tcl
commands with one of the following methods
Enter individual Tcl commands in the vivado design Suite tcl shell outside of the vivado ide
Enter individual tcl commands in the tcl console at the bottom of the vivado ide
Run Tcl scripts from the vivado Design Suite Tcl shell
Run Tcl scripts from the vivado IdE
Use the following command to invoke the vivado Design Suite Tcl shell either at the linux
command prompt or within a windows command prompt window
vivado -mode tcl
QPP: On window. you can also select Start→ All Programs→ Xilinx Design00s→aoyx→yado
yyyy x Tcl Shell, where yyyy. x is the installed version of vivado
For more information about using Tcl and Tcl scripting see the vivado design Suite User Guide
Using the tcl Scripting Capabilities(UG894). For a step-by-step tutorial that shows how to use tcl
in the vivado tool, see the vivado Design Suite Tutorial: Design Flows Overview (UG888
Tc Batch mode
You can use the vivado tools in batch mode by supplying a tcl script when invoking the tool. Use
the following command either at the linux command prompt or within a windows Command
Prompt window
vivado -inode batch -source <_Icl-script>
The vivado design Suite Tcl shell will open run the specified Tcl script, and exit when the script
completes. In batch mode, you can queue up a series of tc scripts to process a number of
designs overnight through synthesis, simulation, and implementation, and review the results on
the
le following morning.
Vivado ide mode
You can launch the vivado design Suite and run the tools using different methods depending on
your preference. For example you can choose a tcl script-based compilation style method in
which you manage sources and the design process yourself, also known as Non-Project Mode
Alternatively, you can use a project-based method to automatically manage your design process
and design data using projects and project states also known as project mode Either of these
methods can be run using a tcl scripted batch mode or run interactively in the vivado ide. For
more information on the different design flow modes, see the vivado Design Suite User Guide
Design Flows Overview UG892)
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
4
XILINX
Chapter 1: Introduction
If you prefer to work in a gul, you can launch the vivado ide from Windows or Linux. For more
information on the vivado IDE, see the vivado Design Suite User Guide: Using the vivado IDE
(UG893
Launch the vivado ide from your working directory by default the vivado journal and log fles
and any generated report fles are written to the directory from which the vivado tool is
launched. This makes it easier to locate the project file, log files, and journal files, which are
written to the launch directory.
n the windows os, select start→ All Programs→ Xilinx Design Tools→ Vivado yyyyx→ Vivado
yyyy x Tcl Shell, where"yyyy x "is the installed version of vivado
TIP: You can also double-click the vivado IdE shortcut icon on your Windows desktop
In the Linux OS, enter the following command at the command prompt
vivado -or-vivado -mode gui
If you need help with the vivado tool command line executable, type
vivado -help
If you are running the vivado tool from the vivado Design Suite Tcl shell, you can open the
Vivado ide directly from the tcl shell by using the start -gui command
From the Vivado IDE, you can close the vivado ide and return to a vivado tcl shell by using the
stop-gui command.
Tcl Journal files
When you invoke the vivado tool, it writes the vivado. log fle to record the various
commands and operations performed during the design session. The vivado tool also writes a file
called vivado. jou which is a journal of just the tcl commands run during the session. The
ournal fle can be used as a source to create new tc scripts
Note: Backup versions of the journal fle, named vivado-sid> backup. jou, are written to save the
details of prior runs whenever the vivado tool is launched the id> is a unique identifer that allow the
tool to create and store multiple backup versions of the log and journal files
Tcl Help
The Tcl he lp command provides information related to the supported tcl commands
help -Returns a list of Tcl command categories
help
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
XILINX
Chapter 1: Introduction
Command categories are groups of commands performing a specific function, like File 1/o for
instance
help -category category- Returns a list of commands found in the specified category
hcl
tcgory object
This example returns the list of Tcl commands for handling objects
help pattern- Returns a list of commands that match the specified search pattern this
form can be used to quickly locate a specifc command from a group of commands
help get-s
This example returns the list of Tcl commands beginning with get
help command-Provides detailed information related to the specified command
help get-cells
This example returns specific information of the get_cells command
help -args command- Provides an abbreviated help text for the specifed command,
including the command syntax and a brief description of each argument
help -args get-cells
help -syntax command- Reports the command syntax for the specified command
help- syntax get-ce⊥s
Scripting in Tcl
TCl Initialization Scripts
TIP: The following describes where you can place Vivado-init. tcl scripts if you would like to customize
Vivado on startup. No Vivado-init tcI scripts are provided in the vivado release by default
When you start the vivado tool it looks for a tcl initialization script in three different locations
each one overriding the last one found
1. Enterprise: In the software installation directory, installdir/Vivado/version/
scripts/Vivado-init tcl
2. Vivado Version In a local user directory for a specific version of the vivado design Suite
For Windows 7: %APPDATA%/Xilinx/Vivado/version/Vivado-init tcl
For Linux: SHOME/ Xilinx/Vivado/version/Vivado-init tcl
3. Vivado User In a local user directory for the general vivado design Suite
For Windows 7: APPDATA/ Xilinx/Vivado/Vivado-inittcl
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
XILINX
Chapter 1: Introduction
For Linux: SHOME/Xilinx/vivado/vivado-init tcl
Where
installdir is the installation directory where the vivado design Suite is installed
If Vivadoinit. tcl exists. in one or all of these locations the vivado tool sources this file. in
the order described above
The Vivado-init tcl fle in the installation directory allows a company or design group to
support a common initialization script for all users. Anyone starting the vivado tool from that
installation location sources the enterprise vivado init. t cl scrip
Auser's Vivado- init. tcl fle in the home directory allows each user to specify additional
commands, or to override commands from the software installation to meet their specific
design requirements
No Vivado-init. tcl fle is provided with the vivado design Suite installation You must
create the vivado-init tcl fle and place it in either the installation directory or your
home directory, as discussed to meet your specific needs
TIP: Other tools in the vivado design Suite also support initialization scripts in the following form too l_init. tcl
where too can include vivado, vivado lab xsim and xelab
The Vivado-init tcl fle is a standard tcl command file that can contain any valid tcl
command supported by the vivado tool You can also source another tcl script file from within
Vivado-init. tcl by adding the following statement
source path-to-file/file-name tcl
Note: You can also specify the -init option when launching the vivado design Suite from the command
line. Type vivado -help for more information
Sourcing a Tcl Script
A Tcl script can be sourced from either one of the command-line options or from the gul. Within
the vivado Integrated design Environment (Ide)you can source a tcl script from tools- Run tcl
Script
You can source a tcl script from a tcl command-line option
source file name
When you invoke a tcl script from the vivado ide, a progress bar is displayed and all operations
in the ide are blocked until the scripts completes
There is no way to interrupt script execution during run time; consequently, standard os
methods of killing a process must be used to force interruption of the tool If the process is killed,
you lose any work done since your last save
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
7
L XILINX
Chapter 1: Introduction
Typing help source in the Tcl console will provide additional information regarding the
source command
Using Tclpre and Tcl. post Hook Scripts
Tcl Hook scripts allow you to run custom tcl scripts prior to( tcl. pre) and after(tcl. post
synthesis and implementation design runs, or any of the implementation steps. Whenever you
launch a run the vivado tool uses a predefined tcl script which executes a design flow based on
the selected strategy tcl Hook scripts let you customize the standard flow, with pre-processors
or post-processors, such as for generating custom reports. the tcl Hook script must be a
standard Tcl script
Every step in the design flow has a pre -and post -hook capability. common examples are:
Custom reports: timing, power, utilization, or any user-defined tcl report
temporary parameters for workarounds.
Over-constraining timing constraints for portions of the flow
Multiple iterations of stages (e.g. multiple calls to phys_ opt design
Modifications to netlist, constraint, or device programming
IMPORTANT! Relative paths within the tcl pre and tcl post scripts are relative to the appropriate run directory of
the project they are applied to: /project. runs>/. You can use the DIRECTORy
property of the current project or current run to define the relative paths in your tcl hook scripts
get- property direCtory [current-project] getproperty DIreCtory
[current-run]
For more information on defining Tcl Hook scripts, refer to the vivado design Suite User guide
Using Tcl Scripting(UG894
General Tcl Syntax Guidelines
Tcl uses the Linux fle separator convention regardless of which operating System you are
runnIng
The following subsections describe the general syntax guidelines for using tcl in the vivado
Design Suite
Using Tcl Eval
When executing Tcl commands, you can use variable substitution to replace some of the
command line arguments accepted or required by the tcl command. However, you must use the
Tcl eval command to evaluate the command line with the tcl variable as part of the command
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
XILINX
Chapter 1: Introduction
For instance, the he lp command can take the -category argument, with one of a number of
command categories as options
help -category inflow
You can define a variable to hold the command category
set cat inflow
Wher
set is the tcl keyword that defines the variable
cat is the name of the variable being defned.
inflow" is the value assigned to the variable
You can then evaluate the variable in the context of the tcl command
eval help -category scat
or
set cat "category ipflow eval help cat
You can also use braces f in place of quotation marks to achieve the same result
set runblocksOptDesignOpts i -sweep -retarget -propconst -remap
eva1 opt-design Srunblocksopt DesignOpt
yping help eval in the tcl console will provide additional information regarding the eva.l
comman
Using special characters
Some commands take arguments that contain characters that have special meaning to tcl Those
arguments must be surrounded with curly braces d to avoid unintended processing by tcl. The
most common cases are as follows
Bus Indexes-Because square brackets I have special meaning to Tcl, an indexed (bit-or part
selected)bus using the square bracket notation must be surrounded with curly braces For
example when adding index 4 of a bus to the vivado common Waveform viewer window using
the square bracket notation, you must write the command as
add- wave i bus [4]]
Parentheses can also be used for indexing a bus, and because parentheses have no special
meaning to tcl, the command can be written without curly braces for example:
add_wave bus(4)
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
XILINX
Chapter 1: Introduction
Verilog Escaped Identifiers-Verilog identifiers containing characters or keywords that are
reserved by verilog need to be escaped"both in the verilog source code and on the simulator
command line by prefixing the identifier with a backslash"\"and appending a space. Additionally
on the tcl command line the escaped identifer must be surrounded with curly braces
Note: If an identifier already includes a curly brace, then the technique of surrounding the identifier with
curly braces does not work, because tcl interprets curly braces as reserved characters even nested within
curly braces. Instead you must use the technique described below, in VHDL Extended Identifiers
For example, to add a wire named "my wireto the vivado common Waveform viewer
window, you must write the command as:
add wave、 ny wIre
Note: Be sure to append a space after the final character and before the closing brace
Verilog allows any identifer to be escaped However, on the tcl command line do not escape
identifiers that are not required to be escaped For example to add a wire named w"to the
Vivado Common Waveform Viewer window the vivado simulator would not accept
add-wave i\w 3
as a valid command since this identifer (the wire name"w")does not required to be escaped
The command must be written as
add wave w
VHDL EXtended ldentifiers-VhDl extended identifiers contain backslashes, which are
reserved characters in Tcl because tcl interprets a backslash next to a close curly brace \ as
being a close curly brace character vhdl extended identifiers cannot be written with curly
braces. Instead the curly braces must be absent and each special character to tcl must be
prefixed with a backslash for example to add the signal \my sig\ to the wave window, you must
write the command as
add-wave\\ny、sig\
Note: Both the backslashes that are part of the extended identifer, and the space inside the identifier are
prefixed with a backslash.
General Syntax Structure
The general structure of vivado Design Suite Tcl commands is
command [optional parameters] required parameters
Command syntax is of the verb-noun and verb-adjective- noun structure separated by the
underscore
character
UG835(V20191)May222019
Tcl Command reference guide
Send feedback
www.xilinx.com
10
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.