Skip to content

Commit 932eab6

Browse files
Merge pull request #10931 from eder-matheus/est_3d_support
est: use block tech instead of db tech and add initChip for 3D support
2 parents 2297fce + 20effc2 commit 932eab6

2 files changed

Lines changed: 30 additions & 13 deletions

File tree

src/est/include/est/EstimateParasitics.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ class EstimateParasitics : public sta::dbStaState, public ParasiticsService
205205
void removeDbCbkOwner();
206206

207207
void initBlock();
208+
void initChip(odb::dbChip* chip);
208209

209210
utl::Logger* getLogger() { return logger_; }
210211

src/est/src/EstimateParasitics.cpp

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void EstimateParasitics::setLayerRC(odb::dbTechLayer* layer,
116116
double cap)
117117
{
118118
if (layer_res_.empty()) {
119-
int layer_count = db_->getTech()->getLayerCount();
119+
int layer_count = layer->getTech()->getLayerCount();
120120
int corner_count = sta_->scenes().size();
121121
layer_res_.resize(layer_count);
122122
layer_cap_.resize(layer_count);
@@ -364,12 +364,28 @@ void EstimateParasitics::initBlock()
364364
logger_->error(EST, 163, "Database has no block");
365365
}
366366

367-
dbu_ = db_->getTech()->getDbUnitsPerMicron();
367+
dbu_ = block_->getTech()->getDbUnitsPerMicron();
368368
if (!db_cbk_->hasOwner()) {
369369
db_cbk_->addOwner(block_);
370370
}
371371
}
372372

373+
void EstimateParasitics::initChip(odb::dbChip* chip)
374+
{
375+
odb::dbBlock* block = chip ? chip->getBlock() : nullptr;
376+
if (block == nullptr) {
377+
logger_->error(EST, 167, "Chip has no block to estimate");
378+
}
379+
380+
if (block_ != block) {
381+
if (db_cbk_->hasOwner()) {
382+
db_cbk_->removeOwner();
383+
}
384+
block_ = block;
385+
}
386+
initBlock();
387+
}
388+
373389
void EstimateParasitics::ensureParasitics()
374390
{
375391
estimateParasitics(global_router_->haveRoutes()
@@ -556,7 +572,7 @@ void EstimateParasitics::estimateGlobalRouteRC(sta::SpefWriter* spef_writer)
556572
}
557573

558574
MakeWireParasitics builder(
559-
logger_, this, sta_, db_->getTech(), block_, global_router_);
575+
logger_, this, sta_, block_->getTech(), block_, global_router_);
560576

561577
for (auto& [db_net, route] : global_router_->getRoutes()) {
562578
if (!route.empty()) {
@@ -568,7 +584,7 @@ void EstimateParasitics::estimateGlobalRouteRC(sta::SpefWriter* spef_writer)
568584
void EstimateParasitics::estimateGlobalRouteRC(odb::dbNet* db_net)
569585
{
570586
MakeWireParasitics builder(
571-
logger_, this, sta_, db_->getTech(), block_, global_router_);
587+
logger_, this, sta_, block_->getTech(), block_, global_router_);
572588
auto& routes = global_router_->getRoutes();
573589
auto iter = routes.find(db_net);
574590
if (iter == routes.end()) {
@@ -585,7 +601,7 @@ void EstimateParasitics::estimateGlobalRouteParasitics(odb::dbNet* net,
585601
{
586602
initBlock();
587603
MakeWireParasitics builder(
588-
logger_, this, sta_, db_->getTech(), block_, global_router_);
604+
logger_, this, sta_, block_->getTech(), block_, global_router_);
589605

590606
// Check if we are estimating parasitics after layer assignment
591607
if (route.at(0).is3DRoute()) {
@@ -597,8 +613,9 @@ void EstimateParasitics::estimateGlobalRouteParasitics(odb::dbNet* net,
597613

598614
void EstimateParasitics::clearParasitics()
599615
{
616+
initBlock();
600617
MakeWireParasitics builder(
601-
logger_, this, sta_, db_->getTech(), block_, global_router_);
618+
logger_, this, sta_, block_->getTech(), block_, global_router_);
602619
builder.clearParasitics();
603620
}
604621

@@ -910,6 +927,7 @@ double EstimateParasitics::computeAverageCutResistance(sta::Scene* scene)
910927
double total_resistance = 0.0;
911928
int count = 0;
912929

930+
odb::dbTech* tech = block_->getTech();
913931
int min_layer = block_->getMinRoutingLayer();
914932
int max_layer = block_->getMaxRoutingLayer();
915933

@@ -920,7 +938,6 @@ double EstimateParasitics::computeAverageCutResistance(sta::Scene* scene)
920938
// frontside boundary; counting only frontside levels keeps the
921939
// heuristic on the side that hosts the signal routes whose cut
922940
// resistance this function averages.
923-
odb::dbTech* tech = db_->getTech();
924941
const int total_levels = tech->getRoutingLayerCount();
925942
odb::dbTechLayer* first_front = tech->firstFrontsideRoutingLayer();
926943
if (first_front != nullptr) {
@@ -932,15 +949,13 @@ double EstimateParasitics::computeAverageCutResistance(sta::Scene* scene)
932949
}
933950
}
934951

935-
odb::dbTechLayer* min_tech_layer
936-
= db_->getTech()->findRoutingLayer(min_layer);
937-
odb::dbTechLayer* max_tech_layer
938-
= db_->getTech()->findRoutingLayer(max_layer);
952+
odb::dbTechLayer* min_tech_layer = tech->findRoutingLayer(min_layer);
953+
odb::dbTechLayer* max_tech_layer = tech->findRoutingLayer(max_layer);
939954

940955
for (int layer_idx = min_tech_layer->getNumber();
941956
layer_idx <= max_tech_layer->getNumber();
942957
layer_idx++) {
943-
odb::dbTechLayer* layer = db_->getTech()->findLayer(layer_idx);
958+
odb::dbTechLayer* layer = tech->findLayer(layer_idx);
944959
if (layer && layer->getType() == odb::dbTechLayerType::CUT) {
945960
const float resistance = layer_res_[layer_idx][scene->index()];
946961
total_resistance += resistance;
@@ -1032,9 +1047,10 @@ void EstimateParasitics::insertViaResistances(odb::dbTechLayer* pin_layer,
10321047
const auto [start_idx, end_idx]
10331048
= std::minmax(pin_layer_idx, tree_layer_idx);
10341049
const bool pin_is_below = (pin_layer_idx < tree_layer_idx);
1050+
odb::dbTech* tech = pin_layer->getTech();
10351051

10361052
for (int layer_idx = start_idx; layer_idx < end_idx; layer_idx++) {
1037-
odb::dbTechLayer* cut_layer = db_->getTech()->findLayer(layer_idx);
1053+
odb::dbTechLayer* cut_layer = tech->findLayer(layer_idx);
10381054
if (cut_layer->getType() != odb::dbTechLayerType::CUT) {
10391055
continue;
10401056
}

0 commit comments

Comments
 (0)