AR# 45751

Vivado Constraints - When can I use Tcl Variables

Description

Where can I use Tcl variables?

Are Tcl variables inside of the XDC file supported in Vivado Design Suite?

Solution

You can run the following in the Tcl Console from the CPU example design:


% set my_var [get_ports {wbClk}]
% put $my_var
% get_property SLEW [get_ports {wbClk}]
SLOW
% set_property SLEW FAST $my_var
% get_property SLEW [get_ports {wbClk}]
FAST
% get_property IOSTANDARD [get_ports {wbClk}]
LVCMOS18
% set_property IOSTANDARD DIFF_HSTL_I $my_var
% get_property IOSTANDARD [get_ports {wbClk}]
DIFF_HSTL_I

The Tcl Console does support Tcl variables.

Tcl variables in the XDC file are not supported, and parsing the XDC file using the following methods will not work:
  • Adding the XDC file to the project
  • Running the 'read_xdc' command

Users are expected to have a separate Tcl file for the general Tcl commands and Tcl variables, and these should not be included in the XDC file.

If you are creating your own scripts, we recommend that you have a top level Tcl file for the general project command, and then use the 'read_xdc' or 'add_files' commands to read the XDC file.

AR# 45751
Date 08/26/2020
Status Active
Type General Article
Tools More Less