- Decide how to provide constraints:
- Store the constraints in one or more XDC files.
- Generate the constraints with an unmanaged Tcl script.
- Follow these steps to store constraints in XDC files:
- Create or update the
.xdcfile.- XDC files only accept the
set,list, andexprbuilt-in Tcl commands. - Refer to Supported XDC and SDC Commands for the full list.
- XDC files only accept the
- Load the
.xdcfile into memory using one of these methods:- Run the
read_xdccommand. - Add the file to one of your project constraints sets.
- Run the
- Create or update the
- Follow these steps to generate constraints with an unmanaged Tcl script:
- Create a
.tclscript.- You can use any common Tcl command for selecting design objects and defining design constraints, including conditional and looping control structures.
- Execute the script using one of these methods:
- Run the
sourcecommand. - In non-project mode, run
read_xdc -unmanaged. - In project mode, do the following:
- Add the Tcl script to a project constraints set.
- Add the file to the project.
- Set the file property to
Tcl.
add_files -fileset constrs_me timing.xdc set_property file_type Tcl [get_files -of [get_filesets constrs_me] timing.xdc] - Run the
- Create a
Tip: Unlike XDC files, unmanaged Tcl
scripts can use any Tcl command for selecting objects and defining constraints,
including conditional or looping structures.
Important: You can mix XDC files and Tcl scripts
in the same constraints set. Keep these limits in mind:
- Vivado saves modified constraints back to their original location only if they originally came from an XDC file.
- The tool does not manage constraints from unmanaged Tcl scripts, and you cannot modify them interactively.
Note on source vs. read_xdc
For XDC constraints, source and
read_xdc behave differently:
- Constraints imported with
sourceare not saved in the checkpoint in the same order as they are imported. - Constraints imported with
read_xdcare saved first, then those imported withsource. - To save all constraints in the same order as they are applied to
the design, use
read_xdc -unmanagedinstead ofsource.
Validating Constraints
After you load your design in memory, use the Tcl Console and Vivado reports to analyze and debug timing and physical constraints.