@@ -248,15 +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- 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-
260251PathGroups::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+
458495GroupPath *
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
0 commit comments