@@ -147,7 +147,7 @@ DynLoopSrchPred::hasPendingLoopPaths(Edge *edge,
147147 PathAPIndex path_ap_index = from_tag->pathAPIndex ();
148148 PathAnalysisPt *path_ap = corners->findPathAnalysisPt (path_ap_index);
149149 Tag *to_tag = search->thruTag (from_tag, edge, RiseFall::rise (),
150- path_ap->pathMinMax (), path_ap);
150+ path_ap->pathMinMax (), path_ap, nullptr );
151151 if (to_tag
152152 && (prev_tag_group == nullptr
153153 || !prev_tag_group->hasTag (from_tag)))
@@ -1106,7 +1106,7 @@ Search::findArrivalsSeed()
11061106// //////////////////////////////////////////////////////////////
11071107
11081108ArrivalVisitor::ArrivalVisitor (const StaState *sta) :
1109- PathVisitor (nullptr , sta)
1109+ PathVisitor (nullptr , false , sta)
11101110{
11111111 init0 ();
11121112 init (true );
@@ -1116,7 +1116,7 @@ ArrivalVisitor::ArrivalVisitor(const StaState *sta) :
11161116ArrivalVisitor::ArrivalVisitor (bool always_to_endpoints,
11171117 SearchPred *pred,
11181118 const StaState *sta) :
1119- PathVisitor (pred, sta)
1119+ PathVisitor (pred, true , sta)
11201120{
11211121 init0 ();
11221122 init (always_to_endpoints, pred);
@@ -1149,9 +1149,7 @@ ArrivalVisitor::init(bool always_to_endpoints,
11491149VertexVisitor *
11501150ArrivalVisitor::copy () const
11511151{
1152- auto visitor = new ArrivalVisitor (always_to_endpoints_, pred_, this );
1153- visitor->initTagCache ();
1154- return visitor;
1152+ return new ArrivalVisitor (always_to_endpoints_, pred_, this );
11551153}
11561154
11571155ArrivalVisitor::~ArrivalVisitor ()
@@ -1621,7 +1619,8 @@ Search::seedClkArrival(const Pin *pin,
16211619 // Only false_paths -from apply to clock tree pins.
16221620 ExceptionStateSet *states = nullptr ;
16231621 sdc_->exceptionFromClkStates (pin,rf,clk,rf,min_max,states);
1624- Tag *tag = findTag (rf, path_ap, clk_info, true , nullptr , false , states, true );
1622+ Tag *tag = findTag (rf, path_ap, clk_info, true , nullptr , false , states,
1623+ true , nullptr );
16251624 Arrival arrival (clk_edge->time () + insertion);
16261625 tag_bldr->setArrival (tag, arrival);
16271626}
@@ -1659,7 +1658,8 @@ Search::clkDataTag(const Pin *pin,
16591658 || sdc_->isPropagatedClock (pin));
16601659 const ClkInfo *clk_info = findClkInfo (clk_edge, pin, is_propagated,
16611660 insertion, path_ap);
1662- return findTag (rf, path_ap, clk_info, false , nullptr , false , states, true );
1661+ return findTag (rf, path_ap, clk_info, false , nullptr , false , states,
1662+ true , nullptr );
16631663 }
16641664 else
16651665 return nullptr ;
@@ -2020,40 +2020,44 @@ Search::inputDelayTag(const Pin *pin,
20202020 false , nullptr , clk_insertion, clk_latency,
20212021 clk_uncertainties, path_ap, nullptr );
20222022 tag = findTag (rf, path_ap, clk_info, false , input_delay, is_segment_start,
2023- states, true );
2023+ states, true , nullptr );
20242024 }
20252025
20262026 if (tag) {
20272027 const ClkInfo *clk_info = tag->clkInfo ();
20282028 // Check for state changes on existing tag exceptions (pending -thru pins).
20292029 tag = mutateTag (tag, pin, rf, false , clk_info,
20302030 pin, rf, false , false , is_segment_start, clk_info,
2031- input_delay, min_max, path_ap);
2031+ input_delay, min_max, path_ap, nullptr );
20322032 }
20332033 return tag;
20342034}
20352035
20362036// //////////////////////////////////////////////////////////////
20372037
20382038PathVisitor::PathVisitor (const StaState *sta) :
2039+
20392040 StaState (sta),
20402041 pred_ (sta->search ()->evalPred()),
2041- tag_cache_(nullptr )
2042+ tag_cache_( nullptr )
20422043{
20432044}
20442045
20452046PathVisitor::PathVisitor (SearchPred *pred,
2047+ bool make_tag_cache,
20462048 const StaState *sta) :
2049+
20472050 StaState(sta),
20482051 pred_(pred),
2049- tag_cache_(nullptr )
2052+ tag_cache_(make_tag_cache
2053+ ? new TagSet(128 , TagSet::hasher(sta), TagSet::key_equal(sta))
2054+ : nullptr)
20502055{
20512056}
20522057
2053- void
2054- PathVisitor::initTagCache ()
2058+ PathVisitor::~PathVisitor ()
20552059{
2056- tag_cache_ = std::make_unique<TagSet>( 128 , TagSet::hasher ( this ), TagSet::key_equal ( this )) ;
2060+ delete tag_cache_ ;
20572061}
20582062
20592063void
@@ -2243,7 +2247,7 @@ PathVisitor::visitFromPath(const Pin *from_pin,
22432247 to_clk_info, to_pin, to_rf, min_max,
22442248 path_ap);
22452249 if (to_tag)
2246- to_tag = search_->thruTag (to_tag, edge, to_rf, min_max, path_ap, tag_cache_. get () );
2250+ to_tag = search_->thruTag (to_tag, edge, to_rf, min_max, path_ap, tag_cache_);
22472251 from_arrival = search_->clkPathArrival (from_path, from_clk_info,
22482252 clk_edge, min_max, path_ap);
22492253 to_arrival = from_arrival + arc_delay;
@@ -2259,7 +2263,7 @@ PathVisitor::visitFromPath(const Pin *from_pin,
22592263 latches_->latchOutArrival (from_path, arc, edge, path_ap,
22602264 to_tag, arc_delay, to_arrival);
22612265 if (to_tag)
2262- to_tag = search_->thruTag (to_tag, edge, to_rf, min_max, path_ap, tag_cache_. get () );
2266+ to_tag = search_->thruTag (to_tag, edge, to_rf, min_max, path_ap, tag_cache_);
22632267 }
22642268 }
22652269 else if (from_tag->isClock ()) {
@@ -2298,7 +2302,7 @@ PathVisitor::visitFromPath(const Pin *from_pin,
22982302 else {
22992303 if (!(sdc_->isPathDelayInternalFromBreak (to_pin)
23002304 || sdc_->isPathDelayInternalToBreak (from_pin))) {
2301- to_tag = search_->thruTag (from_tag, edge, to_rf, min_max, path_ap, tag_cache_. get () );
2305+ to_tag = search_->thruTag (from_tag, edge, to_rf, min_max, path_ap, tag_cache_);
23022306 arc_delay = search_->deratedDelay (from_vertex, arc, edge, false , path_ap);
23032307 if (!delayInf (arc_delay))
23042308 to_arrival = from_arrival + arc_delay;
@@ -2408,7 +2412,7 @@ Search::fromUnclkedInputTag(const Pin *pin,
24082412 && (!require_exception || states)) {
24092413 const ClkInfo *clk_info = findClkInfo (nullptr , nullptr , false , 0.0 , path_ap);
24102414 return findTag (rf, path_ap, clk_info, false , nullptr ,
2411- is_segment_start, states, true );
2415+ is_segment_start, states, true , nullptr );
24122416 }
24132417 return nullptr ;
24142418}
@@ -2429,7 +2433,8 @@ Search::fromRegClkTag(const Pin *from_pin,
24292433 min_max, states)) {
24302434 // Hack for filter -from reg/Q.
24312435 sdc_->filterRegQStates (to_pin, to_rf, min_max, states);
2432- return findTag (to_rf, path_ap, clk_info, false , nullptr , false , states, true );
2436+ return findTag (to_rf, path_ap, clk_info, false , nullptr , false , states,
2437+ true , nullptr );
24332438 }
24342439 else
24352440 return nullptr ;
@@ -2510,7 +2515,7 @@ Search::thruClkTag(Path *from_path,
25102515 arc_delay_min_max_eq, min_max, path_ap);
25112516 Tag *to_tag = mutateTag (from_tag,from_pin,from_rf,from_is_clk,from_clk_info,
25122517 to_pin, to_rf, to_is_clk, to_is_reg_clk, false ,
2513- to_clk_info, nullptr , min_max, path_ap);
2518+ to_clk_info, nullptr , min_max, path_ap, nullptr );
25142519 return to_tag;
25152520}
25162521
@@ -2996,7 +3001,7 @@ Search::findTag(const RiseFall *rf,
29963001 Tag probe (0 , rf->index (), path_ap->index (), clk_info, is_clk, input_delay,
29973002 is_segment_start, states, false , this );
29983003 if (tag_cache) {
2999- auto tag = tag_cache->findKey (&probe);
3004+ Tag * tag = tag_cache->findKey (&probe);
30003005 if (tag)
30013006 return tag;
30023007 }
@@ -3553,6 +3558,14 @@ RequiredVisitor::RequiredVisitor(const StaState *sta) :
35533558{
35543559}
35553560
3561+ RequiredVisitor::RequiredVisitor (bool make_tag_cache,
3562+ const StaState *sta) :
3563+ PathVisitor(sta->search ()->evalPred(), make_tag_cache, sta),
3564+ required_cmp_(new RequiredCmp),
3565+ visit_path_ends_(new VisitPathEnds(sta))
3566+ {
3567+ }
3568+
35563569RequiredVisitor::~RequiredVisitor ()
35573570{
35583571 delete required_cmp_;
@@ -3562,9 +3575,7 @@ RequiredVisitor::~RequiredVisitor()
35623575VertexVisitor *
35633576RequiredVisitor::copy () const
35643577{
3565- auto visitor = new RequiredVisitor (this );
3566- visitor->initTagCache ();
3567- return visitor;
3578+ return new RequiredVisitor (true , this );
35683579}
35693580
35703581void
0 commit comments