From 70bb5e9440861e2ef2f523300ac7b3836c6f07db Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 15 Jan 2025 09:17:14 -0700 Subject: [PATCH] report_checks -endpoint_path_count -slack_min Signed-off-by: James Cherry --- include/sta/PathEnd.hh | 6 ++---- include/sta/PathGroup.hh | 1 + search/PathEnd.cc | 6 ++---- search/PathEnum.cc | 2 +- search/PathGroup.cc | 38 ++++++++++++++++++++++++++++++++++++-- 5 files changed, 42 insertions(+), 11 deletions(-) diff --git a/include/sta/PathEnd.hh b/include/sta/PathEnd.hh index b004b36c..272f87e4 100644 --- a/include/sta/PathEnd.hh +++ b/include/sta/PathEnd.hh @@ -68,8 +68,7 @@ public: Path *path() { return &path_; } const Path *path() const { return &path_; } PathRef &pathRef() { return path_; } - virtual void setPath(PathEnumed *path, - const StaState *sta); + virtual void setPath(const Path *path); Vertex *vertex(const StaState *sta) const; const MinMax *minMax(const StaState *sta) const; // Synonym for minMax(). @@ -256,8 +255,7 @@ public: virtual Slack slackNoCrpr(const StaState *sta) const; virtual int exceptPathCmp(const PathEnd *path_end, const StaState *sta) const; - virtual void setPath(PathEnumed *path, - const StaState *sta); + virtual void setPath(const Path *path); protected: PathEndClkConstrained(Path *path, diff --git a/include/sta/PathGroup.hh b/include/sta/PathGroup.hh index 9e7b9e2c..586e5525 100644 --- a/include/sta/PathGroup.hh +++ b/include/sta/PathGroup.hh @@ -61,6 +61,7 @@ public: void pushEnds(PathEndSeq &path_ends); // Predicate to determine if a PathEnd is worth saving. bool saveable(PathEnd *path_end); + bool enumMinSlackUnderMin(PathEnd *path_end); int maxPaths() const { return group_path_count_; } PathGroupIterator *iterator(); // This does NOT delete the path ends. diff --git a/search/PathEnd.cc b/search/PathEnd.cc index 02fb39a2..18c29828 100644 --- a/search/PathEnd.cc +++ b/search/PathEnd.cc @@ -51,8 +51,7 @@ PathEnd::~PathEnd() } void -PathEnd::setPath(PathEnumed *path, - const StaState *) +PathEnd::setPath(const Path *path) { path_.init(path); } @@ -523,8 +522,7 @@ PathEndClkConstrained::PathEndClkConstrained(Path *path, } void -PathEndClkConstrained::setPath(PathEnumed *path, - const StaState *) +PathEndClkConstrained::setPath(const Path *path) { path_.init(path); crpr_valid_ = false; diff --git a/search/PathEnum.cc b/search/PathEnum.cc index 77621ffa..371b4a9b 100644 --- a/search/PathEnum.cc +++ b/search/PathEnum.cc @@ -377,7 +377,7 @@ PathEnumFaninVisitor::makeDivertedPathEnd(Path *after_div, path_enum_->makeDivertedPath(path_end_->path(), &before_div_, after_div, div_arc, div_path, after_div_copy); div_end = path_end_->copy(); - div_end->setPath(div_path, this); + div_end->setPath(div_path); } void diff --git a/search/PathGroup.cc b/search/PathGroup.cc index 729d2a3c..6bd07a50 100644 --- a/search/PathGroup.cc +++ b/search/PathGroup.cc @@ -122,6 +122,38 @@ PathGroup::saveable(PathEnd *path_end) return false; } +// endpoint_path_count > 1 with slack_min requires +// saving endpoints with slack > slack_min so that +// path enumeration can find them. Use the patg end +// with the min(max) delay to prune ends that cannot +// onion peel down to slack_min. +bool +PathGroup::enumMinSlackUnderMin(PathEnd *path_end) +{ + if (compare_slack_ + && endpoint_path_count_ > 1 + && slack_min_ > -INF) { + const Path *path = path_end->path(); + PathAnalysisPt *other_ap = path->pathAnalysisPt(sta_)->tgtClkAnalysisPt(); + const Tag *tag = path->tag(sta_); + VertexPathIterator other_iter(path->vertex(sta_), + path->transition(sta_), + other_ap, sta_); + while (other_iter.hasNext()) { + PathVertex *other = other_iter.next(); + if (tagMatchCrpr(other->tag(sta_), tag)) { + PathEnd *end_min = path_end->copy(); + end_min->setPath(other); + bool slack_under = fuzzyGreater(end_min->slackNoCrpr(sta_), slack_min_); + delete end_min; + if (slack_under) + return true; + } + } + } + return false; +} + void PathGroup::insert(PathEnd *path_end) { @@ -700,7 +732,8 @@ MakePathEndsAll::vertexEnd(Vertex *) path_end->path()->tag(sta_)->index()); // Give the group a copy of the path end because // it may delete it during pruning. - if (group->saveable(path_end)) { + if (group->saveable(path_end) + || group->enumMinSlackUnderMin(path_end)) { group->insert(path_end->copy()); unique_ends.insert(path_end); n++; @@ -787,7 +820,8 @@ PathGroups::enumPathEnds(PathGroup *group, PathGroupIterator *end_iter = group->iterator(); while (end_iter->hasNext()) { PathEnd *end = end_iter->next(); - if (group->saveable(end)) + if (group->saveable(end) + || group->enumMinSlackUnderMin(end)) path_enum.insert(end); } delete end_iter;