Changing the options for Vivado's `phys_opt_design`

FYI: I am posting this for someone who emailed me, as they are currently unable to make an account. However, hopefully they will be able to read this.

Is there a way to overwrite or change the default options for “VivadoPostRouteOpt” when building assemblies?

I have come across a problem using the PhysOptDesign tool post route when building an assembly. Specifically, when I enable “VivadoPostRouteOpt” in the assembly Makefile I do not see the same behaviour as when running “phys_opt_design” in Vivado manually on the post route design checkpoint.

I am using Vivado 2019.2, OpenCPI 2.4.1 on CentOS7, although this has also been confirmed in 2.4.6.

I am using the PhysOptDesign tool in the Vivado GUI to meet timing for a design which has a very small setup slack violation (TNS = -0.0016ns, WNS = -0.0008ns). The tool is able to optimise the netlist to solve this very small violation.

The Makefile “opencpi/runtime/hdl-support/xilinx/vivado.mk” sets a default option of “-hold_fix”. Xilinx documentation p.1094 describes this as “Performs optimisations to insert data path delay to fix hold time violations”, and as an option which attempts to improve the slack of high hold violators, which in other Xilinx documentation is described as > 0.4ns. From this, it can be seen why the tool when used through the OpenCPI build process, was not providing the expected result – I do not have a problem with hold slack, rather a very small setup slack violation.

In the Xilinx documentation for phys_opt_design, the “-hold_fix” option is described as optional, and as such it would seem that it should also be optional in “post_route_phys_opt” options.

I have found no other way to overwrite the “-hold_fix” option, other than using the ‘sed’ tool to remove the default option in vivado.mk.

I checked out the documentation linked and found the following relevant part:

Page 1092

Post-place phys_opt_design performs the following optimizations by default:
• high-fanout optimization
• placement-based optimization of critical paths
• rewire
• critical-cell optimization
• DSP register optimization
• BRAM register optimization
• URAM register optimization
• a final fanout optimization
TIP: Using command-line options for specific optimizations results in phys_opt_design performing only the specified optimizations and disabling all others, even the ones that are usually performed by default.

So the default of -hold_fix is turning off the rest of these which is resulting in the difference in functionality.

To replicate what it does by default, I think you’d need to provide the following extra options:

# Placement
-fanout_opt
-placement_opt
-rewire
-critical_cell_opt
-dsp_register_opt
-bram_register_opt
-uram_register_opt
-fanout_opt

# Routing
-placement_opt
-routing_opt
-rewire
-critical_cell_opt

Note that in placement, by default it does the fanout optimisation twice (start and end). This won’t be possible with the default -hold_fix unless phys_opt_design is called twice, which would require a framework edit. Although you are post route, which doesn’t have this problem.

So you should be able to supply the four options above via VivadoExtraOptions_post_route_phys_opt in the assembly Makefile.

I think it would make sense to remove the defaults for this command from vivado.mk.