Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drt: add net when it does not exist in drt yet #6051

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 39 additions & 29 deletions src/drt/src/io/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,38 +968,45 @@ void io::Parser::updateNetRouting(frNet* netIn, odb::dbNet* net)
}
void io::Parser::setNets(odb::dbBlock* block)
{
for (auto net : block->getNets()) {
bool is_special = net->isSpecial();
if (!is_special && net->getSigType().isSupply()) {
logger_->error(DRT,
305,
"Net {} of signal type {} is not routable by TritonRoute. "
"Move to special nets.",
net->getName(),
net->getSigType().getString());
}
std::unique_ptr<frNet> uNetIn = std::make_unique<frNet>(net->getName());
auto netIn = uNetIn.get();
if (net->getNonDefaultRule()) {
uNetIn->updateNondefaultRule(
getTech()->getNondefaultRule(net->getNonDefaultRule()->getName()));
}
if (net->getSigType() == dbSigType::CLOCK) {
uNetIn->updateIsClock(true);
}
if (is_special) {
uNetIn->setIsSpecial(true);
}
updateNetRouting(netIn, net);
netIn->setType(net->getSigType());
if (is_special) {
getBlock()->addSNet(std::move(uNetIn));
} else {
getBlock()->addNet(std::move(uNetIn));
}
for (auto db_net : block->getNets()) {
addNet(db_net);
}
}

frNet* io::Parser::addNet(odb::dbNet* db_net)
{
bool is_special = db_net->isSpecial();
if (!is_special && db_net->getSigType().isSupply()) {
logger_->error(DRT,
305,
"Net {} of signal type {} is not routable by TritonRoute. "
"Move to special nets.",
db_net->getName(),
db_net->getSigType().getString());
}
std::unique_ptr<frNet> uNetIn = std::make_unique<frNet>(db_net->getName());
auto netIn = uNetIn.get();
if (db_net->getNonDefaultRule()) {
uNetIn->updateNondefaultRule(
getTech()->getNondefaultRule(db_net->getNonDefaultRule()->getName()));
}
if (db_net->getSigType() == dbSigType::CLOCK) {
uNetIn->updateIsClock(true);
}
if (is_special) {
uNetIn->setIsSpecial(true);
}
updateNetRouting(netIn, db_net);
netIn->setType(db_net->getSigType());
if (is_special) {
getBlock()->addSNet(std::move(uNetIn));
} else {
getBlock()->addNet(std::move(uNetIn));
}

return netIn;
}

void updatefrAccessPoint(odb::dbAccessPoint* db_ap,
frAccessPoint* ap,
frTechObject* tech)
Expand Down Expand Up @@ -3050,6 +3057,9 @@ void io::Parser::updateDesign()
}
for (auto db_net : block->getNets()) {
auto netIn = getBlock()->findNet(db_net->getName());
if (netIn == nullptr) {
netIn = addNet(db_net);
}
netIn->clearConns();
netIn->clearRPins();
netIn->clearGuides();
Expand Down
1 change: 1 addition & 0 deletions src/drt/src/io/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class Parser
void setVias(odb::dbBlock*);
void updateNetRouting(frNet*, odb::dbNet*);
void setNets(odb::dbBlock*);
frNet* addNet(odb::dbNet* db_net);
void setAccessPoints(odb::dbDatabase*);
void getSBoxCoords(odb::dbSBox*,
frCoord&,
Expand Down
Loading