@@ -1990,9 +1990,35 @@ Sta::makeGroupPath(const char *name,
19901990bool
19911991Sta::isGroupPathName (const char *group_name)
19921992{
1993- return PathGroups::isGroupPathName (group_name)
1994- || sdc_->findClock (group_name)
1995- || sdc_->isGroupPathName (group_name);
1993+ return isPathGroupName (group_name);
1994+ }
1995+
1996+ bool
1997+ Sta::isPathGroupName (const char *group_name) const
1998+ {
1999+ return sdc_->findClock (group_name)
2000+ || sdc_->isGroupPathName (group_name)
2001+ || stringEq (group_name, PathGroups::asyncPathGroupName ())
2002+ || stringEq (group_name, PathGroups::pathDelayGroupName ())
2003+ || stringEq (group_name, PathGroups::gatedClkGroupName ())
2004+ || stringEq (group_name, PathGroups::asyncPathGroupName ());
2005+ }
2006+
2007+ StdStringSeq
2008+ Sta::pathGroupNames () const
2009+ {
2010+ StdStringSeq names;
2011+ for (const Clock *clk : *sdc_->clocks ())
2012+ names.push_back (clk->name ());
2013+
2014+ for (auto const &[name, group] : sdc_->groupPaths ())
2015+ names.push_back (name);
2016+
2017+ names.push_back (PathGroups::asyncPathGroupName ());
2018+ names.push_back (PathGroups::pathDelayGroupName ());
2019+ names.push_back (PathGroups::gatedClkGroupName ());
2020+ names.push_back (PathGroups::unconstrainedGroupName ());
2021+ return names;
19962022}
19972023
19982024ExceptionFrom *
@@ -3004,13 +3030,84 @@ Sta::pinSlack(const Pin *pin,
30043030 return slack;
30053031}
30063032
3033+ // //////////////////////////////////////////////////////////////
3034+
3035+ class EndpointPathEndVisitor : public PathEndVisitor
3036+ {
3037+ public:
3038+ EndpointPathEndVisitor (const std::string &path_group_name,
3039+ const PathGroups &path_groups,
3040+ const MinMax *min_max,
3041+ const StaState *sta);
3042+ PathEndVisitor *copy () const ;
3043+ void visit (PathEnd *path_end);
3044+ Slack slack () const { return slack_; }
3045+
3046+ private:
3047+ const std::string &path_group_name_;
3048+ const PathGroups &path_groups_;
3049+ const MinMax *min_max_;
3050+ Slack slack_;
3051+ const StaState *sta_;
3052+ };
3053+
3054+ EndpointPathEndVisitor::EndpointPathEndVisitor (const std::string &path_group_name,
3055+ const PathGroups &path_groups,
3056+ const MinMax *min_max,
3057+ const StaState *sta) :
3058+ path_group_name_ (path_group_name),
3059+ path_groups_ (path_groups),
3060+ min_max_ (min_max),
3061+ slack_ (MinMax::min()->initValue ()),
3062+ sta_(sta)
3063+ {
3064+ }
3065+
3066+ PathEndVisitor *
3067+ EndpointPathEndVisitor::copy () const
3068+ {
3069+ return new EndpointPathEndVisitor (path_group_name_, path_groups_, min_max_, sta_);
3070+ }
3071+
3072+ void
3073+ EndpointPathEndVisitor::visit (PathEnd *path_end)
3074+ {
3075+ if (path_end->minMax (sta_) == min_max_
3076+ && path_groups_.pathGroup (path_end)->name () == path_group_name_) {
3077+ Slack end_slack = path_end->slack (sta_);
3078+ if (delayLess (end_slack, slack_, sta_))
3079+ slack_ = end_slack;
3080+ }
3081+ }
3082+
3083+ Slack
3084+ Sta::endpointSlack (const Pin *pin,
3085+ const std::string &path_group_name,
3086+ const MinMax *min_max)
3087+ {
3088+ ensureGraph ();
3089+ Vertex *vertex = graph_->pinLoadVertex (pin);
3090+ if (vertex) {
3091+ findRequired (vertex);
3092+ // Make path groups to use PathGroups::pathGroup(PathEnd).
3093+ PathGroups path_groups (this );
3094+ VisitPathEnds visit_ends (this );
3095+ EndpointPathEndVisitor path_end_visitor (path_group_name, path_groups, min_max, this );
3096+ visit_ends.visitPathEnds (vertex, &path_end_visitor);
3097+ return path_end_visitor.slack ();
3098+ }
3099+ else
3100+ return INF;
3101+ }
3102+
3103+ // //////////////////////////////////////////////////////////////
3104+
30073105Slack
30083106Sta::vertexSlack (Vertex *vertex,
30093107 const MinMax *min_max)
30103108{
30113109 findRequired (vertex);
3012- const MinMax *min = MinMax::min ();
3013- Slack slack = min->initValue ();
3110+ Slack slack = MinMax::min ()->initValue ();
30143111 VertexPathIterator path_iter (vertex, this );
30153112 while (path_iter.hasNext ()) {
30163113 Path *path = path_iter.next ();
0 commit comments