PathGroups::inPathGroupNamed

Signed-off-by: James Cherry <cherry@CerezoBook.local>
This commit is contained in:
James Cherry 2026-06-06 11:55:51 -07:00
parent b0869d521c
commit ffe126af2a
3 changed files with 25 additions and 30 deletions

View File

@ -146,8 +146,9 @@ public:
PathGroup *findPathGroup(const Clock *clock,
const MinMax *min_max) const;
PathGroupSeq pathGroups(const PathEnd *path_end) const;
static StringSeq pathGroupNames(const PathEnd *path_end,
const StaState *sta);
static bool inPathGroupNamed(const PathEnd *path_end,
std::string_view path_group_name,
const StaState *sta);
static std::string_view asyncPathGroupName() { return async_group_name_; }
static std::string_view pathDelayGroupName() { return path_delay_group_name_; }
static std::string_view gatedClkGroupName() { return gated_clk_group_name_; }

View File

@ -474,23 +474,23 @@ PathGroups::pathGroups(const PathEnd *path_end) const
}
// Mirrors PathGroups::pathGroup.
StringSeq
PathGroups::pathGroupNames(const PathEnd *path_end,
const StaState *sta)
bool
PathGroups::inPathGroupNamed(const PathEnd *path_end,
std::string_view path_group_name,
const StaState *sta)
{
StringSeq group_names;
std::string group_name;
const Search *search = sta->search();
ExceptionPathSeq group_paths = search->groupPathsTo(path_end);
if (path_end->isUnconstrained())
group_name = unconstrained_group_name_;
return path_group_name == unconstrained_group_name_;
else if (!group_paths.empty()) {
// GroupPaths have precedence.
for (ExceptionPath *group_path : group_paths) {
if (group_path->isDefault())
group_names.emplace_back(path_delay_group_name_);
else
group_names.emplace_back(group_path->name());
std::string_view group_name = group_path->isDefault()
? path_delay_group_name_
: group_path->name();
if (path_group_name == group_name)
return true;;
}
}
else if (path_end->isCheck() || path_end->isLatchCheck()) {
@ -498,18 +498,18 @@ PathGroups::pathGroupNames(const PathEnd *path_end,
const Clock *tgt_clk = path_end->targetClk(sta);
if (check_role == TimingRole::removal()
|| check_role == TimingRole::recovery())
group_name = async_group_name_;
return path_group_name == async_group_name_;
else
group_name = tgt_clk->name();
return path_group_name == tgt_clk->name();
}
else if (path_end->isOutputDelay()
|| path_end->isDataCheck()) {
const Clock *tgt_clk = path_end->targetClk(sta);
if (tgt_clk)
group_name = tgt_clk->name();
return path_group_name == tgt_clk->name();
}
else if (path_end->isGatedClock())
group_name = gated_clk_group_name_;
return path_group_name == gated_clk_group_name_;
else if (path_end->isPathDelay()) {
// Path delays that end at timing checks are part of the target clk group
// unless -ignore_clock_latency is true.
@ -517,13 +517,11 @@ PathGroups::pathGroupNames(const PathEnd *path_end,
const Clock *tgt_clk = path_end->targetClk(sta);
if (tgt_clk
&& !path_delay->ignoreClkLatency())
group_name = tgt_clk->name();
return path_group_name == tgt_clk->name();
else
group_name = path_delay_group_name_;
return path_group_name == path_delay_group_name_;
}
if (!group_name.empty())
group_names.push_back(group_name);
return group_names;
return false;
}
GroupPath *

View File

@ -3279,15 +3279,11 @@ EndpointPathEndVisitor::copy() const
void
EndpointPathEndVisitor::visit(PathEnd *path_end)
{
if (path_end->minMax(sta_) == min_max_) {
StringSeq group_names = PathGroups::pathGroupNames(path_end, sta_);
for (std::string &group_name : group_names) {
if (group_name == path_group_name_) {
Slack end_slack = path_end->slack(sta_);
if (delayLess(end_slack, slack_, sta_))
slack_ = end_slack;
}
}
if (path_end->minMax(sta_) == min_max_
&& PathGroups::inPathGroupNamed(path_end, path_group_name_, sta_)) {
Slack end_slack = path_end->slack(sta_);
if (delayLess(end_slack, slack_, sta_))
slack_ = end_slack;
}
}