0% found this document useful (0 votes)
78 views2 pages

How To Report WNS and TNS For Selected Set of Cell Instances

tempus rm script

Uploaded by

thsim85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views2 pages

How To Report WNS and TNS For Selected Set of Cell Instances

tempus rm script

Uploaded by

thsim85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

How to report WNS and TNS for selected set of cell instances

Explanation of Script
This script can be used to report the WNS and TNS of a set of instances selected in the tool in CUI (Common UI). This will help you to see and debug the timing criticality
of instances in a particular region of the floorplan.

It is a good idea to analyze the WNS and TNS that is related to a set of instances that might be placed close together or in a certain region. In this script, a Tcl proc will
take a user-selected set of instances and then use Innovus DB access commands to gather timing information from the set.

This script will use DB access functions to gather the information.

Using the dbGet command to gather the list of selected objects.


This uses ‘dbGet selected.<…>’ to collect the Tcl list of names of the selected instance. The original selection might include many more object types like nets,
pins, and ports, and you must filter those down to instances only.
From the Tcl list of instance names, this will use access commands to the timing properties of the input or output pins of the instances.
This retrieves the timing slack for each pin and then computes the total sum of negative slack for TNS and determines the worst slack for WNS.
In an optional verbose mode, this will print the slack for every pin name found in the selected set in addition to WNS and TNS. This will be a lot of data if the
selected set is large, and it should be used carefully.
This script provides Tcl proc for Innovus and Tempus to analyze the timing of the selected object set.

Note: The design must be timing analyzed for the Tcl proc to work properly.

Usage
# Source the attached script or the script mentioned in the "Code" section.

> source selected_slack.tcl

# Use the -help option with the selected_slack command to get the help on this command.

> selected_slack -help

Description:
Get WNS and TNS from selected cells

Usage: selected_slack [-help] [-in_out {in out}] [-verbose] [-setup | -hold ]

-help # Prints out the command usage


-hold # compute hold slack. (bool, optional)
-in_out {in out} # Report slack at input or output pins of selected cells. Default output (enum, optional)
-setup # compute setup slack. (default) (bool, optional)
-verbose # Extra detail. (bool, optional)

Sample usage and results

In the following example design, you can see a cluster of cells near a routing channel between macro blocks. You may want to debug the WNS and TNS for those
instances.

You can select the instances with the mouse.

You can now call the Tcl proc.

The proc tells you the number of selected instances (194) and the number of output pins (192) on those instances. (By default, the proc lists info for the output direction of
the instance pins.)

Note: The worst slack is actually positive. In that sense, there is no negative slack but the proc still prints it out for clarity. Because there is no negative slack, the summed
up TNS is 0.0ns.

This shows a different selection that has a negative slack.

For the same selection, this shows the result for the input pins.
Code
#*************************************************************************#
# DISCLAIMER: The code is provided for Cadence customers #
# to use at their own risk. The code may require modification to #
# satisfy the requirements of any user. The code and any modifications #
# to the code may not be compatible with current or future versions of #
# Cadence products. THE CODE IS PROVIDED \"AS IS\" AND WITH NO WARRANTIES,#
# INCLUDING WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED #
# WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. #
#*************************************************************************#

proc sum_l {lst} {


set sum 0.0
set ct 0
foreach l $lst { if {$l < 0.0} {set sum [ expr { $sum + $l } ] ; incr ct } }
return "$sum $ct"
}

define_proc_arguments selected_slack -info "Get WNS and TNS from selected cells" -define_args {
{ -setup "compute setup slack. (default)" "" boolean {optional
mutual_exclusive_group s_h } }
{ -hold "compute hold slack." "" boolean {optional
mutual_exclusive_group s_h } }
{ -verbose "Extra detail." "" boolean optional }
{ -in_out "Report slack at input or output pins of selected cells. Default output" "" one_of_string {optional
{values {in out}}}}
}

proc selected_slack { args } {

set s_h "slack_max"


set in_out "out"
set verbose "false"

parse_proc_arguments -args $args opts


foreach argname [array names opts] {
switch $argname {
-setup { set s_h "slack_max" }
-hold { set s_h "slack_min" }
-verbose { set verbose "true" }
-in_out { set in_out $opts($argname)}
default { Puts "This should not happen" }
}
}

set inst_l [get_cells [dbget [dbget -p selected.objType inst].name]]


set pin_l [get_pins -of_objects $inst_l -filter "direction==${in_out} && ${s_h}!=INFINITY"]
foreach_in_collection pin $pin_l {
set slack_h([get_object_name $pin]) [ get_property $pin $s_h ]
}

set pin_slack_sort [lsort -real -stride 2 -index 1 [array get slack_h]]

puts [format "%20s = %6d" "Selected instances" [sizeof_collection $inst_l]]


puts [format "%20s = %6d" "Pins($in_out)" [sizeof_collection $pin_l]]
puts [format "%20s = %8.4f (pin : %s)" "WNS" [ lindex $pin_slack_sort 1 ] [ lindex $pin_slack_sort 0 ] ]

set slack_l {}
foreach {pin slack} $pin_slack_sort { lappend slack_l $slack }
lassign [ sum_l $slack_l ] sum ct
puts [ format "%20s = %8.4f ( #pins = %5d )" "TNS" $sum $ct ]

if { $verbose == "true" } {
foreach {pin slack} $pin_slack_sort {
puts [ format "Slack= %7.3f Pin= %s" $slack $pin]
}
}
}

Internal Notes
None
Return to the top of the page

You might also like