Using Tcl.pre and Tcl.post Hook Scripts - 2023.1 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
UG835
Release Date
2023-05-16
Version
2023.1 English

Tcl Hook scripts allow you to run custom Tcl scripts prior to (tcl.pre) and after (tcl.post) synthesis and implementation design runs, or any of the implementation steps. Whenever you launch a run, the Vivado tool uses a predefined Tcl script which executes a design flow based on the selected strategy. Tcl Hook scripts let you customize the standard flow, with pre-processors or post-processors, such as for generating custom reports. The Tcl Hook script must be a standard Tcl script.

Every step in the design flow has a pre- and post-hook capability. Common examples are:
  • Custom reports: timing, power, utilization, or any user-defined tcl report.
  • Temporary parameters for workarounds.
  • Over-constraining timing constraints for portions of the flow.
  • Multiple iterations of stages (e.g. multiple calls to phys_opt_design).
  • Modifications to netlist, constraint, or device programming.
Important: Relative paths within the tcl.pre and tcl.post scripts are relative to the appropriate run directory of the project they are applied to: <project>/<project.runs>/<run_name>. You can use the DIRECTORY property of the current project or current run to define the relative paths in your Tcl hook scripts:
get_property DIRECTORY [current_project]
get_property DIRECTORY [current_run]

For more information on defining Tcl Hook scripts, refer to the Vivado Design Suite User Guide: Using Tcl Scripting (UG894).