From 39ac5acc4e91e345cd2a9e2a0314e74f6a76389a Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Thu, 12 Mar 2026 21:40:21 +0000 Subject: [PATCH 1/9] Fix for issue 9274 Lost parasitic annotations because of dbNetwork details Signed-off-by: dsengupta0628 --- src/dbSta/src/dbNetwork.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dbSta/src/dbNetwork.cc b/src/dbSta/src/dbNetwork.cc index d67341f2f2e..58a06ec1bb3 100644 --- a/src/dbSta/src/dbNetwork.cc +++ b/src/dbSta/src/dbNetwork.cc @@ -2018,6 +2018,15 @@ void dbNetwork::visitConnectedPins(const Net* net, const Net* dbNetwork::highestConnectedNet(Net* net) const { + dbNet* db_net = nullptr; + odb::dbModNet* db_modnet = nullptr; + staToDb(net, db_net, db_modnet); + if (db_modnet) { + dbNet* flat_net = db_modnet->findRelatedNet(); + if (flat_net) { + return dbToSta(flat_net); + } + } return net; } From 35f274e906f6bba6fc56d93d5734fcd8a1242478 Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Fri, 13 Mar 2026 16:10:47 +0000 Subject: [PATCH 2/9] simplfy logic per feedback Signed-off-by: dsengupta0628 --- src/dbSta/src/dbNetwork.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/dbSta/src/dbNetwork.cc b/src/dbSta/src/dbNetwork.cc index 58a06ec1bb3..2d83f6bcff1 100644 --- a/src/dbSta/src/dbNetwork.cc +++ b/src/dbSta/src/dbNetwork.cc @@ -2018,16 +2018,8 @@ void dbNetwork::visitConnectedPins(const Net* net, const Net* dbNetwork::highestConnectedNet(Net* net) const { - dbNet* db_net = nullptr; - odb::dbModNet* db_modnet = nullptr; - staToDb(net, db_net, db_modnet); - if (db_modnet) { - dbNet* flat_net = db_modnet->findRelatedNet(); - if (flat_net) { - return dbToSta(flat_net); - } - } - return net; + const Net* flat = findFlatNet(net); + return flat ? flat : net; } //////////////////////////////////////////////////////////////// From 09730f15ebb2e86274c1ad25dfa1a1bb3031c72c Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Fri, 13 Mar 2026 16:20:56 +0000 Subject: [PATCH 3/9] Added comments for caution Signed-off-by: dsengupta0628 --- src/dbSta/src/dbNetwork.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dbSta/src/dbNetwork.cc b/src/dbSta/src/dbNetwork.cc index 2d83f6bcff1..f1612c894b3 100644 --- a/src/dbSta/src/dbNetwork.cc +++ b/src/dbSta/src/dbNetwork.cc @@ -2016,6 +2016,14 @@ void dbNetwork::visitConnectedPins(const Net* net, } } +// Caution: +// - Network::highestConnectedNet(Net *net) retrieves the highest hierarchical +// net connected to the given net. +// - But `dbNetwork::highestConnectedNet(Net* net)` retrieves the corresponding +// flat net for the given net. +// - It behaves differently to cope with the issue 9724. +// - This redefinition may cause another issue later when +// `Network::highestConnectedNet(Net *net)` is used elsewhere. const Net* dbNetwork::highestConnectedNet(Net* net) const { const Net* flat = findFlatNet(net); From 46be33bde81ee8de4f5f40d3108dd5db1d6d9487 Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Thu, 19 Mar 2026 14:12:01 +0000 Subject: [PATCH 4/9] updated sta to latest on 3/19 Signed-off-by: dsengupta0628 --- src/sta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sta b/src/sta index d213f0fa711..69e11bbd0d4 160000 --- a/src/sta +++ b/src/sta @@ -1 +1 @@ -Subproject commit d213f0fa711cad444e8ef82ee395dc03b6e94510 +Subproject commit 69e11bbd0d4659730c0ef95d92c653a0c72b975f From 683200730b557570f685d8a452889f019eb980e5 Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Fri, 20 Mar 2026 00:16:07 +0000 Subject: [PATCH 5/9] isExternal issue fix to resolve crash in PRIMA delay calc Signed-off-by: dsengupta0628 --- src/dbSta/include/db_sta/dbNetwork.hh | 5 ++++- src/dbSta/src/dbNetwork.cc | 11 +++++++---- src/dbSta/test/cpp/TestDbSta.cc | 4 +++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/dbSta/include/db_sta/dbNetwork.hh b/src/dbSta/include/db_sta/dbNetwork.hh index 9d2fbf19b26..cc09d703570 100644 --- a/src/dbSta/include/db_sta/dbNetwork.hh +++ b/src/dbSta/include/db_sta/dbNetwork.hh @@ -360,7 +360,10 @@ class dbNetwork : public ConcreteNetwork // Return the highest net above the given net. // - If the net is a flat net, return it. - // - If the net is a hier net, return the modnet in the highest hierarchy. + // - If the net is a hier net (dbModNet), return the associated flat dbNet. + // This ensures parasitic externality checks in ensureParasiticNode work + // correctly: net_ is always a flat net, so the comparison net != net_ + // must also operate on flat nets. Net* highestNetAbove(Net* net) const override; //////////////////////////////////////////////////////////////// diff --git a/src/dbSta/src/dbNetwork.cc b/src/dbSta/src/dbNetwork.cc index 55515d6c1fc..c0ce698c351 100644 --- a/src/dbSta/src/dbNetwork.cc +++ b/src/dbSta/src/dbNetwork.cc @@ -5205,11 +5205,14 @@ Net* dbNetwork::highestNetAbove(Net* net) const } if (modnet) { + // Return the flat net associated with this mod net. + // Parasitic externality checks in ConcreteParasiticNetwork::ensureParasiticNode + // compare against net_ which is always a flat net (set via makeParasiticNetwork). + // Returning the highest mod net causes all pin nodes on hierarchically-connected + // nets to compare unequal to net_ and be incorrectly marked as external, + // making node_count_ = 0 and crashing PRIMA in measureThresholds. if (dbNet* related_dbnet = modnet->findRelatedNet()) { - if (odb::dbModNet* highest_modnet - = related_dbnet->findModNetInHighestHier()) { - return dbToSta(highest_modnet); // Found the highest modnet - } + return dbToSta(related_dbnet); } } diff --git a/src/dbSta/test/cpp/TestDbSta.cc b/src/dbSta/test/cpp/TestDbSta.cc index d752d0421b1..7f664c709c9 100644 --- a/src/dbSta/test/cpp/TestDbSta.cc +++ b/src/dbSta/test/cpp/TestDbSta.cc @@ -77,9 +77,11 @@ TEST_F(TestDbSta, TestHierarchyConnectivity) ASSERT_NE(modnet_out2, nullptr); Net* sta_modnet_out2 = db_network_->dbToSta(modnet_out2); ASSERT_NE(sta_modnet_out2, nullptr); + // highestNetAbove on a mod net now returns the associated flat dbNet, + // not the highest mod net, so that parasitic externality checks work correctly. Net* sta_highest_modnet_out = db_network_->highestNetAbove(sta_modnet_mod_out); - ASSERT_EQ(sta_highest_modnet_out, sta_modnet_out2); + ASSERT_EQ(sta_highest_modnet_out, sta_dbnet_out2); // Check get_ports -of_object Net* NetTermIterator* term_iter = db_network_->termIterator(sta_dbnet_out2); From 73558abfb6c4d8d99d31fb151d63845c9545b990 Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Fri, 20 Mar 2026 00:36:05 +0000 Subject: [PATCH 6/9] reformatted clang Signed-off-by: dsengupta0628 --- src/dbSta/include/db_sta/dbNetwork.hh | 6 +++--- src/dbSta/src/dbNetwork.cc | 13 +++++++------ src/dbSta/test/cpp/TestDbSta.cc | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/dbSta/include/db_sta/dbNetwork.hh b/src/dbSta/include/db_sta/dbNetwork.hh index cc09d703570..9c1998c938c 100644 --- a/src/dbSta/include/db_sta/dbNetwork.hh +++ b/src/dbSta/include/db_sta/dbNetwork.hh @@ -361,9 +361,9 @@ class dbNetwork : public ConcreteNetwork // Return the highest net above the given net. // - If the net is a flat net, return it. // - If the net is a hier net (dbModNet), return the associated flat dbNet. - // This ensures parasitic externality checks in ensureParasiticNode work - // correctly: net_ is always a flat net, so the comparison net != net_ - // must also operate on flat nets. + // This ensures parasitic externality checks in ensureParasiticNode work + // correctly: net_ is always a flat net, so the comparison net != net_ + // must also operate on flat nets. Net* highestNetAbove(Net* net) const override; //////////////////////////////////////////////////////////////// diff --git a/src/dbSta/src/dbNetwork.cc b/src/dbSta/src/dbNetwork.cc index c0ce698c351..5707ca78fa6 100644 --- a/src/dbSta/src/dbNetwork.cc +++ b/src/dbSta/src/dbNetwork.cc @@ -2017,7 +2017,7 @@ void dbNetwork::visitConnectedPins(const Net* net, } // Caution: -// - Network::highestConnectedNet(Net *net) retrieves the highest hierarchical +//- Network::highestConnectedNet(Net *net) retrieves the highest hierarchical // net connected to the given net. // - But `dbNetwork::highestConnectedNet(Net* net)` retrieves the corresponding // flat net for the given net. @@ -5206,11 +5206,12 @@ Net* dbNetwork::highestNetAbove(Net* net) const if (modnet) { // Return the flat net associated with this mod net. - // Parasitic externality checks in ConcreteParasiticNetwork::ensureParasiticNode - // compare against net_ which is always a flat net (set via makeParasiticNetwork). - // Returning the highest mod net causes all pin nodes on hierarchically-connected - // nets to compare unequal to net_ and be incorrectly marked as external, - // making node_count_ = 0 and crashing PRIMA in measureThresholds. + // Parasitic externality checks in + // ConcreteParasiticNetwork::ensureParasiticNode compare against net_ which + // is always a flat net (set via makeParasiticNetwork). Returning the + // highest mod net causes all pin nodes on hierarchically-connected nets to + // compare unequal to net_ and be incorrectly marked as external, making + // node_count_ = 0 and crashing PRIMA in measureThresholds. if (dbNet* related_dbnet = modnet->findRelatedNet()) { return dbToSta(related_dbnet); } diff --git a/src/dbSta/test/cpp/TestDbSta.cc b/src/dbSta/test/cpp/TestDbSta.cc index 7f664c709c9..f1c9c549d34 100644 --- a/src/dbSta/test/cpp/TestDbSta.cc +++ b/src/dbSta/test/cpp/TestDbSta.cc @@ -77,8 +77,8 @@ TEST_F(TestDbSta, TestHierarchyConnectivity) ASSERT_NE(modnet_out2, nullptr); Net* sta_modnet_out2 = db_network_->dbToSta(modnet_out2); ASSERT_NE(sta_modnet_out2, nullptr); - // highestNetAbove on a mod net now returns the associated flat dbNet, - // not the highest mod net, so that parasitic externality checks work correctly. + // highestNetAbove on a mod net now returns the associated flat dbNet, not the + // highest mod net, so that parasitic externality checks work correctly. Net* sta_highest_modnet_out = db_network_->highestNetAbove(sta_modnet_mod_out); ASSERT_EQ(sta_highest_modnet_out, sta_dbnet_out2); From 51a1bb59697acd55b75fef1cb21717bcaeeb22b2 Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Mon, 23 Mar 2026 19:46:09 +0000 Subject: [PATCH 7/9] update latest src/sta Signed-off-by: dsengupta0628 --- src/sta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sta b/src/sta index 69e11bbd0d4..2e6dd048370 160000 --- a/src/sta +++ b/src/sta @@ -1 +1 @@ -Subproject commit 69e11bbd0d4659730c0ef95d92c653a0c72b975f +Subproject commit 2e6dd04837035b68592eee7b5f83c6e80593c3f3 From 62d242f29d9f3482a742d298355d27e6bb0ea1c3 Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Mon, 23 Mar 2026 23:26:50 +0000 Subject: [PATCH 8/9] Force-align STA submodule to master (d213f0f) --- src/sta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sta b/src/sta index 2e6dd048370..d213f0fa711 160000 --- a/src/sta +++ b/src/sta @@ -1 +1 @@ -Subproject commit 2e6dd04837035b68592eee7b5f83c6e80593c3f3 +Subproject commit d213f0fa711cad444e8ef82ee395dc03b6e94510 From 1623227e762c35e25debe4e4bd941d1d9807763f Mon Sep 17 00:00:00 2001 From: dsengupta0628 Date: Mon, 30 Mar 2026 14:27:21 +0000 Subject: [PATCH 9/9] updated with latest sta and OR master Signed-off-by: dsengupta0628 --- src/sta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sta b/src/sta index ffda41536fe..41ad5c62b8f 160000 --- a/src/sta +++ b/src/sta @@ -1 +1 @@ -Subproject commit ffda41536fe1cff4a3a9eed7caf9f810f63234e0 +Subproject commit 41ad5c62b8f6f2596d9b1983255c0928537bdd31