Skip to content

Commit 68827da

Browse files
committed
Enhanced hierarchicalConnect() to support flat flow too.
Signed-off-by: Jaehyun Kim <[email protected]>
1 parent 24c1196 commit 68827da

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/dbSta/src/dbEditHierarchy.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,34 @@ void dbEditHierarchy::hierarchicalConnect(dbITerm* source_pin,
250250
// co-existing, something we respect even when making
251251
// new hierarchical connections.
252252
//
253+
254+
// Connect source and dest pins directly in flat flow
253255
dbNet* source_db_net = source_pin->getNet();
256+
dbNet* dest_db_net = dest_pin->getNet();
257+
if (db_network_->hierarchy_ == false) {
258+
// If both source pin and dest pin do not have a corresponding flat net,
259+
// Create a new net and connect it with source pin.
260+
if (source_db_net == nullptr && dest_db_net == nullptr) {
261+
Net* new_net = db_network_->makeNet(
262+
connection_name,
263+
db_network_->parent(db_network_->dbToSta(source_pin->getInst())),
264+
odb::dbNameUniquifyType::IF_NEEDED);
265+
source_db_net = db_network_->staToDb(new_net);
266+
source_pin->connect(source_db_net);
267+
}
268+
269+
// Connect
270+
if (source_db_net) {
271+
dest_pin->connect(source_db_net);
272+
} else {
273+
assert(dest_db_net);
274+
source_pin->connect(dest_db_net);
275+
}
276+
277+
dlogHierConnDone();
278+
return; // Done here in a flat flow
279+
}
280+
254281
if (!source_db_net) {
255282
dlogHierConnCreateFlatNet(connection_name);
256283
Net* new_net = db_network_->makeNet(

src/dbSta/src/dbNetwork.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,7 @@ ObjectId dbNetwork::id(const Net* net) const
15781578
const dbObject* obj = reinterpret_cast<const dbObject*>(net);
15791579
return getDbNwkObjectId(obj);
15801580
}
1581+
assert(dnet != nullptr);
15811582
return dnet->getId();
15821583
}
15831584

0 commit comments

Comments
 (0)