Skip to content

Commit 7f3d6db

Browse files
Merge pull request The-OpenROAD-Project#7178 from bnmfw/drt_abutment_debug
drt: PA skips abutment
2 parents dfa004d + 7071d85 commit 7f3d6db

File tree

6 files changed

+50
-19
lines changed

6 files changed

+50
-19
lines changed

src/drt/src/db/obj/frNet.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ class frNet : public frBlockObject
214214
}
215215
absPriorityLvl = max;
216216
}
217-
bool isSpecial() const { return isSpecial_; }
218-
void setIsSpecial(bool s) { isSpecial_ = s; }
217+
bool isSpecial() const { return is_special_; }
218+
void setIsSpecial(bool s) { is_special_ = s; }
219+
bool isConnectedByAbutment() const { return is_connected_by_abutment_; }
220+
void setIsConnectedByAbutment(bool s) { is_connected_by_abutment_ = s; }
219221
frPinFig* getPinFig(const int& id) { return all_pinfigs_[id]; }
220222
void setOrigGuides(const std::vector<frRect>& guides)
221223
{
@@ -254,7 +256,8 @@ class frNet : public frBlockObject
254256
int absPriorityLvl{0}; // absolute priority level: will be checked in net
255257
// ordering before other criteria
256258
bool isClock_{false};
257-
bool isSpecial_{false};
259+
bool is_special_{false};
260+
bool is_connected_by_abutment_{false};
258261
bool hasInitialRouting_{false};
259262
bool isFixed_{false};
260263

src/drt/src/io/io.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,7 @@ frNet* io::Parser::addNet(odb::dbNet* db_net)
964964
{
965965
bool is_special = db_net->isSpecial();
966966
bool has_jumpers = db_net->hasJumpers();
967+
bool is_abuted = db_net->isConnectedByAbutment();
967968
if (!is_special && db_net->getSigType().isSupply()) {
968969
logger_->error(DRT,
969970
305,
@@ -972,31 +973,30 @@ frNet* io::Parser::addNet(odb::dbNet* db_net)
972973
db_net->getName(),
973974
db_net->getSigType().getString());
974975
}
975-
std::unique_ptr<frNet> uNetIn
976+
std::unique_ptr<frNet> net_in
976977
= std::make_unique<frNet>(db_net->getName(), router_cfg_);
977-
auto netIn = uNetIn.get();
978978
if (db_net->getNonDefaultRule()) {
979-
uNetIn->updateNondefaultRule(
979+
net_in->updateNondefaultRule(
980980
getTech()->getNondefaultRule(db_net->getNonDefaultRule()->getName()));
981981
}
982982
if (db_net->getSigType() == dbSigType::CLOCK) {
983-
uNetIn->updateIsClock(true);
983+
net_in->updateIsClock(true);
984984
}
985985
if (is_special) {
986-
uNetIn->setIsSpecial(true);
986+
net_in->setIsSpecial(true);
987987
}
988-
if (has_jumpers) {
989-
uNetIn->setHasJumpers(has_jumpers);
990-
}
991-
updateNetRouting(netIn, db_net);
992-
netIn->setType(db_net->getSigType());
988+
net_in->setHasJumpers(has_jumpers);
989+
net_in->setIsConnectedByAbutment(is_abuted);
990+
updateNetRouting(net_in.get(), db_net);
991+
net_in->setType(db_net->getSigType());
992+
frNet* raw_net_in = net_in.get();
993993
if (is_special) {
994-
getBlock()->addSNet(std::move(uNetIn));
994+
getBlock()->addSNet(std::move(net_in));
995995
} else {
996-
getBlock()->addNet(std::move(uNetIn));
996+
getBlock()->addNet(std::move(net_in));
997997
}
998998

999-
return netIn;
999+
return raw_net_in;
10001000
}
10011001

10021002
void updatefrAccessPoint(odb::dbAccessPoint* db_ap,

src/drt/src/pa/FlexPA.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ void FlexPA::setDistributed(const std::string& rhost,
253253
cloud_sz_ = cloud_sz;
254254
}
255255

256-
// Skip power pins, pins connected to special nets, and dangling pins
257-
// (since we won't route these).
256+
// Skip power pins, pins connected to special nets, dangling pins and pins
257+
// connected by abuttment (since we won't route these).
258258
//
259259
// Checks only this inst_term and not an equivalent ones. This
260260
// is a helper to isSkipInstTerm and initSkipInstTerm.
@@ -265,6 +265,9 @@ bool FlexPA::isSkipInstTermLocal(frInstTerm* in)
265265
return true;
266266
}
267267
auto in_net = in->getNet();
268+
if (in_net && in_net->isConnectedByAbutment()) {
269+
return true;
270+
}
268271
if (in_net && !in_net->isSpecial()) {
269272
return false;
270273
}

src/drt/src/pa/FlexPA_unique.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,24 @@ bool UniqueInsts::hasUnique(frInst* inst) const
278278
return inst_to_unique_.find(inst) != inst_to_unique_.end();
279279
}
280280

281+
void UniqueInsts::forceInstAsClassHead(frInst* target_inst)
282+
{
283+
UniqueInsts::InstSet& unique_class = *inst_to_class_[target_inst];
284+
UniqueInsts::InstSet temporary_set;
285+
for (frInst* inst : unique_class) {
286+
if (inst != target_inst) {
287+
temporary_set.insert(inst);
288+
}
289+
}
290+
for (frInst* inst : temporary_set) {
291+
deleteInst(inst);
292+
}
293+
// target inst is now the only inst in the set, therefore its head
294+
for (frInst* inst : temporary_set) {
295+
addInst(inst);
296+
}
297+
}
298+
281299
// deleteInst has to be called both when an instance is deleted and might
282300
// be needed when moved
283301
frInst* UniqueInsts::deleteInst(frInst* inst)

src/drt/src/pa/FlexPA_unique.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ class UniqueInsts
7878
*/
7979
frInst* deleteInst(frInst* inst);
8080

81+
/**
82+
* @brief this function if for debugging. It makes the inst the class head.
83+
* This is relevant when debugguin with the gui, this is the inst that will
84+
* fail in PA, not other inst in its family
85+
*/
86+
void forceInstAsClassHead(frInst* inst);
87+
8188
void report() const;
8289
void setDesign(frDesign* design) { design_ = design; }
8390

src/odb/include/odb/db.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2331,7 +2331,7 @@ class dbNet : public dbObject
23312331
void clearSpecial();
23322332

23332333
///
2334-
/// Returns true if this dbNet have its pins connected by abutment
2334+
/// Returns true if this dbNet has its pins connected by abutment
23352335
///
23362336
bool isConnectedByAbutment();
23372337

0 commit comments

Comments
 (0)