write_xdc - 2023.2 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
Release Date
2023.2 English

Writes constraints to a Xilinx Design Constraints (XDC) file. The default file extension for a XDC file is .xdc.


write_xdc [‑no_fixed_only] [‑constraints <arg>] [‑cell <arg>] [‑sdc]
    [‑no_tool_comments] [‑force] [‑exclude_timing] [‑exclude_physical]
    [‑add_netlist_placement] [‑logic_function_stripped] [‑type <args>]
    [‑write_id] [‑exclude_cells <args>] [‑quiet] [‑verbose] [<file>]


Name Description
[-no_fixed_only] Export fixed and non-fixed placement (by default only fixed placement is exported)
[-constraints] Include constraints that are flagged invalid Values: valid, invalid, all Default: valid
[-cell] Hierarchical cell for which constraints are exported.
[-sdc] Export all timing constriants in SDC compatible format.
[-no_tool_comments] Don't write verbose tool generated comments to the xdc when translating from ucf.
[-force] Overwrite existing file.
[-exclude_timing] Don't export timing constraints.
[-exclude_physical] Don't export physical constraints.
[-add_netlist_placement] Export netlist placement constraints.
[-logic_function_stripped] Write disable_timing constraints which are associated with having previously run write_edif with its -logic_function_stripped option.
[-type] Types of constraint to export. Values: timing, io, misc, waiver and physical. If not specified, all constraints will be exported.
[-write_id] Write position number for timing constraints
[-exclude_cells] Don't export constraints scoped to or below the specified hierarchical cell(s).
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution
[<file>] Output constraints to the specified XDC file.


Timing, FileIO


Writes constraints to a Xilinx™ Design Constraints file (XDC). The XDC can be exported from the top-level, which is the default, or from a specific hierarchical cell.

Important: The write_xdc command writes the constraints to the specified file in the same order they are added to or executed in the design.

The write_xdc command lets you write invalid XDC constraints so that you can quickly report constraints that have been ignored by the Vivado™ Design Suite due to a problem with the way the constraint is written or applied. This is useful for debugging constraint files applied in specific designs.

This command can be used to create an XDC file from a design with UCF files. All constraints from the active constraint fileset will be exported to the XDC, even if they come from multiple files.

Tip: The write_xdc command will not convert all UCF constraints into XDC format, and is not intended to automatically convert UCF based designs to XDC. Refer to the Vivado Design Suite Migration Methodology Guide (UG911) for more information on migrating UCF constraints to XDC.


-no_fixed_only - (Optional) Export both fixed and unfixed placement LOCs to the constraint file being written. By default only the fixed LOCs will be written to the XDC file. Fixed LOCs are associated with user-assigned placements, while unfixed LOCs are associated with tool assigned placements.

-constraints <arg> - (Optional) Export constraints that are flagged valid, invalid, or all constraints (both valid and invalid). The default behavior is to export only valid constraints to the XDC file. Valid values are VALID, INVALID, or ALL.

-cell <arg> - (Optional) The name of a hierarchical cell in the current design to export the constraints from. The constraints will be written to the specified XDC file relative to the specified cell.

Note: A design must be open when using this option.

-exclude_cells <arg> - (Optional) Do not export constraints scoped to or below the hierarchical cells listed in <arg>. All other constraints are exported including constraints which refer hierarchically to the cells or cell contents but are scoped above the specified cells.

-sdc - (Optional) Export only the timing constraints in a file format that is 100% SDC compatible from the current design. Does not export any other defined constraints.

-no_tool_comments - (Optional) Do not add tool generated comments into the XDC file.

-force - (Optional) Overwrite a file of the same name if one already exists.

-exclude_timing - (Optional) Do not export timing constraints. This results in an XDC file that contains only physical constraints.

-exclude_physical - (Optional) Do not export physical constraints. This results in an XDC file that contains only timing constraints.

-add_netlist_placement - (Optional) Include placement constraints that are defined in the netlist file as part of the written XDC file.

-type <arg> - (Optional) Specifies the types of constraint to export. Valid values are: timing, io, misc, waiver and physical. Multiple types can be specified at one time. If the type is not specified, all constraints will be exported.

-logic_function_stripped - (Optional) Includes the set_disable_timing constraints which are needed to preserve the constants propagation and timing signoff after stripping the logic function of the LUTs. It should be used in association with write_edif -logic_function_stripped.

-write_id - (Optional) Includes the constraint position number before each timing constraint. The position number if also reported inside the Timing Constraints Editor (TCE) and some of the Methodology violations.

-quiet - (Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless of any errors encountered during execution.
Note: Any errors encountered on the command-line, while launching the command, will be returned. Only errors occurring inside the command will be trapped.
-verbose - (Optional) Temporarily override any message limits and return all messages from this command.
Note: Message limits can be defined with the set_msg_config command.
<file> - (Required) The file name of the XDC file to write.
Note: If the path is not specified as part of the file name, the file will be written into the current working directory, or the directory from which the tool was launched.


Write the valid and invalid constraints, including both fixed and unfixed cells, to the specified file.

write_xdc -no_fixed_only -constraints all C:/Data/design.xdc

Write only the invalid constraints, including both fixed and unfixed cells, to the specified file.

write_xdc -constraints invalid C:/Data/bad_constraints.xdc

Write the physical constraints only, including placement constraints defined in any netlist source files.

write_xdc -exclude_timing -add_netlist_placement C:/Data/physical.xdc

See Also