A TCL Proc To Create A Quick SPEF From A Netlist Without Need For RC Extraction
A TCL Proc To Create A Quick SPEF From A Netlist Without Need For RC Extraction
Explanation of Script
It is a good idea to start timing and Spice analysis with a small testcase. Often, the netlist is hand written to just show the circuit. Many times, you do not have the PnR
layout for these experimental cases to run actual SPEF RC extract, but you want to provide a formally correct SPEF parasitics file to the timing engine or Spice simulation
tools in the Tempus tool.
The Tcl proc provided here uses the database access functionality to gather information of a netlist and then writes out a syntactically correct SPEF file for timing analysis.
A collection of the nets that you wish to consider for the SPEF
Numerical values for the resistors and capacitors to be put into the SPEF
An output file name for the created SPEF file
Following is the simple schematic and netlist based on which you decide how you want to construct the resistor and capacitor topology for the SPEF.
You want to construct a topology that gives a picture relatively close to the design reality.
For the above simple netlist, you load the testcase and perform a timing analysis.
read_lib ./LIB/STDCELL.lib
read_verilog ./3buf.v
set_top_module buf3
read_sdc top.sdc
set_global report_timing_format { cell arc fanout load annotation delay slew arrival hpin }
update_timing
report_timing -from in -to out1
###############################################################
Path 1: MET Late External Delay Assertion
Endpoint: out2 (v) checked with leading edge of 'clock'
Beginpoint: in (v) triggered by leading edge of 'clock'
Path Groups: {clock}
Other End Arrival Time 0.000
- External Delay 0.500
+ Phase Shift 10.000
= Required Time 9.500
- Arrival Time 0.827
= Slack Time 8.673
Clock Rise Edge 0.000
+ Input Delay 0.500
= Beginpoint Arrival Time 0.500
--------------------------------------------------------------------------------
Cell Arc Fanout Load Arc Delay Slew Arrival Pin
Annotation Time
--------------------------------------------------------------------------------
- in v 1 0.004 WLM - 0.004 0.500 in ->
BUFFHVTD2 I v -> Z v 2 0.008 WLM 0.111 0.048 0.611 I0/Z
BUFFHVTD2 I v -> Z v 1 0.004 WLM 0.114 0.039 0.725 I2/Z
BUFFHVTD2 I v -> Z v 1 0.000 WLM 0.102 0.029 0.827 I3/Z
- out2 v - 0.000 WLM 0.000 0.029 0.827 out2 ->
--------------------------------------------------------------------------------
Notice here that only wire load model parasitics are provided in the timing analysis. This may not be realistic. Suppose you want to do Spice analysis on the path using the
create_spice_deck command; you will not find realistic connection resistors and load capacitors in the Spice deck. (Spice deck not shown here)
Now, use the script provided and create a SPEF, apply the SPEF, and perform the timing analysis again. For your SPEF, you chose a net capacitance of 0.1fF and
10ohm, which are realistic values for a larger technology node.
source ./testspef.tcl
set mynets [ get_nets {in w* out*} ]
testspef -net_collection $mynets -net_cap 0.1 -net_res 10.0 -outfile testspef.spef
read_spef testspef.spef testspef.spef
update_timing -full
report_timing -from in -to out1
###############################################################
Path 1: MET Late External Delay Assertion
Endpoint: out2 (^) checked with leading edge of 'clock'
Beginpoint: in (^) triggered by leading edge of 'clock'
Path Groups: {clock}
Other End Arrival Time 0.000
- External Delay 0.500
+ Phase Shift 10.000
= Required Time 9.500
- Arrival Time 1.670
= Slack Time 7.830
Clock Rise Edge 0.000
+ Input Delay 0.500
= Beginpoint Arrival Time 0.500
--------------------------------------------------------------------------------
Cell Arc Fanout Load Arc Delay Slew Arrival Pin
Annotation Time
--------------------------------------------------------------------------------
- in ^ 1 0.104 SPEF - 0.004 0.500 in ->
BUFFHVTD2 I ^ -> Z ^ 2 0.108 SPEF 0.322 0.450 0.822 I0/Z
BUFFHVTD2 I ^ -> Z ^ 1 0.104 SPEF 0.430 0.435 1.252 I2/Z
BUFFHVTD2 I ^ -> Z ^ 1 0.100 SPEF 0.418 0.419 1.669 I3/Z
- out2 ^ - 0.100 SPEF 0.001 0.419 1.670 out2 ->
--------------------------------------------------------------------------------
Notice here that you now show proper SPEF annotation in the report as well as your delay and slew values show the impact of the RC loading. These are more realistic
values. You can also use create_spice_deck, and you will have a better interconnect model for the Spice simulation.
Usage
read_lib ./LIB/STDCELL.lib
read_verilog ./3buf.v
set_top_module buf3
source ./testspef.tcl
set mynets [ get_nets {in w* out*} ]
testspef -net_collection $mynets -net_cap 0.1 -net_res 10.0 -outfile test.spef
read_spef test.spef
update_timing -full
report_timing -from in -to out1
Code
#################################################
# testspef.tcl
#################################################
switch $argname {
-net_collection {set net_coll $opts($argname)}
-net_cap {set net_cap $opts($argname)}
-net_res {set net_res $opts($argname)}
-outfile {set outfile $opts($argname)}
default { Puts "This should not happen" }
}
}
Internal Notes
None
Return to the top of the page