diff --git a/src/rsz/src/RepairDesign.cc b/src/rsz/src/RepairDesign.cc index 9b22c2d087..96182d68b5 100644 --- a/src/rsz/src/RepairDesign.cc +++ b/src/rsz/src/RepairDesign.cc @@ -183,7 +183,7 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count) 2, "Annotating slew for driver {}", network_->pathName(drvr->pin())); - for (auto rf : {sta::RiseFall::rise(), sta::RiseFall::fall()}) { + for (auto rf : sta::RiseFall::range()) { if (!drvr->slewAnnotated(rf, min_) && !drvr->slewAnnotated(rf, max_)) { sta_->setAnnotatedSlew(drvr, resizer_->tgt_slew_corner_, @@ -197,9 +197,6 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count) } findBufferSizes(); - sta_->searchPreamble(); - search_->findAllArrivals(); - for (int i = drvrs.size() - 1; i >= 0; i--) { sta::Vertex* drvr = drvrs[i]; sta::Pin* drvr_pin = drvr->pin(); @@ -220,7 +217,6 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count) odb::dbNet* net_db = nullptr; odb::dbModNet* mod_net_db = nullptr; db_network_->staToDb(net, net_db, mod_net_db); - search_->findRequireds(drvr->level() + 1); if (resizer_->okToBufferNet(drvr_pin) && !sta_->isClock(drvr_pin, sta_->cmdMode()) @@ -241,7 +237,7 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count) max_fanout = 1e9; } - if (performGainBuffering(net, drvr_pin, max_fanout)) { + if (performGainBuffering(net, drvr, max_fanout)) { debugPrint(logger_, RSZ, "early_sizing", @@ -266,12 +262,12 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count) } } - for (auto mm : sta::MinMaxAll::all()->range()) { - for (auto rf : sta::RiseFallBoth::riseFall()->range()) { - if (!slew_user_annotated.contains(std::make_pair(drvr, rf->index()))) { - drvr->setSlewAnnotated( - false, rf, resizer_->tgt_slew_corner_->dcalcAnalysisPtIndex(mm)); - } + for (auto rf : sta::RiseFall::range()) { + if (!slew_user_annotated.contains(std::make_pair(drvr, rf->index()))) { + sta_->unsetAnnotatedSlew(drvr, + resizer_->tgt_slew_corner_, + sta::MinMaxAll::all(), + rf->asRiseFallBoth()); } } } @@ -307,7 +303,6 @@ void RepairDesign::repairDesign( sta_->checkCapacitancesPreamble(sta_->scenes()); sta_->checkFanoutPreamble(); sta_->searchPreamble(); - search_->findAllArrivals(); if (initial_sizing) { performEarlySizingRound(repaired_net_count); @@ -422,12 +417,11 @@ void RepairDesign::repairDesign( for (auto vertex : annotations_to_clean_up) { for (auto corner : sta_->scenes()) { for (const sta::RiseFall* rf : sta::RiseFall::range()) { - vertex->setSlewAnnotated( - false, rf, corner->dcalcAnalysisPtIndex(max_)); + sta_->unsetAnnotatedSlew( + vertex, corner, sta::MinMaxAll::max(), rf->asRiseFallBoth()); } } } - sta_->delaysInvalid(); } printProgress(print_iteration, @@ -681,7 +675,7 @@ void RepairDesign::findBufferSizes() /// construction and critical path isolation. /// bool RepairDesign::performGainBuffering(sta::Net* net, - const sta::Pin* drvr_pin, + sta::Vertex* drvr, int max_fanout) { struct EnqueuedPin @@ -731,9 +725,13 @@ bool RepairDesign::performGainBuffering(sta::Net* net, } }; + sta::Pin* drvr_pin = drvr->pin(); + // 1. Collect all sinks std::vector sinks; + // vertexWorstSlackPath prerequisite. + sta_->findRequired(drvr); sta::NetConnectedPinIterator* pin_iter = network_->connectedPinIterator(net); while (pin_iter->hasNext()) { const sta::Pin* pin = pin_iter->next(); @@ -854,15 +852,6 @@ bool RepairDesign::performGainBuffering(sta::Net* net, load += size_in->capacitance(); } - // 5. Incremental timing update - sta_->ensureLevelized(); - sta::Level max_level = 0; - for (auto vertex : tree_boundary) { - max_level = std::max(vertex->level(), max_level); - } - sta_->findDelays(max_level); - search_->findArrivals(max_level); - return repaired_net; } diff --git a/src/rsz/src/RepairDesign.hh b/src/rsz/src/RepairDesign.hh index 80c49636ad..a5be535dac 100644 --- a/src/rsz/src/RepairDesign.hh +++ b/src/rsz/src/RepairDesign.hh @@ -88,9 +88,7 @@ class RepairDesign : sta::dbStaState bool getCin(const sta::Pin* drvr_pin, float& cin); bool getLargestSizeCin(const sta::Pin* drvr_pin, float& cin); void findBufferSizes(); - bool performGainBuffering(sta::Net* net, - const sta::Pin* drvr_pin, - int max_fanout); + bool performGainBuffering(sta::Net* net, sta::Vertex* drvr, int max_fanout); void performEarlySizingRound(int& repaired_net_count); void checkDriverArcSlew(const sta::Scene* corner, diff --git a/src/rsz/src/RepairTargetCollector.cc b/src/rsz/src/RepairTargetCollector.cc index 656917b975..bd812d82c4 100644 --- a/src/rsz/src/RepairTargetCollector.cc +++ b/src/rsz/src/RepairTargetCollector.cc @@ -438,36 +438,37 @@ sta::Slack RepairTargetCollector::getPathSlackByIndex( // Create ExceptionTo for this endpoint sta::PinSet* to_pins = new sta::PinSet(network_); to_pins->insert(endpoint_pin); - sta::ExceptionTo* to = sdc_->makeExceptionTo(to_pins, + sta::ExceptionTo* to = sta_->makeExceptionTo(to_pins, nullptr, nullptr, sta::RiseFallBoth::riseFall(), - sta::RiseFallBoth::riseFall()); + sta::RiseFallBoth::riseFall(), + sdc_); // Find paths to the endpoint - request only up to path_index+1 paths sta::StringSeq group_names; int num_paths_needed = path_index + 1; sta::PathEndSeq path_ends - = search_->findPathEnds(nullptr, // from - nullptr, // thrus - to, // to - false, // unconstrained - sta_->scenes(), // scene - sta::MinMaxAll::all(), // min_max - num_paths_needed, // group_path_count - num_paths_needed, // endpoint_path_count - false, // unique_pins - false, // unique_edges - -sta::INF, // slack_min - sta::INF, // slack_max - true, // sort_by_slack - group_names, // group_names - true, - false, - true, - true, - true, - true); // checks + = sta_->findPathEnds(nullptr, // from + nullptr, // thrus + to, // to + false, // unconstrained + sta_->scenes(), // scene + sta::MinMaxAll::all(), // min_max + num_paths_needed, // group_path_count + num_paths_needed, // endpoint_path_count + false, // unique_pins + false, // unique_edges + -sta::INF, // slack_min + sta::INF, // slack_max + true, // sort_by_slack + group_names, // group_names + true, + false, + true, + true, + true, + true); // checks // Return the slack of the requested path index if (std::cmp_less(path_index, path_ends.size())) { @@ -1134,35 +1135,36 @@ set RepairTargetCollector::collectPinsByPathEndpoint( sta::PinSet* to_pins = new sta::PinSet(network_); to_pins->insert(endpoint_pin); // The ExceptionTo object will be owned and deleted by the SDC. - sta::ExceptionTo* to = sdc_->makeExceptionTo(to_pins, + sta::ExceptionTo* to = sta_->makeExceptionTo(to_pins, nullptr, nullptr, sta::RiseFallBoth::riseFall(), - sta::RiseFallBoth::riseFall()); + sta::RiseFallBoth::riseFall(), + sdc_); // 2. Find paths to the endpoint. sta::StringSeq group_names; sta::PathEndSeq path_ends - = search_->findPathEnds(nullptr, // from - nullptr, // thrus - to, // to - false, // unconstrained - sta_->scenes(), // scene - sta::MinMaxAll::all(), // min_max - paths_per_endpoint, // group_path_count - paths_per_endpoint, // endpoint_path_count - false, // unique_pins - false, // unique_edges - -sta::INF, // slack_min - sta::INF, // slack_max - true, // sort_by_slack - group_names, // group_names - true, - false, - true, - true, - true, - true); // checks + = sta_->findPathEnds(nullptr, // from + nullptr, // thrus + to, // to + false, // unconstrained + sta_->scenes(), // scene + sta::MinMaxAll::all(), // min_max + paths_per_endpoint, // group_path_count + paths_per_endpoint, // endpoint_path_count + false, // unique_pins + false, // unique_edges + -sta::INF, // slack_min + sta::INF, // slack_max + true, // sort_by_slack + group_names, // group_names + true, + false, + true, + true, + true, + true); // checks int path_num = 1; for (const sta::PathEnd* path_end : path_ends) {