Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Example TCL Script To Extract Timing Information From A Report - Timing Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Example Tcl script to extract timing information from a report_timing report

Explanation of Script
This solution provides an example using the Advanced Timing Tcl commands to extract information from the results of report_timing -collection command. When
you use the -collection option, report_timing returns a collection of timing paths. This is useful for performing Tcl queries on selected timing reports.

Here is a basic timing report generated using the report_timing command:

> report_timing

Path 1: MET Setup Check with Pin u32/CK


Endpoint: u32/D (v) checked with leading edge of 'vclk'
Beginpoint: u30/Q (v) triggered by leading edge of 'vclk'
Path Groups: {vclk}
Analysis View: AV_wc_on
Other End Arrival Time 1.000
- Setup 0.332
+ Phase Shift 8.000
= Required Time 8.668
- Arrival Time 8.658
= Slack Time 0.010
Clock Rise Edge 0.000
+ Clock Network Latency (Ideal) -0.300
= Beginpoint Arrival Time -0.300
+---------------------------------------------------------------+
| Instance | Arc | Cell | Delay | Arrival | Required |
| | | | | Time | Time |
|----------+-------------+---------+-------+---------+----------|
| u30 | CK ^ | | | -0.300 | -0.290 |
| u30 | CK ^ -> Q v | DFFHQX1 | 0.258 | -0.042 | -0.032 |
| u31 | A v -> Y v | BUFXL | 8.700 | 8.658 | 8.668 |
| u32 | D v | DFFHQX1 | 0.000 | 8.658 | 8.668 |
+---------------------------------------------------------------+

Usage
To extract timing information from 'm' number of timing paths:

> set paths [report_timing -max_paths m -collection ]


> source report_collection_path.tcl

For example, to extract timing information for the worst timing path:

> set paths [report_timing -collection ]


> source report_collection_path.tcl

START POINT: u30/CK


Begin Point Arrival Time: -0.300
END POINT: u32/D
Other End Arrival Time: 1.000

Setup: 0.332
Uncertainty: 0.000
Required Time: 8.668
Slack: 0.010

+----------+--------------------------------+---------+-------+-------+--------+----------+----------+
| instance | arc | cell | slew | load | fanout | delay | arrival |
+----------+--------------------------------+---------+-------+-------+--------+----------+----------+
| u30 | u30/CK (rise) | | 0.000 | 0.003 | 1 | | -0.300 |
| u30 | u30/CK (rise) -> u30/Q (fall) | DFFHQX1 | 0.075 | 0.002 | 1 | 0.258 | -0.042 |
| u31 | u31/A (fall) -> u31/Y (fall) | BUFXL | 0.064 | 0.003 | 1 | 8.700 | 8.658 |
| u32 | u32/D (fall) | DFFHQX1 | 0.064 | 0.003 | | 0.000 | 8.658 |

#+----------+--------------------------------+---------+-------+-------+--------+-----#-----+----------+

Code
Content of report_collection_path.tcl:

#*************************************************************************#
# 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. #
#*************************************************************************#

foreach_in_collection path $paths {


set startPointPtr [get_property $path launching_point]
set startPointName [get_object_name $startPointPtr]
set launchingClockLatency [get_property $path launching_clock_latency]
Puts ""
Puts "START POINT: $startPointName"
Puts "Begin Point Arrival Time: $launchingClockLatency"
#
# Report the end point and its latency.
#
set endPointPtr [get_property $path capturing_point]
set endPointName [get_object_name $endPointPtr]
set capturingClockLatency [get_property $path capturing_clock_latency]

Puts "END POINT: $endPointName"


Puts "Other End Arrival Time: $capturingClockLatency"

#
# Report the setup, uncertainty, required time and slack for the path.
#
set setup [get_property $path setup]
Puts ""
Puts "Setup: $setup"

set uncertainty [get_property $path clock_uncertainty]


Puts "Uncertainty: $uncertainty"

set requiredTime [get_property $path required_time]


Puts "Required Time: $requiredTime"

set slack [get_property $path slack]


Puts "Slack: $slack"
Puts ""

#
# Report details of the path by walking through each timing point. Note the timing points are a collection.
#

# Store timing points collection to $timingPoints.


set timingPoints [get_property $path timing_points]

# Print header.
Puts " +----------+--------------------------------+---------+-------+-------+--------+----------+----------+"
Puts "[format " | %8s | %30s | %7s | %5s | %5s | %6s | %8s | %8s |" instance arc cell slew load fanout delay arrival]"
Puts " +----------+--------------------------------+---------+-------+-------+--------+----------+----------+"

# Variable to see if we're on the first point.


set pointNum 1

#
# Walk through each timing point
#
foreach_in_collection point $timingPoints {
set arrival [get_property $point arrival]
set pinPtr [get_property $point pin]
set pin [get_object_name $pinPtr]
set direction [get_property $pinPtr direction]
set instPtr [get_cells -of_objects $pin]
set cell [get_property $instPtr ref_lib_cell_name]
set inst [get_object_name $instPtr]
set net [get_property $pinPtr net_name]
set slew [get_property $point slew]
set transition_type [get_property $point transition_type]
#
# Print timing information for each ouptut pin
#
if {$direction == "out"} {
set load [get_property [get_nets $net] capacitance_max]
set fanout [get_property $pinPtr fanout]
if {$transition_type == "fall"} {
set maxDelay [get_property [get_arcs -from $prevPoint -to $pin] delay_max_fall]
} else {
set maxDelay [get_property [get_arcs -from $prevPoint -to $pin] delay_max_rise]
}
Puts "[format " | %8s | %6s (%4s) -> %6s (%4s) | %7s | %5s | %5s | %6s | %8s | %8s |" $inst $prevPoint $prevTranType
$pin $transition_type $cell $slew $load $fanout $maxDelay $arrival]"
}
#
# Print timing information for the first point
#
if {$pointNum == 1} {
set required [expr $requiredTime - $arrival]
set load [get_property [get_nets $net] capacitance_max]
set fanout [get_property $pinPtr fanout]
Puts "[format " | %8s | %6s (%4s) %17s| %7s | %5s | %5s | %6s | %8s | %8s |" $inst $pin $transition_type "" "" $slew
$load $fanout "" $arrival]"
} else {
#
# Store points to report final timing arc
#
set point1 $prevPoint
set point2 $pin
}

#
# Update variables
#
set pointNum [expr $pointNum + 1]
set prevPoint $pin
set prevArrival $arrival
set prevTranType $transition_type
}
#
# Print end point timing information
#
set load [get_property [get_nets $net] capacitance_max]
set fanout [get_property $pinPtr fanout]
if {$transition_type == "fall"} {
set maxDelay [get_property [get_arcs -from $point1 -to $point2] delay_max_fall]
} else {
set maxDelay [get_property [get_arcs -from $point1 -to $point2] delay_max_rise]
}
Puts "[format " | %8s | %6s (%4s) %16s | %7s | %5s | %5s | %6s | %8s | %8s |" $inst $pin $transition_type "" $cell $slew
$load "" $maxDelay $arrival]"
Puts "
#+----------+--------------------------------+---------+-------+-------+--------+-----#-----+----------+"
}
##################################################################
# End Script
##################################################################

Internal Notes
None
Return to the top of the page

You might also like