Skip to content

Commit 8df87e0

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents d8a8786 + de0f544 commit 8df87e0

File tree

11 files changed

+207
-84
lines changed

11 files changed

+207
-84
lines changed

graph/Graph.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,6 @@ Graph::deletePaths(Vertex *vertex)
594594
{
595595
vertex->setPaths(nullptr);
596596
vertex->tag_group_index_ = tag_group_index_max;
597-
vertex->crpr_path_pruning_disabled_ = false;
598597
}
599598

600599
////////////////////////////////////////////////////////////////
@@ -998,7 +997,6 @@ Vertex::init(Pin *pin,
998997
visited1_ = false;
999998
visited2_ = false;
1000999
bfs_in_queue_ = 0;
1001-
crpr_path_pruning_disabled_ = false;
10021000
}
10031001

10041002
Vertex::~Vertex()
@@ -1120,12 +1118,6 @@ Vertex::removeSlewAnnotated()
11201118
slew_annotated_ = 0;
11211119
}
11221120

1123-
void
1124-
Vertex::setCrprPathPruningDisabled(bool disabled)
1125-
{
1126-
crpr_path_pruning_disabled_ = disabled;
1127-
}
1128-
11291121
TagGroupIndex
11301122
Vertex::tagGroupIndex() const
11311123
{

include/sta/Graph.hh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,6 @@ public:
304304
bool bfsInQueue(BfsIndex index) const;
305305
void setBfsInQueue(BfsIndex index, bool value);
306306
bool isRegClk() const { return is_reg_clk_; }
307-
bool crprPathPruningDisabled() const { return crpr_path_pruning_disabled_;}
308-
void setCrprPathPruningDisabled(bool disabled);
309307

310308
// ObjectTable interface.
311309
ObjectIdx objectIdx() const { return object_idx_; }
@@ -353,7 +351,6 @@ protected:
353351
bool is_check_clk_:1;
354352
bool is_constrained_:1;
355353
bool has_downstream_clk_pin_:1;
356-
bool crpr_path_pruning_disabled_:1;
357354
bool visited1_:1;
358355
bool visited2_:1;
359356

include/sta/PathGroup.hh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ public:
134134
PathGroup *findPathGroup(const Clock *clock,
135135
const MinMax *min_max) const;
136136
PathGroup *pathGroup(const PathEnd *path_end) const;
137-
static bool isGroupPathName(const char *group_name);
137+
static std::string pathGroupName(const PathEnd *path_end,
138+
const StaState *sta);
138139
static const char *asyncPathGroupName() { return async_group_name_; }
140+
static const char *pathDelayGroupName() { return path_delay_group_name_; }
141+
static const char *gatedClkGroupName() { return gated_clk_group_name_; }
142+
static const char *unconstrainedGroupName() { return unconstrained_group_name_; }
139143

140144
protected:
141145
void makeGroupPathEnds(ExceptionTo *to,
@@ -175,7 +179,8 @@ protected:
175179
const MinMax *min_max);
176180
bool reportGroup(const char *group_name,
177181
PathGroupNameSet *group_names) const;
178-
GroupPath *groupPathTo(const PathEnd *path_end) const;
182+
static GroupPath *groupPathTo(const PathEnd *path_end,
183+
const StaState *sta);
179184

180185
int group_path_count_;
181186
int endpoint_path_count_;

include/sta/Sta.hh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ typedef InstanceSeq::Iterator SlowDrvrIterator;
7373
typedef Vector<const char*> CheckError;
7474
typedef Vector<CheckError*> CheckErrorSeq;
7575
typedef Vector<Corner*> CornerSeq;
76+
typedef std::vector<std::string> StdStringSeq;
7677

7778
enum class CmdNamespace { sta, sdc };
7879

@@ -516,7 +517,10 @@ public:
516517
ExceptionThruSeq *thrus,
517518
ExceptionTo *to,
518519
const char *comment);
519-
bool isGroupPathName(const char *group_name);
520+
// Deprecated 10/24/2025
521+
bool isGroupPathName(const char *group_name) __attribute__ ((deprecated));
522+
bool isPathGroupName(const char *group_name) const;
523+
StdStringSeq pathGroupNames() const;
520524
void resetPath(ExceptionFrom *from,
521525
ExceptionThruSeq *thrus,
522526
ExceptionTo *to,
@@ -1002,6 +1006,10 @@ public:
10021006
const MinMax *min_max);
10031007
Slack pinSlack(const Pin *pin,
10041008
const MinMax *min_max);
1009+
// Worst slack for an endpoint in a path group.
1010+
Slack endpointSlack(const Pin *pin,
1011+
const std::string &path_group_name,
1012+
const MinMax *min_max);
10051013
Slack vertexSlack(Vertex *vertex,
10061014
const MinMax *min_max);
10071015
Slack vertexSlack(Vertex *vertex,
@@ -1437,8 +1445,6 @@ protected:
14371445
Corner *corner,
14381446
const MinMax *min_max);
14391447
void powerPreamble();
1440-
void disableFanoutCrprPruning(Vertex *vertex,
1441-
int &fanou);
14421448
virtual void replaceCell(Instance *inst,
14431449
Cell *to_cell,
14441450
LibertyCell *to_lib_cell);

