From 312878c578533b952617015251da4698bcbfea1f Mon Sep 17 00:00:00 2001 From: James Cherry Date: Sun, 25 Apr 2021 17:03:05 -1000 Subject: [PATCH] report_slew -corner --- include/sta/Sta.hh | 7 ++++++- search/Sta.cc | 11 +++++++++++ tcl/Graph.tcl | 19 ++++++++++++++----- tcl/StaTcl.i | 19 +++++++++---------- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/include/sta/Sta.hh b/include/sta/Sta.hh index 5155089a..148f99d3 100644 --- a/include/sta/Sta.hh +++ b/include/sta/Sta.hh @@ -1009,7 +1009,12 @@ public: const PathAnalysisPt *path_ap); void vertexSlacks(Vertex *vertex, Slack (&slacks)[RiseFall::index_count][MinMax::index_count]); - // Slew for one delay calc analysis pt(corner). + // Slew for one corner. + Slew vertexSlew(Vertex *vertex, + const RiseFall *rf, + const Corner *corner, + const MinMax *min_max); + // Slew for one delay calc analysis pt (corner min/max). Slew vertexSlew(Vertex *vertex, const RiseFall *rf, const DcalcAnalysisPt *dcalc_ap); diff --git a/search/Sta.cc b/search/Sta.cc index d850a9c3..ff9c3c11 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -3170,6 +3170,17 @@ Sta::setArcDelayAnnotated(Edge *edge, graph_delay_calc_->delayInvalid(to); } +Slew +Sta::vertexSlew(Vertex *vertex, + const RiseFall *rf, + const Corner *corner, + const MinMax *min_max) +{ + findDelays(vertex); + const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(min_max); + return graph_->slew(vertex, rf, dcalc_ap->index()); +} + Slew Sta::vertexSlew(Vertex *vertex, const RiseFall *rf, diff --git a/tcl/Graph.tcl b/tcl/Graph.tcl index 1af8436f..89fd218a 100644 --- a/tcl/Graph.tcl +++ b/tcl/Graph.tcl @@ -292,14 +292,23 @@ proc edge_disable_reason_verbose { edge } { ################################################################ -define_cmd_args "report_slews" { pin } +define_cmd_args "report_slews" {[-corner corner] pin} -proc report_slews { pin } { +proc report_slews { args } { global sta_report_default_digits - set pin1 [get_port_pin_error "pin" $pin] - foreach vertex [$pin1 vertices] { - report_line "[vertex_path_name $vertex] [rise_short_name] [format_times [$vertex slews rise] $sta_report_default_digits] [fall_short_name] [format_times [$vertex slews fall] $sta_report_default_digits]" + parse_key_args "report_slews" args keys {-corner} flags {} + check_argc_eq1 "report_slews" $args + + set corner [parse_corner_or_all keys] + set pin [get_port_pin_error "pin" [lindex $args 0]] + set digits $sta_report_default_digits + foreach vertex [$pin vertices] { + if { $corner == "NULL" } { + report_line "[vertex_path_name $vertex] [rise_short_name] [format_time [$vertex slew rise min] $digits]:[format_time [$vertex slew rise max] $digits] [fall_short_name] [format_time [$vertex slew fall min] $digits]:[format_time [$vertex slew fall max] $digits]" + } else { + report_line "[vertex_path_name $vertex] [rise_short_name] [format_time [$vertex slew_corner rise $corner min] $digits]:[format_time [$vertex slew_corner rise $corner max] $digits] [fall_short_name] [format_time [$vertex slew_corner fall $corner min] $digits]:[format_time [$vertex slew_corner fall $corner max] $digits]" + } } } diff --git a/tcl/StaTcl.i b/tcl/StaTcl.i index 2605d626..32b76f9a 100644 --- a/tcl/StaTcl.i +++ b/tcl/StaTcl.i @@ -5889,16 +5889,6 @@ bool is_bidirect_driver() { return self->isBidirectDriver(); } int level() { return Sta::sta()->vertexLevel(self); } int tag_group_index() { return self->tagGroupIndex(); } -TmpFloatSeq * -slews(RiseFall *rf) -{ - Sta *sta = Sta::sta(); - TmpFloatSeq *floats = new FloatSeq; - for (auto dcalc_ap : sta->corners()->dcalcAnalysisPts()) - floats->push_back(delayAsFloat(sta->vertexSlew(self, rf, dcalc_ap))); - return floats; -} - Slew slew(const RiseFall *rf, const MinMax *min_max) @@ -5907,6 +5897,15 @@ slew(const RiseFall *rf, return sta->vertexSlew(self, rf, min_max); } +Slew +slew_corner(const RiseFall *rf, + const Corner *corner, + const MinMax *min_max) +{ + Sta *sta = Sta::sta(); + return sta->vertexSlew(self, rf, corner, min_max); +} + VertexOutEdgeIterator * out_edge_iterator() {