• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Blogs
  2. Digital Design
  3. Programmatically Troubleshooting Timing Violations With…
BobD
BobD

Community Member

Blog Activity
Options
  • Subscribe by email
  • More
  • Cancel
CDNS - RequestDemo

Have a question? Need more information?

Contact Us
Static timing analysis
CTE-TCL
Digital Implementation
scripting
tcl

Programmatically Troubleshooting Timing Violations With "report_timing -collection"

9 Feb 2009 • 4 minute read

Has something like the following ever happened to you?

You've placed and optimized a design, and you see what appears to be timing violations that could be fixed with cell changes on the worst path in the design.  Like the path below that has a lot of "X1" strength cells (don't worry, I contrived this case by timing the design prior to running optDesign to exaggerate the point):

Photobucket

If you wanted to test the theory that timing on this path could be improved by changing all of the "X1" strength drivers to "X2" strength, how would you go about it?

I've seen scripts that parse the text output of report_timing and try to find the instance name strings that need to be upsized, but that's clunky and the parsing is a nightmare.  Another approach is to use "report_timing -tcl_list" but that merely creates a massive list of strings that aren't sorted very usefully.

What I *have* found useful is "report_timing -collection".

Here's a script that replaces all of the X1 cells in the worst path in the design with X2 cells:

set collection [report_timing -collection]
set timing_points [get_property $collection timing_point]
set instNameList {}
foreach_in_collection timing_point $timing_points {
  set pin_name [get_property [get_property $timing_point pin] hierarchical_name]
  set inst_name [file dirname $pin_name]
  if {[lsearch $instNameList $inst_name] == -1} {
      lappend instNameList $inst_name
  }
}

foreach instName $instNameList {
  set inst [dbGetInstByName $instName]
  set cellName [dbGet $inst.cell.name]
  if {[string match *X1 $cellName]} {
    regsub {X1$} $cellName {X2} newCellName
    ecoChangeCell -inst $instName -cell $newCellName
  }
}

Okay, let's break it down Kari Summers-style. First, we'll capture a list of the unique instances in the path:

set collection [report_timing -collection] --> capture the output of report_timing -collection to a variabel for later processing (tip: use "report_property $collection" to query all of the fields report_property -collection returns)
set timing_points [get_property $collection timing_points] --> we'll pick off the "timing_points" field which is a list of all the pins along the path
set instNameList {} --> initialize an empty list which we'll use to capture a unique list of instances on the path
foreach_in_collection timing_point $timing_points { --> iterate through each of these timing points
  set pin_name [get_property [get_property $timing_point pin] hierarchical_name] --> the pin names are of the for i0/Y
  set inst_name [file dirname $pin_name] --> this is a handy trick I learned from Ed Martinage (our Common Timing Engine guru) for stripping the tailing "/Y" off pin names
  if {[lsearch $instNameList $inst_name] == -1} { --> add each instance to the list only if it isn't there already to create a unique list of instances
     lappend instNameList $inst_name
  }
}

Next, we'll iterate through this list and change the cells from "X1" to "X2" strength:

foreach instName $instNameList { --> iterate through each unique instance name
  set inst [dbGetInstByName $instName] --> get the instance pointer...
  set cellName [dbGet $inst.cell.name] --> ...and use dbGet to find the instance's cell name
  if {[string match *X1 $cellName]} { --> check whether the cell name ends in "X1"
    regsub {X1$} $cellName {X2} newCellName --> if so swap it out for an X2 cell:
    ecoChangeCell -inst $instName -cell $newCellName
  }
}

This in turn will call ecoChangeCell for each matched instance, changing them from X1 cells to X2s:

<CMD> ecoChangeCell -inst DTMF_INST/TDSP_CORE_INST/EXECUTE_INST/top_reg_0 -cell SEDFFX2
Starting refinePlace ...
Statistics of distance of Instance movement in detailed placement:
  maximum (X+Y) =         0.00 um
  mean    (X+Y) =         0.00 um
Total instances moved : 0
*** cpu=0:00:00.1   mem=276.3M  mem(used)=0.0M***
Resize DTMF_INST/TDSP_CORE_INST/EXECUTE_INST/top_reg_0 (SEDFFX1) to SEDFFX2.

Notes:

  • If the X2 strength of a given cell doesn't exist, ecoChangeCell will warn and proceed
  • Another approach to this could have been to use "ecoChangeCell -upsize" instead of explicity identifying the desired cell name
  • "setOptMode -updateTiming -false" can be used to suppress timing updates when implementing a series of changes
I think there are lots of situations where "report_timing -collection" could be useful. I personally use it when creating testcases for our developers.  I'll establish a PASS/FAIL criteria that, for example, no HVT cells should appear on the worst path in the design with negative slack (else the HVT cell should have been swapped out for a non-HVT and timing would have been improved). I hope this example shows a framework with sufficient detail that it is a helpful starting point for building other scripts.

By the way, I received inspiration for this kind of post from Nir Dahan's Adventures in Digital ASIC Design (http://asicdigitaldesign.wordpress.com). His focus is a little more front-end than mine, but I like his useful approach to blogging. I'd encourage you to check him out.

Update (July 26, 2010): I wrote some examples of how to capture the delay through an individual instance in this post.

Question of the Day: What do you think of this approach? Have you used "report_timing -collection"? Can you think of other scenarios where this could be useful?


CDNS - RequestDemo

Try Cadence Software for your next design!

Free Trials

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information