Skip to content

Commit 4e95358

Browse files
authored
Merge pull request #9040 from The-OpenROAD-Project-staging/grt-incr-res-aware
grt: incremental resistance aware
2 parents 04377d9 + 1132b06 commit 4e95358

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

src/grt/src/GlobalRouter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5244,6 +5244,8 @@ std::vector<Net*> GlobalRouter::updateDirtyRoutes(bool save_guides)
52445244
}
52455245
}
52465246

5247+
fastroute_->setIncrementalGrt(false);
5248+
52475249
return dirty_nets;
52485250
}
52495251

@@ -5283,6 +5285,7 @@ void GlobalRouter::initFastRouteIncr(std::vector<Net*>& nets)
52835285
{
52845286
initNetlist(nets);
52855287
fastroute_->initAuxVar();
5288+
fastroute_->setIncrementalGrt(true);
52865289
}
52875290

52885291
GRouteDbCbk::GRouteDbCbk(GlobalRouter* grouter) : grouter_(grouter)

src/grt/src/fastroute/include/FastRoute.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ class FastRouteCore
274274
NetRouteMap getPlanarRoutes();
275275
void getPlanarRoute(odb::dbNet* db_net, GRoute& route);
276276
void get3DRoute(odb::dbNet* db_net, GRoute& route);
277+
void setIncrementalGrt(bool is_incremental);
277278

278279
private:
279280
int getEdgeCapacity(FrNet* net, int x1, int y1, EdgeDirection direction);
@@ -617,6 +618,7 @@ class FastRouteCore
617618
bool resistance_aware_ = false;
618619
bool enable_resistance_aware_ = false;
619620
bool is_3d_step_ = false;
621+
bool is_incremental_grt_ = false;
620622
int num_adjust_;
621623
int v_capacity_;
622624
int h_capacity_;

src/grt/src/fastroute/src/utility.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,11 @@ int FastRouteCore::getViaResistance(const int from_layer, const int to_layer)
563563
return std::ceil(total_via_resistance / default_res);
564564
}
565565

566+
void FastRouteCore::setIncrementalGrt(bool is_incremental)
567+
{
568+
is_incremental_grt_ = is_incremental;
569+
}
570+
566571
// Update and sort the nets by the worst slack. Finally pick a percentage of the
567572
// nets to use the resistance-aware strategy
568573
void FastRouteCore::updateSlacks(float percentage)
@@ -581,10 +586,16 @@ void FastRouteCore::updateSlacks(float percentage)
581586

582587
for (const int net_id : net_ids_) {
583588
FrNet* net = nets_[net_id];
589+
float slack = 0;
584590

585-
const float slack = getNetSlack(net->getDbNet());
591+
// TODO: Do not update slack during rsz repair
592+
// if (en_estimate_parasitics_) {
593+
slack = getNetSlack(net->getDbNet());
594+
// }
586595
net->setSlack(slack);
587-
net->setIsResAware(false);
596+
597+
// Enable res-aware for clock nets by default
598+
net->setIsResAware(net->isClock());
588599

589600
// Skip positive slacks above threshold
590601
// TODO: need to check this positive slack threshold
@@ -601,6 +612,11 @@ void FastRouteCore::updateSlacks(float percentage)
601612

602613
std::stable_sort(res_aware_list.begin(), res_aware_list.end(), compareSlack);
603614

615+
// During incremental grt, enable res-aware for all nets
616+
if (is_incremental_grt_) {
617+
percentage = 1;
618+
}
619+
604620
// Decide the percentage of nets that will use resistance aware
605621
for (int i = 0; i < res_aware_list.size() * percentage; i++) {
606622
nets_[res_aware_list[i].first]->setIsResAware(true);

0 commit comments

Comments
 (0)