Skip to content

Commit 471f14a

Browse files
authored
Merge pull request #9026 from gadfort/pad-keep-existing
pad: honor FIXED swires in rdl router
2 parents 7566065 + 26e9fee commit 471f14a

File tree

6 files changed

+3485
-4
lines changed

6 files changed

+3485
-4
lines changed

src/pad/src/RDLRouter.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "odb/db.h"
2929
#include "odb/dbObject.h"
3030
#include "odb/dbTransform.h"
31+
#include "odb/dbTypes.h"
3132
#include "odb/geom.h"
3233
#include "pad/ICeWall.h"
3334
#include "utl/Logger.h"
@@ -666,7 +667,14 @@ void RDLRouter::route(const std::vector<odb::dbNet*>& nets)
666667

667668
// remove old routes
668669
for (const auto& route : routes_) {
669-
route->getNet()->destroySWires();
670+
auto swires = route->getNet()->getSWires();
671+
for (auto itr = swires.begin(); itr != swires.end();) {
672+
if ((*itr)->getWireType() == odb::dbWireType::FIXED) {
673+
itr++;
674+
continue;
675+
}
676+
itr = odb::dbSWire::destroy(itr);
677+
}
670678
}
671679

672680
for (const auto& route : routes_) {
@@ -1795,11 +1803,13 @@ void RDLRouter::populateObstructions(const std::vector<odb::dbNet*>& nets)
17951803
// Get already routed nets obstructions, excluding those that will be routed
17961804
// now
17971805
for (auto* net : block_->getNets()) {
1798-
if (std::find(nets.begin(), nets.end(), net) != nets.end()) {
1799-
continue;
1800-
}
1806+
const bool is_routing_net = std::ranges::find(nets, net) != nets.end();
18011807

18021808
for (auto* swire : net->getSWires()) {
1809+
if (is_routing_net && swire->getWireType() != odb::dbWireType::FIXED) {
1810+
continue;
1811+
}
1812+
18031813
for (auto* box : swire->getWires()) {
18041814
if (box->getTechLayer() != layer_) {
18051815
continue;

src/pad/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ COMPULSORY_TESTS = [
5151
"rdl_route_bump_via",
5252
"rdl_route_failed",
5353
"rdl_route_invalid",
54+
"rdl_route_keep_existing",
5455
"rdl_route_max_iterations",
5556
"rdl_route_ports",
5657
"rdl_route_single_target",

src/pad/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ or_integration_tests(
4646
rdl_route_bump_via
4747
rdl_route_failed
4848
rdl_route_invalid
49+
rdl_route_keep_existing
4950
rdl_route_max_iterations
5051
rdl_route_ports
5152
rdl_route_single_target

0 commit comments

Comments
 (0)