Post-Implementation Timing Analysis¶
This tutorial describes how to perform static timing analysis (STA) on a circuit which has been implemented by VPR using OpenSTA, an external timing analysis tool.
External timing analysis can be useful since VPR’s timing analyzer (Tatum) does not support all timing constraints and does not provide a TCL interface to allow you to directly interrogate the timing graph. VPR also has limited support for timing exceptions such as multi-cycles and false paths, which tools like OpenSTA have better support for.
Some external tools can also ingest more complex timing models (e.g. four transition rr, rf, fr, ff delays vs. VTR’s modeling of all transitions having the same min,max range).

Fig. 76 Post-implementation timing analysis design cycle.¶
- A user design cycle which would use post-implementation timing analysis could perform the following:
Run VPR with the timing commands it can support (simplified constraints).
Perform timing analysis on the resulting netlist using OpenSTA with more complex timing commands.
The user can then modify the design to meet the complex timing constraints based on the timing report produced by OpenSTA.
The design can then be fed back into VPR and the process can repeat until all constraints are met.
Generating the Post-Implementation Netlist for STA¶
For this tutorial, we will be using the clma
benchmark
targetting the k6_frac_N10_frac_chain_mem32K_40nm.xml
architecture.
We will first create a working directory to hold all the timing analysis files:
$ mkdir timing_analysis_tut
$ cd timing_analysis_tut
Next we will copy over the benchmark and FPGA architecture into the working directory for convenience:
$ cp $VTR_ROOT/vtr_flow/benchmarks/blif/clma.blif .
$ cp $VTR_ROOT/vtr_flow/arch/timing/k6_frac_N10_frac_chain_mem32K_40nm.xml .
Note
Replace $VTR_ROOT with the root directory of the VTR source tree
To perform timing analysis externally to VTR, we need to provide an SDC file
which will contain the timing constraints on the clocks and I/Os in the circuit.
For this tutorial, we will use the following clma.sdc
file:
1# Set pclk to be a clock with a 16ns period.
2create_clock -period 16 pclk
3
4# Set the input delays of all input ports in the clma design to be 0 relative to pclk.
5set_input_delay -clock pclk -max 0 [get_ports {pi*}]
6
7# Set the output delays of all output ports in the clma design to be 0 relative to pclk.
8set_output_delay -clock pclk -max 0 [get_ports {p__*}]
Next, we can generate the post-implementation netlist and other necessary files for timing analysis using VPR.
$ vpr \
$ k6_frac_N10_frac_chain_mem32K_40nm.xml \
$ clma.blif \
$ --route_chan_width 100 \
$ --sdc_file clma.sdc \
$ --gen_post_synthesis_netlist on \
$ --gen_post_implementation_sdc on \
$ --post_synth_netlist_unconn_inputs gnd \
$ --post_synth_netlist_module_parameters off
In this command, we provide the architecture, circuit, the channel width, and the SDC file. The other four commands are what generate the necessary netlist files for timing analysis:
--gen_post_synthesis_netlist on
: This will generate the post-implementation netlist as a Verilog file.
--gen_post_implementation_sdc on
: This will have VPR generate a new SDC file which contains extra timing information (e.g. clock delays) based on how VPR implemented the design.
--post_synth_netlist_unconn_inputs gnd
: For timing analysis with OpenSTA, we should be explicit about how we handle unconnected signal ports. Here we just ground them for simplicity.
--post_synth_netlist_module_parameters off
: OpenSTA does not allow parameters to be used in the netlist. This command tells VPR to generate a netlist without using parameters.
Once VPR has completed, we should see the generated Verilog netlist, SDF file, and SDC file:
$ ls *.v *.sdf *.sdc
top_post_synthesis.sdc top_post_synthesis.sdf top_post_synthesis.v
Performing Timing Analysis using OpenSTA¶
To perform static timing analysis for this tutorial, we will be using OpenSTA (https://github.com/parallaxsw/OpenSTA ). Other STA tools can be used, however they may use slightly different commands.
First, install OpenSTA onto your system. Building from source is a good option, which can be done using the following instructions: https://github.com/parallaxsw/OpenSTA?tab=readme-ov-file#build-from-source
After OpenSTA is installed, we can perfrom static timing analysis on the post-implementation netlist generated by VPR.
It is easiest to write a sdf_delays.tcl
file to setup and configure the timing analysis:
sdf_delays.tcl
. Note that $VTR_ROOT should be replaced with the relevant path.¶ 1# Read a skeleton of a liberty file which contains just enough information to
2# allow OpenSTA to perform timing analysis on the post-synthesized netlist using
3# an SDF file. This contains descriptions of the timing arcs of the primitives
4# in the circuit.
5read_liberty $VTR_ROOT/vtr_flow/primitives.lib
6
7# Read the post-implementation netlist generated by VPR.
8read_verilog top_post_synthesis.v
9
10# Link the top-level design.
11link_design top
12
13# Read the post-synthesis SDF file.
14read_sdf top_post_synthesis.sdf
15
16# Read the SDC commands generated by VPR.
17read_sdc top_post_synthesis.sdc
18
19# Report the setup and hold timing checks using OpenSTA and write them to files.
20report_checks -group_path_count 100 -digits 3 -path_delay max > open_sta_report_timing.setup.rpt
21report_checks -group_path_count 100 -digits 3 -path_delay min > open_sta_report_timing.hold.rpt
22
23# Report the minimum period of the clocks and their fmax.
24report_clock_min_period
25
26# Exit OpenSTA's TCL terminal.
27# This can be removed if you want terminal access to write TCL commands after
28# executing the prior commands.
29exit
Now that we have a .tcl
file, we can launch OpenSTA from the terminal and run it:
$ sta sdf_delays.tcl
Running this command will open a TCL terminal which will execute all of the commands
in sdf_delays.tcl
. The TCL file above will write setup and hold timing reports (similar to
the reports written by VPR), report the minimum period of all clocks, and then exit the OpenSTA TCL terminal.
You can compare the timing reports generated by OpenSTA (open_sta_report_timing.{setup/hold}.rpt
)
to the timing reports generated by VPR (report_timing.{setup/hold}.rpt
).
You can also compare the minimum period reported by OpenSTA with the final
period reported by VTR at the bottom of vpr_stdout.log
.
The TCL file above is just an example of what OpenSTA can do. For full documentation of the different commands available in OpenSTA, see: https://github.com/parallaxsw/OpenSTA/blob/master/doc/OpenSTA.pdf