AR# 59134


Vivado Constraints - For loops not supported in XDC


When entering constraints in a for loop from an XDC file, the constraints do not get applied as expected.


XDC constraints are a combination of:

  • Industry standard Synopsys Design Constraints (SDC version 1.9)
  • Xilinx proprietary physical constraints

XDC constraints files do not act the same as TCL scripts run through a TCL parser. 

Only a subset of Tcl commands are valid in an XDC file. 

For this reason, for loops will not function correctly and are not supported in XDC files. 

To apply constraints in the form of for loops, generate the constraints with a Tcl script and have it executed in any of the following ways:

  1. Run the source command to explicitly source the Tcl script at any point in the flow.
  2. Add the Tcl scripts to one of your project constraint sets.
    The Vivado Design Suite allows you to mix XDC files and Tcl scripts in the same constraints set.
    Tcl scripts and XDC files are loaded in the same sequence as displayed in the Vivado IDE (if they belong to the same PROCESSING_ORDER group) or as reported by the command report_compile_order -constraints.
    Note that modified constraints are saved back to their original location only if they originally came from an XDC file, and not from a Tcl script.
    A constraint generated by a Tcl script cannot be interactively modified.
  3. Define Tcl Hook Scripts by setting the tcl.pre or option, which allows the custom Tcl script to be run prior to or after synthesis or implementation design runs.

AR# 59134
Date 12/17/2014
Status Active
Type General Article
People Also Viewed