generate_ml_strategies - 2024.1 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
Release Date
2024.1 English

Generate ML strategies for a run


generate_ml_strategies [‑jobs <arg>] [‑details] [‑force] [‑keep_launch_dir]
    [‑suggestions_filter <arg>] [‑quiet] [‑verbose] <runs>...


Name Description
[-jobs] Number of jobs Default: 1
[-details] Prints job details
[-force] Force to regenerate the ml strategies.
[-keep_launch_dir] Keep the launch directory and files for analysis
[-suggestions_filter] Filter for the internal call to write_qor_suggestion command Default: Category==Strategy
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution
<runs> List of runs to generate ML strategies for


Object, Run


Generates ML Strategies for a completed implementation run. It is a two step process where the first step is to create the ML Strategy RQS files and the second step is to create the implementation runs and reference the RQS files.

ML Strategies are written to the directory <run>/MLStrategy. Once strategies have been generated, implementation runs that reference the strategy can be created.

In order to generate ML strategies, flow criteria must be met:

  • opt_design must be run with either Default or Explore directive.
  • place_design, phys_opt_design, and route_design must be run with the same directive and be either Default or Explore.

For project mode strategies, there are two provided implementation strategies that meet this criteria:

  • Implementation Defaults
  • Performance Explore

This command is intended for use in interactive mode where a user generates strategies from a completed implementation run. For script users, it is recommended to generate ML strategies as part of an implementation run as this is a more efficient method. See the example below.

Note: This command is not supported in non-project mode. Refer alternative examples in the Examples section.

ML Strategies are supported for Versal, Ultrascale+, and Ultrascale families.


-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.

-jobs <arg> - (Optional) The number of parallel jobs to run on the local host.

-details - (Optional) Print details on the jobs such as host, memory, and user id.

-force - (Optional) Allows previous ML Strategies to be overwritten.

-keep_launch_dir - (Optional) Preserves the run directory used to open the checkpoint and generate the ML strategies.

-suggestions_filter - (Optional) Filters the other QoR suggestions that are generated. It is recommended to keep APPLIED suggestions as these form part of the design that was evaluated to generate the strategies. This command can be used to add other GENERATED suggestions.

Note: For more complex filtering, it is recommended to open the design and write QoR suggestions from the Report > QoR Suggestions or Tcl natively using report_qor_suggestions and write_qor_suggestions command.

<runs> - (Required) The names of implementation runs to launch. One or more run names may be specified.


The following command creates ML Strategy RQS files after a run is complete from within a project.

generate_ml_strategies [get_runs impl_1] -suggestions_filter {APPLIED || Category==Strategy}

The following commad generate the ML strategies during the implementation run, either turn on the AUTO_RQS feature or add a Tcl hook script to the post route phase. AUTO_RQS will collect other category QoR Suggestions. For more control over the other suggestions collected, use the Tcl hook option and modify the filter command.

  1. Execute the following command to enable AUTO_RQS
    set_property AUTO_RQS 1 [get_runs impl_1]
  2. Alternatively, add the following commands into the Tcl file and modify the filter as required.
    report_qor_suggestions write_qor_suggestions -strategy_dir ./MLStrategy -of_objects [get_qor_suggestions -filter {APPLIED || Category == Strategy}] 
  3. Execute the following command to add the Tcl file to the post route Tcl hook.
    import_files -fileset utils_1 post_route.tcl set_property STEPS.ROUTE_DESIGN.TCL.POST [ get_files post_route.tcl -of [get_fileset utils_1] ] [get_runs impl_1] 

The following command create new runs and configure them to use the strategy, whenever ML Strategies are generated.

create_rqs_runs -reference_run [get_runs impl_1]
Note: It is recommended to run three ML Strategies per design in maximize timing improvement and smooth out variations.

For non-project users, the following commands generate ML strategy suggestions and write them to an RQS file in ./MLStrategy directory.

write_qor_suggestions -strategy_dir ./MLStrategy -of_objects [get_qor_suggestions -filter {APPLIED || Category == Strategy}]

The following example shows the equivalent non-project based commands to reference the RQS strategies.

<insert after link design or open checkpoint>
    read_qor_suggestions ./MLStrategy/<top>_routedSuggestionFile[1||2||3].rqs
    opt_design -directive RQS
    place_design -directive RQS
    phys_opt_design -directive RQS
    route_design -directive RQS