Skip to content

Commit fdedc4b

Browse files
committed
cleanup phase
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
1 parent 4c14e5a commit fdedc4b

3 files changed

Lines changed: 62 additions & 73 deletions

File tree

src/rsz/src/RepairDesign.cc

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
183183
2,
184184
"Annotating slew for driver {}",
185185
network_->pathName(drvr->pin()));
186-
for (auto rf : {sta::RiseFall::rise(), sta::RiseFall::fall()}) {
186+
for (auto rf : sta::RiseFall::range()) {
187187
if (!drvr->slewAnnotated(rf, min_) && !drvr->slewAnnotated(rf, max_)) {
188188
sta_->setAnnotatedSlew(drvr,
189189
resizer_->tgt_slew_corner_,
@@ -197,9 +197,6 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
197197
}
198198
findBufferSizes();
199199

200-
sta_->searchPreamble();
201-
search_->findAllArrivals();
202-
203200
for (int i = drvrs.size() - 1; i >= 0; i--) {
204201
sta::Vertex* drvr = drvrs[i];
205202
sta::Pin* drvr_pin = drvr->pin();
@@ -220,7 +217,6 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
220217
odb::dbNet* net_db = nullptr;
221218
odb::dbModNet* mod_net_db = nullptr;
222219
db_network_->staToDb(net, net_db, mod_net_db);
223-
search_->findRequireds(drvr->level() + 1);
224220

225221
if (resizer_->okToBufferNet(drvr_pin)
226222
&& !sta_->isClock(drvr_pin, sta_->cmdMode())
@@ -241,7 +237,7 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
241237
max_fanout = 1e9;
242238
}
243239

244-
if (performGainBuffering(net, drvr_pin, max_fanout)) {
240+
if (performGainBuffering(net, drvr, max_fanout)) {
245241
debugPrint(logger_,
246242
RSZ,
247243
"early_sizing",
@@ -266,12 +262,12 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
266262
}
267263
}
268264

269-
for (auto mm : sta::MinMaxAll::all()->range()) {
270-
for (auto rf : sta::RiseFallBoth::riseFall()->range()) {
271-
if (!slew_user_annotated.contains(std::make_pair(drvr, rf->index()))) {
272-
drvr->setSlewAnnotated(
273-
false, rf, resizer_->tgt_slew_corner_->dcalcAnalysisPtIndex(mm));
274-
}
265+
for (auto rf : sta::RiseFall::range()) {
266+
if (!slew_user_annotated.contains(std::make_pair(drvr, rf->index()))) {
267+
sta_->unsetAnnotatedSlew(drvr,
268+
resizer_->tgt_slew_corner_,
269+
sta::MinMaxAll::all(),
270+
rf->asRiseFallBoth());
275271
}
276272
}
277273
}
@@ -307,7 +303,6 @@ void RepairDesign::repairDesign(
307303
sta_->checkCapacitancesPreamble(sta_->scenes());
308304
sta_->checkFanoutPreamble();
309305
sta_->searchPreamble();
310-
search_->findAllArrivals();
311306

312307
if (initial_sizing) {
313308
performEarlySizingRound(repaired_net_count);
@@ -422,12 +417,11 @@ void RepairDesign::repairDesign(
422417
for (auto vertex : annotations_to_clean_up) {
423418
for (auto corner : sta_->scenes()) {
424419
for (const sta::RiseFall* rf : sta::RiseFall::range()) {
425-
vertex->setSlewAnnotated(
426-
false, rf, corner->dcalcAnalysisPtIndex(max_));
420+
sta_->unsetAnnotatedSlew(
421+
vertex, corner, sta::MinMaxAll::max(), rf->asRiseFallBoth());
427422
}
428423
}
429424
}
430-
sta_->delaysInvalid();
431425
}
432426

433427
printProgress(print_iteration,
@@ -681,7 +675,7 @@ void RepairDesign::findBufferSizes()
681675
/// construction and critical path isolation.
682676
///
683677
bool RepairDesign::performGainBuffering(sta::Net* net,
684-
const sta::Pin* drvr_pin,
678+
sta::Vertex* drvr,
685679
int max_fanout)
686680
{
687681
struct EnqueuedPin
@@ -731,9 +725,13 @@ bool RepairDesign::performGainBuffering(sta::Net* net,
731725
}
732726
};
733727

728+
sta::Pin* drvr_pin = drvr->pin();
729+
734730
// 1. Collect all sinks
735731
std::vector<EnqueuedPin> sinks;
736732

733+
// vertexWorstSlackPath prerequisite.
734+
sta_->findRequired(drvr);
737735
sta::NetConnectedPinIterator* pin_iter = network_->connectedPinIterator(net);
738736
while (pin_iter->hasNext()) {
739737
const sta::Pin* pin = pin_iter->next();
@@ -854,15 +852,6 @@ bool RepairDesign::performGainBuffering(sta::Net* net,
854852
load += size_in->capacitance();
855853
}
856854

857-
// 5. Incremental timing update
858-
sta_->ensureLevelized();
859-
sta::Level max_level = 0;
860-
for (auto vertex : tree_boundary) {
861-
max_level = std::max(vertex->level(), max_level);
862-
}
863-
sta_->findDelays(max_level);
864-
search_->findArrivals(max_level);
865-
866855
return repaired_net;
867856
}
868857

src/rsz/src/RepairDesign.hh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ class RepairDesign : sta::dbStaState
8888
bool getCin(const sta::Pin* drvr_pin, float& cin);
8989
bool getLargestSizeCin(const sta::Pin* drvr_pin, float& cin);
9090
void findBufferSizes();
91-
bool performGainBuffering(sta::Net* net,
92-
const sta::Pin* drvr_pin,
93-
int max_fanout);
91+
bool performGainBuffering(sta::Net* net, sta::Vertex* drvr, int max_fanout);
9492
void performEarlySizingRound(int& repaired_net_count);
9593

9694
void checkDriverArcSlew(const sta::Scene* corner,

src/rsz/src/RepairTargetCollector.cc

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -438,36 +438,37 @@ sta::Slack RepairTargetCollector::getPathSlackByIndex(
438438
// Create ExceptionTo for this endpoint
439439
sta::PinSet* to_pins = new sta::PinSet(network_);
440440
to_pins->insert(endpoint_pin);
441-
sta::ExceptionTo* to = sdc_->makeExceptionTo(to_pins,
441+
sta::ExceptionTo* to = sta_->makeExceptionTo(to_pins,
442442
nullptr,
443443
nullptr,
444444
sta::RiseFallBoth::riseFall(),
445-
sta::RiseFallBoth::riseFall());
445+
sta::RiseFallBoth::riseFall(),
446+
sdc_);
446447

447448
// Find paths to the endpoint - request only up to path_index+1 paths
448449
sta::StringSeq group_names;
449450
int num_paths_needed = path_index + 1;
450451
sta::PathEndSeq path_ends
451-
= search_->findPathEnds(nullptr, // from
452-
nullptr, // thrus
453-
to, // to
454-
false, // unconstrained
455-
sta_->scenes(), // scene
456-
sta::MinMaxAll::all(), // min_max
457-
num_paths_needed, // group_path_count
458-
num_paths_needed, // endpoint_path_count
459-
false, // unique_pins
460-
false, // unique_edges
461-
-sta::INF, // slack_min
462-
sta::INF, // slack_max
463-
true, // sort_by_slack
464-
group_names, // group_names
465-
true,
466-
false,
467-
true,
468-
true,
469-
true,
470-
true); // checks
452+
= sta_->findPathEnds(nullptr, // from
453+
nullptr, // thrus
454+
to, // to
455+
false, // unconstrained
456+
sta_->scenes(), // scene
457+
sta::MinMaxAll::all(), // min_max
458+
num_paths_needed, // group_path_count
459+
num_paths_needed, // endpoint_path_count
460+
false, // unique_pins
461+
false, // unique_edges
462+
-sta::INF, // slack_min
463+
sta::INF, // slack_max
464+
true, // sort_by_slack
465+
group_names, // group_names
466+
true,
467+
false,
468+
true,
469+
true,
470+
true,
471+
true); // checks
471472

472473
// Return the slack of the requested path index
473474
if (std::cmp_less(path_index, path_ends.size())) {
@@ -1134,35 +1135,36 @@ set<const sta::Pin*> RepairTargetCollector::collectPinsByPathEndpoint(
11341135
sta::PinSet* to_pins = new sta::PinSet(network_);
11351136
to_pins->insert(endpoint_pin);
11361137
// The ExceptionTo object will be owned and deleted by the SDC.
1137-
sta::ExceptionTo* to = sdc_->makeExceptionTo(to_pins,
1138+
sta::ExceptionTo* to = sta_->makeExceptionTo(to_pins,
11381139
nullptr,
11391140
nullptr,
11401141
sta::RiseFallBoth::riseFall(),
1141-
sta::RiseFallBoth::riseFall());
1142+
sta::RiseFallBoth::riseFall(),
1143+
sdc_);
11421144

11431145
// 2. Find paths to the endpoint.
11441146
sta::StringSeq group_names;
11451147
sta::PathEndSeq path_ends
1146-
= search_->findPathEnds(nullptr, // from
1147-
nullptr, // thrus
1148-
to, // to
1149-
false, // unconstrained
1150-
sta_->scenes(), // scene
1151-
sta::MinMaxAll::all(), // min_max
1152-
paths_per_endpoint, // group_path_count
1153-
paths_per_endpoint, // endpoint_path_count
1154-
false, // unique_pins
1155-
false, // unique_edges
1156-
-sta::INF, // slack_min
1157-
sta::INF, // slack_max
1158-
true, // sort_by_slack
1159-
group_names, // group_names
1160-
true,
1161-
false,
1162-
true,
1163-
true,
1164-
true,
1165-
true); // checks
1148+
= sta_->findPathEnds(nullptr, // from
1149+
nullptr, // thrus
1150+
to, // to
1151+
false, // unconstrained
1152+
sta_->scenes(), // scene
1153+
sta::MinMaxAll::all(), // min_max
1154+
paths_per_endpoint, // group_path_count
1155+
paths_per_endpoint, // endpoint_path_count
1156+
false, // unique_pins
1157+
false, // unique_edges
1158+
-sta::INF, // slack_min
1159+
sta::INF, // slack_max
1160+
true, // sort_by_slack
1161+
group_names, // group_names
1162+
true,
1163+
false,
1164+
true,
1165+
true,
1166+
true,
1167+
true); // checks
11661168

11671169
int path_num = 1;
11681170
for (const sta::PathEnd* path_end : path_ends) {

0 commit comments

Comments
 (0)