Because intelligent design runs take a long time to complete, it is not practical to run them continuously after every design change. When an IDR completes, you need to incorporate its results into a main project run.
Incorporating IDR Results into a Main Project Run
- Right-click the top-level IDR.
- Choose one of the following:
-
Generate Single Pass Implementation Run to create
an equivalent run to the IDR that replicates the best run results with
greater compile-time efficiency. The structure of this run is dynamic
and depends on:
- QoR suggestions that improved the design
- Implementation command directives from either the Stage 1 implementation or the Stage 2 ML-predicted strategies, depending on which produced the best run
- An additional Tcl procedure added after
route_designif Stage 3 (Last Mile) produced the best results
This run is most useful for reproducing results with the same input netlist, such as closing out a timing-closed build. It can perform poorly with design changes, and including Last Mile can increase compile time.
- Generate ML Strategy Runs to create three implementation runs using the top three ML-predicted implementation strategies, including any QoR suggestions that improved the design. This approach is generally better for design iterations because it excludes Last Mile, which adds extra compile time.
-
Generate Single Pass Implementation Run to create
an equivalent run to the IDR that replicates the best run results with
greater compile-time efficiency. The structure of this run is dynamic
and depends on:
If you later need to add Last Mile to an ML strategy run, you can use the Last Mile script on a fully routed DCP file.
Running the Last Mile Script
The Last Mile script is supported in AMD Vivado™
2023.1 and later for Versal, AMD UltraScale+™
,
and AMD UltraScale™
devices. It runs intensive algorithms to close
timing on a fully routed design and can be called manually or added as a
TCL_POST hook after phys_opt_design -directive
Explore.
- Open a fully routed design in Vivado.
- Confirm that the design meets the entry criteria:
- QoR Assessment score of 3 or greater
- WNS of at least –0.250
- Generate QoR suggestions for the Last Mile flow.
- Enable any incremental-friendly QoR suggestions found.
- Run Last Mile optimization commands:
-
phys_opt_designwith clock, retiming, and LUT optimizations -
place_design -directive LastMile - Additional
phys_opt_designandroute_designcommands with the Explore directive
-
- Optionally write intermediate or final checkpoints and timing reports.
Tcl Implementation
package require Vivado 1.2022.1
namespace eval ::xilinx::designutils {
namespace export last_mile
}
proc ::xilinx::designutils::last_mile {{write_intermediate_files 0} {write_final_files 0}} {
# Vivado : Supported 2023.1 and later
#
# Families : Versal, Ultrascale+, Ultrascale
#
# Summary : Run last mile flow. This is equivalent to
# running stage 3 in IDR.
# The last mile flow will run intensive
# algorithms trying to close out timing
# on a fully routed design.
# It is recommended to run post route
# phys_opt_design -directive Explore before
# running last mile.
# A call to this script can be added as a
# TCL_POST hook to post route
# phys_opt_design -directive Explore.
#
# The requirements to run this are:
# i) A fully routed open design
# ii) When called a check will be made to
# see if the QoR Assessment Score of 3
# or 4 is achieved, if not it will exit.
# iii) A WNS >= -0.250
#
# Arguments:
#
# write_intermediate_files -
# When set to 1, writes out intermediate DCP and timing
# reports after:
# i) preplace phys_opt_design,
# ii) place_design
# iii) postplace phys_opt_design
#
# write_final_files -
# Writes reports and DCPs after the final stage
# route_design
# when set to 1.
# Project users: It is recommended to leverage
# project infrastructure to write
# reports
# Non-Project users: Recommended to add custom
# write_checkpoint and reporting
# commands after this script is
# executed.
#
# Return Value:
# 1 - last mile completed successfully
#
# Categories: xilinxtclstore, designutils
set top [get_property TOP [current_design]]
# Entry Checks
puts "-I: Checking last mile entry criteria is met..."
if {[llength [current_design -quiet]] == 0} {
puts "-E: Last mile requires an open design that is\
fully routed"
return -code 2 "Error: Last mile requires an open\
design that is fully routed"
}
if {[report_route_status -boolean_check ROUTED_FULLY] == 0} {
puts "-E: Last mile requires a design that is fully\
routed"
return -code 2 "Error: Last mile requires a design\
that is fully routed"
}
# actual value is 3
if {[set score [get_assessment_score]] < 3} {
puts "-E: Last mile requires a design has an QoR\
Assessment Score of 3 or greater.\
Design Score: $score"
return -code 2 "Error: Last mile requires a design\
has an QoR Assessment Score of 3 or greater.\
Design Score: $score"
}
# actual value is -0.250
if {[set slack [get_property SLACK [get_timing_paths -setup]]] < -0.250} {
puts "-E: Last mile requires a design a WNS >= -0.250\
Design Slack: $slack"
return -code 2 "Error: Last mile requires a design a\
WNS >= -0.250. Design Slack: $slack"
}
puts "-I: Passed last mile entry criteria checks"
# QoR Suggestion Generation
puts "-I: Generating QoR Suggestions for Last Mile"
report_qor_suggestions -file ${top}_qor_suggestions_lastmile.rpt
if {[llength [get_qor_suggestions -filter {INCR_FRIENDLY} -quiet ] ] > 0} {
puts "-I: Enabling generated incremental friendly\
QoR Suggestions..."
write_qor_suggestions -of_objects \
[get_qor_suggestions -filter {INCR_FRIENDLY}] \
-force -file ${top}_qor_suggestions_lastmile.rqs
set_property ENABLED 1 [get_qor_suggestions \
-filter {INCR_FRIENDLY}]
} else {
puts "-I: No QoR Suggestions found for last mile\
flow. Flow will continue.."
}
# Tool Flow Commands
phys_opt_design -clock_opt -retime -lut_opt
if {$write_intermediate_files != 0} {
report_timing_summary -delay_type min_max \
-report_unconstrained -check_timing_verbose \
-max_paths 10 \
-input_pins -routable_nets \
-rpx ${top}_timing_lastmile_preplace_physopt.rpx \
-file ${top}_timing_lastmile_preplace_physopt.rpt
write_checkpoint -force \
${top}_lastmile_preplace_physopt.dcp
}
place_design -directive LastMile
if {$write_intermediate_files != 0} {
report_timing_summary -delay_type min_max \
-report_unconstrained \
-check_timing_verbose \
-max_paths 10 \
-input_pins \
-routable_nets \
-rpx ${top}_timing_lastmile_placed.rpx \
-file ${top}_timing_lastmile_placed.rpt
write_checkpoint -force \
${top}_lastmile_placed.dcp
}
phys_opt_design -directive Explore
if {$write_intermediate_files != 0} {
report_timing_summary -delay_type min_max \
-report_unconstrained \
-check_timing_verbose \
-max_paths 10 \
-input_pins \
-routable_nets \
-rpx ${top}_timing_lastmile_postplace_physopt.rpx \
-file ${top}_timing_lastmile_postplace_physopt.rpt
write_checkpoint -force \
${top}_lastmile_postplace_physopt.dcp
}
route_design -directive Explore
if {$write_final_files != 0} {
report_timing_summary -delay_type min_max \
-report_unconstrained -check_timing_verbose \
-max_paths 10 -input_pins -routable_nets \
-rpx ${top}_timing_lastmile_routed.rpx \
-file ${top}_timing_lastmile_routed.rpt
write_checkpoint -force \
${top}_lastmile_routed.dcp
}
phys_opt_design -directive Explore
phys_opt_design -directive Explore
if {$write_final_files != 0} {
report_timing_summary -delay_type min_max \
-report_unconstrained -check_timing_verbose \
-max_paths 10 -input_pins -routable_nets \
-rpx ${top}_timing_lastmile_postroute_physopt.rpx \
-file ${top}_timing_lastmile_postroute_physopt.rpt
write_checkpoint -force \
${top}_lastmile_postroute_physopt.dcp
}
return 1
}