@@ -248,22 +248,6 @@ const char *PathGroups::gated_clk_group_name_ = "gated clock";
248248const char *PathGroups::async_group_name_ = " asynchronous" ;
249249const char *PathGroups::unconstrained_group_name_ = " unconstrained" ;
250250
251- PathGroups::PathGroups (const StaState *sta) :
252- StaState(sta),
253- group_path_count_(0 ),
254- endpoint_path_count_(0 ),
255- unique_pins_(false ),
256- slack_min_(-INF),
257- slack_max_(INF)
258- {
259- makeGroups (group_path_count_, endpoint_path_count_, unique_pins_,
260- slack_min_, slack_max_, nullptr ,
261- true , true , true , true , MinMax::max ());
262- makeGroups (group_path_count_, endpoint_path_count_, unique_pins_,
263- slack_min_, slack_max_, nullptr ,
264- true , true , true , true , MinMax::min ());
265- }
266-
267251PathGroups::PathGroups (int group_path_count,
268252 int endpoint_path_count,
269253 bool unique_pins,
@@ -419,7 +403,7 @@ PathGroups::pathGroup(const PathEnd *path_end) const
419403{
420404 const MinMax *min_max = path_end->minMax (this );
421405 int mm_index = min_max->index ();
422- GroupPath *group_path = groupPathTo (path_end);
406+ GroupPath *group_path = groupPathTo (path_end, this );
423407 if (path_end->isUnconstrained ())
424408 return unconstrained_[mm_index];
425409 // GroupPaths have precedence.
@@ -462,16 +446,63 @@ PathGroups::pathGroup(const PathEnd *path_end) const
462446 }
463447}
464448
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+
465495GroupPath *
466- PathGroups::groupPathTo (const PathEnd *path_end) const
496+ PathGroups::groupPathTo (const PathEnd *path_end,
497+ const StaState *sta)
467498{
468499 const Path *path = path_end->path ();
469- const Pin *pin = path->pin (this );
500+ const Pin *pin = path->pin (sta );
470501 ExceptionPath *exception =
471- search_ ->exceptionTo (ExceptionPathType::group_path, path,
472- pin, path->transition (this ),
473- path_end->targetClkEdge (this ),
474- 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 );
475506 return dynamic_cast <GroupPath*>(exception);
476507}
477508
0 commit comments