Write Path Summary
Write Path Summary
tcl
# writes customizable summary table for a collection of paths
#
# v1.0 chrispy 04/02/2004
# initial release
# v1.1 chrispy 05/12/2004
# added startpoint/endpoint clock latency, clock skew, CRPR
# (thanks to John S. for article feedback!)
# v1.2 chrispy 06/15/2004
# changed net/cell delay code to work in 2003.03
# (thanks John Schritz @ Tektronix for feedback on this!)
# v1.3 chrispy 08/31/2004
# fixed append_to_collection bug (again, thanks to John Schritz @
Tektronix!)
# v1.4 chrispy 03/26/2006
# fixed handling of unconstrained paths
# v1.5 chrispy 09/01/2006
# fixed slowest_cell reporting (thanks Pradeep @ OpenSilicon!)
# v1.6 chrispy 11/17/2010
# fix harmless warning when a path has no cells (ie, feedthrough)
# fix harmless warning when a path has no startpoint or endpoint
clock
# v1.7 chrispy 01/31/2012
# rename total_xtalk as total_xtalk_data
# add total_xtalk_clock, total_xtalk (clock+data)
proc max {a b} {
return [expr $a > $b ? $a : $b]
}
proc min {a b} {
return [expr $a < $b ? $a : $b]
}
}
set ungrouped_cells {}
if {[set cells [get_cells -quiet $results(-ungrouped) -filter
"is_hierarchical == true"]] != ""} {
echo "Assuming the following instances have been ungrouped and
flattened for segment processing:"
foreach_in_collection cell $cells {
echo " [get_object_name $cell]"
}
echo ""
set hier_pins 0
set combo_cell_pins 0
set last_cell_port {}
set slowest_cell {}
set slowest_cell_delay "-INFINITY"
set slowest_net_delay "-INFINITY"
set total_net_delay 0
set max_trans 0
set total_xtalk_data 0.0
set total_xtalk_clock 0.0
set hier_cell_paths {}
set last_cell_or_port {}
set change_in_hier 1
set last_cell_or_port {}
set cell_delay {}
set input_pin_arrival {}
foreach_in_collection point [set points [get_attribute $path
points]] {
set object [get_attribute $point object]
set port [get_ports -quiet $object]
set pin [get_pins -quiet $object]
set cell [get_cells -quiet -of $pin]
set is_hier [get_attribute -quiet $cell is_hierarchical]
set annotated_delta_transition [get_attribute -quiet $point
annotated_delta_transition]
if {$is_hier == "true"} {
# if the pin is hierarchical, increment (these are always in
pairs)
incr hier_pins
if {[remove_from_collection $cell $ungrouped_cells] != ""} {
set change_in_hier 1
}
continue
}
# get first data arrival time, but skip any clock-as-data pins
set i 0
while {1} {
set startpoint_arrival [get_attribute [set point [index_collection
$points $i]] arrival]
if {[get_attribute -quiet [get_attribute $point object]
is_clock_pin] != "true"} {
break
}
incr i
}
set list_entry {}
foreach field $path_summary::known_fields {
lappend list_entry $data($field)
}
lappend path_summary::data_list $list_entry
}
echo "Path information stored."
echo ""
}
define_proc_attributes process_paths \
-info "Extract information from paths for write_path_summary" \
-define_args {\
{paths "Timing paths from get_timing_paths" "timing_paths" string
required}
{-ungrouped "Assume these instances have been ungrouped" ungrouped
list optional}
}
# process arguments
set results(-fields) {startpoint endpoint levels slack}
set results(-csv) 0
set results(-descending) 0
parse_proc_arguments -args $args results
set num_fields [llength $results(-fields)]
# generate report
if {$results(-csv)} {
# join multi-line headers together
set headers {}
foreach index $field_indices {
lappend headers [join [lindex $path_summary::finfo([lindex
$path_summary::known_fields $index]) 2] { }]
}
# print headers
echo [join $headers {,}]
# print data
foreach item $data_list {
set print_list {}
foreach index $field_indices {
lappend print_list [lindex $item $index]
}
echo [join $print_list {,}]
}
} else {
# determine maximum column widths
echo ""
echo "Legend:"
foreach index $field_indices {
set this_field [lindex $path_summary::known_fields $index]
set this_finfo $path_summary::finfo($this_field)
set this_max_length 0
set print_list {}
foreach index $field_indices {
lappend print_list [string repeat {-} $max_length($index)]
}
echo [join $print_list {+}]
define_proc_attributes write_path_summary \
-info "Generate a summary report for given timing paths" \
-define_args {\
{-longhelp "Show description of available data fields" "" boolean
optional}
{-max_paths "Limit report to this many paths" "num_paths" int
optional}
{-fields "Information fields of interest" "fields" list optional}
{-sort "Sort by this field" "field" string optional}
{-descending "Sort in descending order" "" boolean optional}
{-csv "Generate CSV report for spreadsheet" "" boolean optional}
{-significant_digits "Number of digits to display" digits int
optional}
}