13
namespace eval path_summary { set finfo(index) {int {index number of path in original path collection (0, 1, 2...)} {{index} {#}}} set finfo(startpoint) {string {name of path startpoint} {{startpoint} {name}}} set finfo(endpoint) {string {name of path endpoint} {{endpoint} {name}}} set finfo(start_clk) {string {name of startpoint launching clock} {{startpoint} {clock}}} set finfo(end_clk) {string {name of endpoint capturing clock} {{endpoint} {clock}}} set finfo(launch_latency) {real {launching clock latency} {{launch} {latency}}} set finfo(capture_latency) {real {capturing clock latency} {{capture} {latency}}} set finfo(skew) {real {skew between launch/capture clock (negative is tighter)} {{clock} {skew}}} set finfo(crpr) {real {clock reconvergence pessimism removal amount} {{CRPR} {amount}}} set finfo(path_group) {string {path group name} {{path} {group}}} set finfo(slack) {real {path slack} {{path} {slack}}} set finfo(duration) {real {combinational path delay between startpoint and endpoint} {{path} {duration}}} set finfo(levels) {real {levels of combinational logic} {{levels} {of logic}}} set finfo(hier_pins) {int {number of hierarchy pins in path} {{# hier} {pins}}} set finfo(num_segments) {int {number of segments in path} {{#} {segments}}} set finfo(num_unique_segments) {int {number of unique segments in path} {{# unique} {segments}}} set finfo(num_segment_crossings) {int {number of segment crossings in path} {{# segment} {crossings}}} set finfo(average_cell_delay) {real {average combinational cell delay (duration / levels)} {{average} {cell delay}}} set finfo(slowest_cell) {string {name of slowest cell in path} {{slowest} {cell}}} set finfo(slowest_cell_delay) {real {cell delay of slowest cell in path} {{slowest} {cell delay}}} set finfo(slowest_net) {string {name of slowest net in path} {{slowest} {net}}}

Write Path Summary1

Embed Size (px)

Citation preview

namespace eval path_summary { set finfo(index) {int {index number of path in original path collection (0, 1, 2...)} {{index} {#}}} set finfo(startpoint) {string {name of path startpoint} {{startpoint} {name}}} set finfo(endpoint) {string {name of path endpoint} {{endpoint} {name}}} set finfo(start_clk) {string {name of startpoint launching clock} {{startpoint} {clock}}} set finfo(end_clk) {string {name of endpoint capturing clock} {{endpoint} {clock}}} set finfo(launch_latency) {real {launching clock latency} {{launch} {latency}}} set finfo(capture_latency) {real {capturing clock latency} {{capture} {latency}}} set finfo(skew) {real {skew between launch/capture clock (negative is tighter)} {{clock} {skew}}} set finfo(crpr) {real {clock reconvergence pessimism removal amount} {{CRPR} {amount}}} set finfo(path_group) {string {path group name} {{path} {group}}} set finfo(slack) {real {path slack} {{path} {slack}}} set finfo(duration) {real {combinational path delay between startpoint and endpoint} {{path} {duration}}} set finfo(levels) {real {levels of combinational logic} {{levels} {of logic}}} set finfo(hier_pins) {int {number of hierarchy pins in path} {{# hier} {pins}}} set finfo(num_segments) {int {number of segments in path} {{#} {segments}}} set finfo(num_unique_segments) {int {number of unique segments in path} {{# unique} {segments}}} set finfo(num_segment_crossings) {int {number of segment crossings in path} {{# segment} {crossings}}} set finfo(average_cell_delay) {real {average combinational cell delay (duration / levels)} {{average} {cell delay}}} set finfo(slowest_cell) {string {name of slowest cell in path} {{slowest} {cell}}} set finfo(slowest_cell_delay) {real {cell delay of slowest cell in path} {{slowest} {cell delay}}} set finfo(slowest_net) {string {name of slowest net in path} {{slowest} {net}}} set finfo(slowest_net_delay) {real {net delay of slowest net in path} {{slowest} {net delay}}} set finfo(slowest_net_R) {real {resistance of slowest net in path} {{slowest} {net R}}} set finfo(slowest_net_C) {real {capacitance of slowest net in path} {{slowest} {net C}}} set finfo(total_net_delay) {real {summation of all net delays in path} {{total} {net delay}}} set finfo(max_trans) {real {slowest pin transition in path} {{max} {transition}}} set finfo(total_xtalk_data) {real {summation of all crosstalk deltas in data path} {{data} {xtalk}}} set finfo(total_xtalk_clock) {real {summation of all crosstalk deltas in clock path} {{clock} {xtalk}}} set finfo(total_xtalk) {real {summation of all crosstalk deltas in clock/data path} {{total} {xtalk}}} set finfo(xtalk_ratio) {real {percentage ratio of 'total_xtalk_data' versus 'duration'} {{xtalk} {ratio}}} set known_fields {index startpoint endpoint start_clk end_clk launch_latency capture_latency skew crpr path_group slack duration levels hier_pins num_segments num_unique_segments num_segment_crossings average_cell_delay slowest_cell slowest_cell_delay slowest_net slowest_net_delay slowest_net_R slowest_net_C total_net_delay max_trans total_xtalk_data total_xtalk_clock total_xtalk xtalk_ratio}

proc max {a b} { return [expr $a > $b ? $a : $b] }

proc min {a b} { return [expr $a < $b ? $a : $b] }}

proc process_paths {args} { set results(-ungrouped) {} parse_proc_arguments -args $args results

if {[set paths [filter_collection $results(paths) {object_class == timing_path}]] == ""} { echo "Error: no timing paths provided" return 0 }

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 ""

# now build a list of all ungrouped hierarchical cells while {$cells != ""} { set cell [index_collection $cells 0] set hier_cells [get_cells -quiet "[get_object_name $cell]/*" -filter "is_hierarchical == true"] set cells [remove_from_collection $cells $cell] set cells [append_to_collection -unique cells $hier_cells] set ungrouped_cells [append_to_collection -unique ungrouped_cells $cell] } }

# come up with a list of index numbers where we want to print progress if {[set num_paths [sizeof $paths]] >= 25} { set index_notice_point 0 set index_notice_messages {"\n(0%.."} set index_notice_points {} for {set i 10} {$i $results(-max_paths)} { set data_list [lrange $data_list 0 [expr $results(-max_paths)-1]] }

# generate a list of field index numbers relating to our known fields set field_indices {} foreach field $results(-fields) { lappend field_indices [lsearch $path_summary::known_fields $field] }

# 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

# check widths of each line of header foreach header [lindex $this_finfo 2] { set this_max_length [path_summary::max $this_max_length [string length $header]] }

# check widths of data

switch [lindex $this_finfo 0] { real { set max_pre 0 set max_post 0 foreach item $data_list { if {[set this_item [lindex $item $index]] == {INFINITY} || $this_item == {-INFINITY}} { set max_pre 3 set max_post 0 } else { regexp {([-0-9]*\.?)(.*)} [expr $this_item] dummy pre post set max_pre [path_summary::max $max_pre [string length $pre]] set max_post [path_summary::max $max_post [string length $post]] } }

if {[info exists results(-significant_digits)]} { set max_post $results(-significant_digits) } else { set max_post [path_summary::min $max_post 7] }

set this_max_length [path_summary::max $this_max_length [expr $max_pre + $max_post]] } default { foreach item $data_list { set this_max_length [path_summary::max $this_max_length [string length [lindex $item $index]]] } } }

set max_length($index) $this_max_length

switch [lindex $this_finfo 0] { int { set formatting($index) "%${this_max_length}d" } real { set formatting($index) "%${this_max_length}.${max_post}f" } string { set formatting($index) "%-${this_max_length}s" } }

echo "$this_field - [lindex $this_finfo 1]" }

# now print header echo "" for {set i 0} {$i