sdc/Sdc.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ make_group_path(const char *name,
734734
bool
735735
is_path_group_name(const char *name)
736736
{
737-
return Sta::sta()->isGroupPathName(name);
737+
return Sta::sta()->isPathGroupName(name);
738738
}
739739

740740
ExceptionFrom *
@@ -863,7 +863,7 @@ set_clock_sense_cmd(PinSet *pins,
863863
else if (stop_propagation)
864864
sta->setClockSense(pins, clks, ClockSense::stop);
865865
else
866-
sta->report()->critical(1577, "unknown clock sense");
866+
sta->report()->critical(2123, "unknown clock sense");
867867
}
868868

869869
void
@@ -1328,7 +1328,7 @@ filter_timing_arcs(const char *property,
13281328
////////////////////////////////////////////////////////////////
13291329

13301330
StringSeq
1331-
path_group_names()
1331+
group_path_names()
13321332
{
13331333
StringSeq pg_names;
13341334
for (auto const& [name, group] : Sta::sta()->sdc()->groupPaths())

search/PathGroup.cc

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,6 @@ const char *PathGroups::gated_clk_group_name_ = "gated clock";
248248
const char *PathGroups::async_group_name_ = "asynchronous";
249249
const char *PathGroups::unconstrained_group_name_ = "unconstrained";
250250

251-
bool
252-
PathGroups::isGroupPathName(const char *group_name)
253-
{
254-
return stringEq(group_name, path_delay_group_name_)
255-
|| stringEq(group_name, gated_clk_group_name_)
256-
|| stringEq(group_name, async_group_name_)
257-
|| stringEq(group_name, unconstrained_group_name_);
258-
}
259-
260251
PathGroups::PathGroups(int group_path_count,
261252
int endpoint_path_count,
262253
bool unique_pins,
@@ -412,7 +403,7 @@ PathGroups::pathGroup(const PathEnd *path_end) const
412403
{
413404
const MinMax *min_max = path_end->minMax(this);
414405
int mm_index = min_max->index();
415-
GroupPath *group_path = groupPathTo(path_end);
406+
GroupPath *group_path = groupPathTo(path_end, this);
416407
if (path_end->isUnconstrained())
417408
return unconstrained_[mm_index];
418409
// GroupPaths have precedence.
@@ -455,16 +446,63 @@ PathGroups::pathGroup(const PathEnd *path_end) const
455446
}
456447
}
457448

449+
// Mirrors PathGroups::pathGroup.
450+
std::string
451+
PathGroups::pathGroupName(const PathEnd *path_end,
452+
const StaState *sta)
453+
{
454+
GroupPath *group_path = groupPathTo(path_end, sta);
455+
if (path_end->isUnconstrained())
456+
return unconstrained_group_name_;
457+
// GroupPaths have precedence.
458+
else if (group_path) {
459+
if (group_path->isDefault())
460+
return path_delay_group_name_;
461+
else
462+
return group_path->name();
463+
}
464+
else if (path_end->isCheck() || path_end->isLatchCheck()) {
465+
const TimingRole *check_role = path_end->checkRole(sta);
466+
const Clock *tgt_clk = path_end->targetClk(sta);
467+
if (check_role == TimingRole::removal()
468+
|| check_role == TimingRole::recovery())
469+
return async_group_name_;
470+
else
471+
return tgt_clk->name();
472+
}
473+
else if (path_end->isOutputDelay()
474+
|| path_end->isDataCheck())
475+
return path_end->targetClk(sta)->name();
476+
else if (path_end->isGatedClock())
477+
return gated_clk_group_name_;
478+
else if (path_end->isPathDelay()) {
479+
// Path delays that end at timing checks are part of the target clk group
480+
// unless -ignore_clock_latency is true.
481+
PathDelay *path_delay = path_end->pathDelay();
482+
const Clock *tgt_clk = path_end->targetClk(sta);
483+
if (tgt_clk
484+
&& !path_delay->ignoreClkLatency())
485+
return tgt_clk->name();
486+
else
487+
return path_delay_group_name_;
488+
}
489+
else {
490+
sta->report()->critical(1391, "unknown path end type");
491+
return nullptr;
492+
}
493+
}
494+
458495
GroupPath *
459-
PathGroups::groupPathTo(const PathEnd *path_end) const
496+
PathGroups::groupPathTo(const PathEnd *path_end,
497+
const StaState *sta)
460498
{
461499
const Path *path = path_end->path();
462-
const Pin *pin = path->pin(this);
500+
const Pin *pin = path->pin(sta);
463501
ExceptionPath *exception =
464-
search_->exceptionTo(ExceptionPathType::group_path, path,
465-
pin, path->transition(this),
466-
path_end->targetClkEdge(this),
467-
path->minMax(this), false, false);
502+
sta->search()->exceptionTo(ExceptionPathType::group_path, path,
503+
pin, path->transition(sta),
504+
path_end->targetClkEdge(sta),
505+
path->minMax(sta), false, false);
468506
return dynamic_cast<GroupPath*>(exception);
469507
}
470508

search/Search.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,6 @@ ArrivalVisitor::visit(Vertex *vertex)
11821182
visitFaninPaths(vertex);
11831183
if (crpr_active_
11841184
&& search_->crprPathPruningEnabled()
1185-
&& !vertex->crprPathPruningDisabled()
11861185
// No crpr for ideal clocks.
11871186
&& tag_bldr_->hasPropagatedClk()
11881187
&& !has_fanin_one_)

search/Search.i

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,31 @@ vertex_worst_slack_path(Vertex *vertex,
251251
return sta->vertexWorstSlackPath(vertex, min_max);
252252
}
253253

254+
Slack
255+
endpoint_slack(const Pin *pin,
256+
const char *path_group_name,
257+
const MinMax *min_max)
258+
{
259+
Sta *sta = Sta::sta();
260+
sta->ensureLibLinked();
261+
if (sta->isGroupPathName(path_group_name)) {
262+
Slack slack = sta->endpointSlack(pin, std::string(path_group_name), min_max);
263+
return sta->units()->timeUnit()->staToUser(slack);
264+
}
265+
else {
266+
sta->report()->error(1577, "%s is not a known path group name.",
267+
path_group_name);
268+
return INF;
269+
}
270+
}
271+
272+
StdStringSeq
273+
path_group_names()
274+
{
275+
Sta *sta = Sta::sta();
276+
return sta->pathGroupNames();
277+
}
278+
254279
int
255280
tag_group_count()
256281
{

0 commit comments

Comments
 (0)