About XDC Constraints - 2023.2 English

Vivado Design Suite User Guide: Using Constraints (UG903)

Document ID
Release Date
2023.2 English

XDC constraints are a combination of industry standard Synopsys Design Constraints (SDC version 1.9) and AMD proprietary physical constraints.

XDC constraints have the following properties:

  • They are not simple strings, but are commands that follow the Tcl semantic.
  • They can be interpreted like any other Tcl command by the Vivado Tcl interpreter.
  • They are read in and parsed sequentially the same as other Tcl commands.

You can enter XDC constraints in several ways, at different points in the flow.

  • Store the constraints in one or more XDC files.

    To load the XDC file in memory, do one of the following:

    • Use the read_xdc command.
    • Add it to one of your project constraints sets. XDC files only accept the set, list, and expr built-in Tcl commands. See Supported XDC and SDC Commands for a complete list of supported commands.
  • Generate the constraints with an unmanaged Tcl script.

    To execute the Tcl script, do one of the following:

    • Run the source command.
    • Non-Project Mode:
    • Project Mode: Add the Tcl script to one of your project constraints sets:
      • Add the file to the project
      • Set the file property to be Tcl
      • Add_files -fileset constrs_me timing.xdc

        set_property file_type Tcl [get_files -of [get_filesets constrs_me] timing.xdc]

Tip: Unlike XDC files, unmanaged Tcl scripts can include any common Tcl command for selecting design objects and defining design constraints, including conditional and looping control structures.
Important: The Vivado Design Suite allows you to mix XDC files and Tcl scripts in the same constraints set. Modified constraints are saved back to their original location only if they originally came from an XDC file, and not from an unmanaged Tcl script. A constraint generated by a Tcl script is not managed by the Vivado Design Suite and cannot be interactively modified. For more information, see Constraints Methodology.
Note: For XDC constraints, there is a difference in behavior between the commands source and read_xdc. The constraints imported with the source command are not saved in the checkpoint in the same order as they are imported. The constraints imported with read_xdc are saved first and then those imported with source. To save all the constraints in the same order as they are applied to the design, use read_xdc -unmanaged instead of source.

To validate the syntax or impact of a particular constraint after loading your design in memory, use the Tcl Console and the Vivado Design Suite reporting features. This is particularly powerful for analyzing and debugging timing constraints and physical constraints.