Vivado Design Suite Tcl
Command Reference Guide
UG835 (v2018.3) December 5, 2018
Revision History
Revision History
The following table shows the revision history for this document:
Section
Revision Summary
12/5/2018 v2018.3
add_hw_hbm_pc, create_bd_intf_tlm_port, create_bd_tlm_port,
create_dashboard_gadget, delete_dashboard_gadgets, get_dashboard_gadgets,
move_dashboard_gadget, open_dsa, pause_hw_hbm_amon, pr_recombine,
pr_subdivide, remove_hw_hbm_pc, report_bd_diffs, reset_runs,
resume_hw_hbm_amon, run_hw_hbm_amon, stop_hw_hbm_amon, write_dsa
create_bd_cell, create_ip, create_waiver, current_time, get_bd_designs,
get_speed_models, get_waivers, group_path, iphys_opt_design, link_design,
open_checkpoint, open_wave_database, opt_design, phys_opt_design,
read_iphys_opt_tcl, report_bus_skew, report_clock_utilization,
report_design_analysis, report_ip_status, report_methodology, report_power,
report_qor_suggestions, report_timing, report_timing_summary, save_project_as,
update_hw_firmware, write_checkpoint, write_iphys_opt_tcl, write_ip_tcl,
write_waivers, xsim
06/06/2018 v2018.2
create_bd_intf_tlm_port, create_bd_tlm_port, implement_xphy_cores
config_ip_cache, export_ip_user_files, export_simulation,
make_bd_intf_pins_external, make_bd_pins_external, place_design,
report_pipeline_analysis, report_qor_suggestions, report_timing,
report_timing_summary, report_utilization, update_hw_firmware,
validate_bd_design, write_bd_tcl, write_sdf
04/04/2018 v2018.1
commit_hw_hbm, create_gui_custom_command,
create_gui_custom_command_arg, create_port_on_reconfigurable_module,
create_rqs_run, current_dashboard, generate_platform, get_dashboards,
get_gui_custom_command_args, get_gui_custom_commands, get_hw_hbms,
refresh_hw_hbm, refresh_meminit, remove_gui_custom_command_args,
remove_gui_custom_commands, write_ip_tcl
check_timing, config_ip_cache, create_hw_axi_txn, create_slack_histogram,
create_waiver, delete_waivers, get_files, get_filesets, get_pblocks,
get_reconfig_modules, get_runs, get_waivers, group_path, log_wave,
open_hw_target, opt_design, phys_opt_design, pr_verify, program_hw_devices,
read_checkpoint, refresh_hw_device, refresh_hw_server, refresh_hw_target,
report_bus_skew, report_carry_chains, report_cdc, report_clock_interaction,
report_compile_order, report_debug_core, report_design_analysis, report_drc,
report_exceptions, report_methodology, report_pulse_width, report_route_status,
report_timing, report_timing_summary, report_utilization, report_waivers,
route_design, synth_design, upgrade_ip, write_bd_tcl, write_checkpoint,
write_dsa_rom, write_waivers, write_xdc, xsim
Commands Added in 2018.3
Commands Modified in 2018.3
Commands Added in 2018.2
Commands Modified in 2018.2
Commands Added in 2018.1
Commands Modified in 2018.1
UG835 (v2018.3) December 5, 2018
Tcl Command Reference Guide
www.xilinx.com
2
Send Feedback
Introduction
Chapter 1
Overview of Tcl Capabilities in Vivado
The Tool Command Language (Tcl) is the scripting language integrated in the Vivado® tool
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 (v2018.3) December 5, 2018
Tcl Command Reference Guide
www.xilinx.com
3
Send Feedback
Chapter 1: Introduction
Tcl 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
TIP: On Windows, you can also select Start → All Programs → Xilinx Design Tools → Vivado yyyy.x →
Vivado 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).
Tcl 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 -mode batch -source
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 Tcl scripts to process a number of
designs overnight through synthesis, simulation, and implementation, and review the results on
the following morning.
UG835 (v2018.3) December 5, 2018
Tcl Command Reference Guide
www.xilinx.com
4
Send Feedback
Chapter 1: Introduction
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).
If you prefer to work in a GUI, 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 files,
and any generated report files, 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.
In the Windows OS, select Start → All Programs → Xilinx Design Tools → Vivado yyyy.x → 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 file 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
journal file can be used as a source to create new Tcl scripts.
UG835 (v2018.3) December 5, 2018
Tcl Command Reference Guide
www.xilinx.com
5
Send Feedback
Chapter 1: Introduction
Note: Backup versions of the journal file, named vivado_.backup.jou, are written to save the
details of prior runs whenever the Vivado tool is launched. The is a unique identifier that allow the
tool to create and store multiple backup versions of the log and journal files.
Tcl Help
The Tcl help command provides information related to the supported Tcl commands.
• help – Returns a list of Tcl command categories.
help
Command categories are groups of commands performing a specific function, like File I/O for
instance.
• help -category category – Returns a list of commands found in the specified category.
help -category 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 specific command from a group of commands.
help get_*
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 specified 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_cells
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.tcl scripts are provided in the Vivado release by
default.
UG835 (v2018.3) December 5, 2018
Tcl Command Reference Guide
www.xilinx.com
6
Send Feedback
Chapter 1: Introduction
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: $HOME/.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_init.tcl
• For Linux: $HOME/.Xilinx/Vivado/Vivado_init.tcl
Where:
• installdir is the installation directory where the Vivado Design Suite is installed.
If Vivado_init.tcl exists, in one or all of these locations, the Vivado tool sources this file, in
the order described above.
• The Vivado_init.tcl file 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.tcl script.
• A user's Vivado_init.tcl file 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 file is provided with the Vivado Design Suite installation. You must
create the Vivado_init.tcl file 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:
tool_init.tcl, where tool can include Vivado, vivado_lab, xsim, and xelab.
The Vivado_init.tcl file 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.
UG835 (v2018.3) December 5, 2018
Tcl Command Reference Guide
www.xilinx.com
7
Send Feedback
Chapter 1: Introduction
Sourcing a Tcl Script
A Tcl script can be sourced from either one of the command-line options or from the GUI. 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.
Typing help source in the Tcl console will provide additional information regarding the
source command.
Using Tcl.pre 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:
//. 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] get_property DIRECTORY
[current_run]
For more information on defining Tcl Hook scripts, refer to the Vivado Design Suite User Guide:
Using Tcl Scripting (UG894).
UG835 (v2018.3) December 5, 2018
Tcl Command Reference Guide
www.xilinx.com
8
Send Feedback