Example TCL Script To Extract Timing Information From A Report - Timing Report
Example TCL Script To Extract Timing Information From A Report - Timing Report
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.
> report_timing
Usage
To extract timing information from 'm' number of timing paths:
For example, to extract timing information for the worst timing path:
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. #
#*************************************************************************#
#
# Report the setup, uncertainty, required time and slack for the path.
#
set setup [get_property $path setup]
Puts ""
Puts "Setup: $setup"
#
# Report details of the path by walking through each timing point. Note the timing points are a collection.
#
# Print header.
Puts " +----------+--------------------------------+---------+-------+-------+--------+----------+----------+"
Puts "[format " | %8s | %30s | %7s | %5s | %5s | %6s | %8s | %8s |" instance arc cell slew load fanout delay arrival]"
Puts " +----------+--------------------------------+---------+-------+-------+--------+----------+----------+"
#
# 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