From 41b7b9304caf7587be48a5ad9885a2ef2c864988 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Fri, 12 Dec 2025 12:09:30 +0000 Subject: [PATCH 01/11] grt: infinite capacity command for testing purpose Signed-off-by: Jonas Gava --- src/grt/include/grt/GlobalRouter.h | 5 ++++- src/grt/src/GlobalRouter.cpp | 23 +++++++++++++++-------- src/grt/src/GlobalRouter.i | 6 ++++++ src/grt/src/GlobalRouter.tcl | 8 ++++++-- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/grt/include/grt/GlobalRouter.h b/src/grt/include/grt/GlobalRouter.h index bd321aea2a3..908d967a6a3 100644 --- a/src/grt/include/grt/GlobalRouter.h +++ b/src/grt/include/grt/GlobalRouter.h @@ -160,6 +160,8 @@ class GlobalRouter skip_large_fanout_ = skip_large_fanout; }; + void setInfiniteCapacity(bool infinite_capacity); + // flow functions void readGuides(const char* file_name); void loadGuidesFromDB(); @@ -493,7 +495,7 @@ class GlobalRouter std::vector routing_tracks_; // Flow variables - bool is_incremental_; + bool infinite_capacity_; float adjustment_; int layer_for_guide_dimension_; int congestion_iterations_{50}; @@ -544,6 +546,7 @@ class GlobalRouter // incremental grt GRouteDbCbk* grouter_cbk_; + bool is_incremental_; friend class IncrementalGRoute; friend class GRouteDbCbk; diff --git a/src/grt/src/GlobalRouter.cpp b/src/grt/src/GlobalRouter.cpp index 05c5d244a9f..b482f6041dd 100644 --- a/src/grt/src/GlobalRouter.cpp +++ b/src/grt/src/GlobalRouter.cpp @@ -696,6 +696,8 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) fastroute_->initEdges(); int x_grids = grid_->getXGrids(); int y_grids = grid_->getYGrids(); + const int BIG_INT = std::numeric_limits::max(); + const int16_t big_cap = 1000; for (int layer = 1; layer <= grid_->getNumLayers(); layer++) { odb::dbTechLayer* tech_layer = db_->getTech()->findRoutingLayer(layer); @@ -710,7 +712,7 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) = tech_layer->getDirection() == odb::dbTechLayerDir::HORIZONTAL; if (tech_layer->getDirection() == odb::dbTechLayerDir::HORIZONTAL) { - int min_cap = std::numeric_limits::max(); + int min_cap = BIG_INT; for (int y = 1; y <= y_grids; y++) { for (int x = 1; x < x_grids; x++) { const int cap = inside_layer_range ? computeGCellCapacity(x - 1, @@ -721,13 +723,13 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) horizontal) : 0; min_cap = std::min(min_cap, cap); - fastroute_->setEdgeCapacity(x - 1, y - 1, x, y - 1, layer, cap); + fastroute_->setEdgeCapacity(x - 1, y - 1, x, y - 1, layer, infinite_capacity_ ? big_cap : cap); } } - min_cap = min_cap == std::numeric_limits::max() ? 0 : min_cap; - fastroute_->addHCapacity(min_cap, layer); + min_cap = min_cap == BIG_INT ? 0 : min_cap; + fastroute_->addHCapacity(infinite_capacity_ ? big_cap : min_cap, layer); } else { - int min_cap = std::numeric_limits::max(); + int min_cap = BIG_INT; for (int x = 1; x <= x_grids; x++) { for (int y = 1; y < y_grids; y++) { const int cap = inside_layer_range ? computeGCellCapacity(x - 1, @@ -738,16 +740,21 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) horizontal) : 0; min_cap = std::min(min_cap, cap); - fastroute_->setEdgeCapacity(x - 1, y - 1, x - 1, y, layer, cap); + fastroute_->setEdgeCapacity(x - 1, y - 1, x - 1, y, layer, infinite_capacity_ ? big_cap : cap); } } - min_cap = min_cap == std::numeric_limits::max() ? 0 : min_cap; - fastroute_->addVCapacity(min_cap, layer); + min_cap = min_cap == BIG_INT ? 0 : min_cap; + fastroute_->addVCapacity(infinite_capacity_ ? big_cap : min_cap, layer); } } fastroute_->initLowerBoundCapacities(); } +void GlobalRouter::setInfiniteCapacity(bool infinite_capacity) +{ + infinite_capacity_ = infinite_capacity; +} + int GlobalRouter::computeGCellCapacity(const int x, const int y, const int track_init, diff --git a/src/grt/src/GlobalRouter.i b/src/grt/src/GlobalRouter.i index 7ff8b167bfc..66290738f06 100644 --- a/src/grt/src/GlobalRouter.i +++ b/src/grt/src/GlobalRouter.i @@ -152,6 +152,12 @@ set_skip_large_fanout(int skip_large_fanout) getGlobalRouter()->setSkipLargeFanoutNets(skip_large_fanout); } +void +set_infinite_cap(bool infinite_capacity) +{ + getGlobalRouter()->setInfiniteCapacity(infinite_capacity); +} + void global_route(bool start_incremental, bool end_incremental) { diff --git a/src/grt/src/GlobalRouter.tcl b/src/grt/src/GlobalRouter.tcl index d29e487db20..e236c1401fd 100644 --- a/src/grt/src/GlobalRouter.tcl +++ b/src/grt/src/GlobalRouter.tcl @@ -152,7 +152,8 @@ sta::define_cmd_args "global_route" {[-guide_file out_file] \ [-start_incremental] \ [-end_incremental] \ [-use_cugr] \ - [-resistance_aware] + [-resistance_aware] \ + [-infinite_cap] } proc global_route { args } { @@ -161,7 +162,7 @@ proc global_route { args } { -grid_origin -critical_nets_percentage -congestion_report_iter_step\ -skip_large_fanout_nets } \ - flags {-allow_congestion -resistance_aware -verbose -start_incremental -end_incremental \ + flags {-allow_congestion -resistance_aware -infinite_cap -verbose -start_incremental -end_incremental \ -use_cugr} sta::check_argc_eq0 "global_route" $args @@ -228,6 +229,9 @@ proc global_route { args } { set resistance_aware [info exists flags(-resistance_aware)] grt::set_resistance_aware $resistance_aware + set infinite_cap [info exists flags(-infinite_cap)] + grt::set_infinite_cap $infinite_cap + set start_incremental [info exists flags(-start_incremental)] set end_incremental [info exists flags(-end_incremental)] From a9468dd30004c67aebd1d3cd893ef9c004de1f44 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Fri, 12 Dec 2025 12:18:17 +0000 Subject: [PATCH 02/11] grt: update readme with -infinite_cap Signed-off-by: Jonas Gava --- src/grt/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/grt/README.md b/src/grt/README.md index 28ff6cbc687..735a46c23f9 100644 --- a/src/grt/README.md +++ b/src/grt/README.md @@ -50,6 +50,7 @@ global_route | `-end_incremental` | This flag run incremental GRT with the nets modified. The default is false. | | `-use_cugr` | This flag run GRT using CUGR as the router solver. NOTE: this is not ready for production. | | `-resistance_aware` | This flag enables resistance-aware layer assignment and 3D routing. NOTE: this is not ready for production. | +| `-infinite_cap` | Enables "infinite" gcell capacity for testing purpose. | ### Set Routing Layers From 1478b086b4065c014d1f6e1ced0bc6f66d4bff2d Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Mon, 15 Dec 2025 14:50:48 +0000 Subject: [PATCH 03/11] grt: fix clang format Signed-off-by: Jonas Gava --- src/grt/src/GlobalRouter.cpp | 16 +++++++++++++--- src/grt/src/GlobalRouter.tcl | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/grt/src/GlobalRouter.cpp b/src/grt/src/GlobalRouter.cpp index b482f6041dd..79a6e0bfa9e 100644 --- a/src/grt/src/GlobalRouter.cpp +++ b/src/grt/src/GlobalRouter.cpp @@ -723,7 +723,12 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) horizontal) : 0; min_cap = std::min(min_cap, cap); - fastroute_->setEdgeCapacity(x - 1, y - 1, x, y - 1, layer, infinite_capacity_ ? big_cap : cap); + fastroute_->setEdgeCapacity(x - 1, + y - 1, + x, + y - 1, + layer, + infinite_capacity_ ? big_cap : cap); } } min_cap = min_cap == BIG_INT ? 0 : min_cap; @@ -740,11 +745,16 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) horizontal) : 0; min_cap = std::min(min_cap, cap); - fastroute_->setEdgeCapacity(x - 1, y - 1, x - 1, y, layer, infinite_capacity_ ? big_cap : cap); + fastroute_->setEdgeCapacity(x - 1, + y - 1, + x - 1, + y, + layer, + infinite_capacity_ ? big_cap : cap); } } min_cap = min_cap == BIG_INT ? 0 : min_cap; - fastroute_->addVCapacity(infinite_capacity_ ? big_cap : min_cap, layer); + fastroute_->addVCapacity(infinite_capacity_ ? big_cap : min_cap, layer); } } fastroute_->initLowerBoundCapacities(); diff --git a/src/grt/src/GlobalRouter.tcl b/src/grt/src/GlobalRouter.tcl index e236c1401fd..6f324701a3a 100644 --- a/src/grt/src/GlobalRouter.tcl +++ b/src/grt/src/GlobalRouter.tcl @@ -162,8 +162,8 @@ proc global_route { args } { -grid_origin -critical_nets_percentage -congestion_report_iter_step\ -skip_large_fanout_nets } \ - flags {-allow_congestion -resistance_aware -infinite_cap -verbose -start_incremental -end_incremental \ - -use_cugr} + flags {-allow_congestion -resistance_aware -infinite_cap -verbose -start_incremental \ + -end_incremental -use_cugr} sta::check_argc_eq0 "global_route" $args From 04fd9ff03948ca7c6175dffde4f4555e228f9a49 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Mon, 15 Dec 2025 15:40:03 +0000 Subject: [PATCH 04/11] grt: initialize some variables with false Signed-off-by: Jonas Gava --- src/grt/include/grt/GlobalRouter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grt/include/grt/GlobalRouter.h b/src/grt/include/grt/GlobalRouter.h index 99f98e7bd2f..7f4bf712420 100644 --- a/src/grt/include/grt/GlobalRouter.h +++ b/src/grt/include/grt/GlobalRouter.h @@ -494,7 +494,7 @@ class GlobalRouter std::vector routing_tracks_; // Flow variables - bool infinite_capacity_; + bool infinite_capacity_ = false; float adjustment_; int congestion_iterations_{50}; int congestion_report_iter_step_; @@ -544,7 +544,7 @@ class GlobalRouter // incremental grt GRouteDbCbk* grouter_cbk_; - bool is_incremental_; + bool is_incremental_ = false; friend class IncrementalGRoute; friend class GRouteDbCbk; From 38fc8436a20cb35b4953f2b2ef1fad8b84f6d78d Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Mon, 15 Dec 2025 15:40:43 +0000 Subject: [PATCH 05/11] grt: unit test for the infinite_cap feature Signed-off-by: Jonas Gava --- src/grt/test/BUILD | 1 + src/grt/test/CMakeLists.txt | 1 + src/grt/test/infinite_cap.ok | 65 +++++++++++++++++++++++++++++++++++ src/grt/test/infinite_cap.tcl | 8 +++++ 4 files changed, 75 insertions(+) create mode 100644 src/grt/test/infinite_cap.ok create mode 100644 src/grt/test/infinite_cap.tcl diff --git a/src/grt/test/BUILD b/src/grt/test/BUILD index 2735c0e696e..7ce4bce1c0a 100644 --- a/src/grt/test/BUILD +++ b/src/grt/test/BUILD @@ -29,6 +29,7 @@ TESTS = [ "gcd_cugr", "gcd_flute", "increase_capacity1", + "infinite_cap", "inst_pin_out_of_die", "invalid_pin_placement", "invalid_routing_layer", diff --git a/src/grt/test/CMakeLists.txt b/src/grt/test/CMakeLists.txt index 744532acf61..b046b7aa11f 100644 --- a/src/grt/test/CMakeLists.txt +++ b/src/grt/test/CMakeLists.txt @@ -27,6 +27,7 @@ or_integration_tests( gcd_cugr gcd_flute increase_capacity1 + infinite_cap inst_pin_out_of_die invalid_pin_placement invalid_routing_layer diff --git a/src/grt/test/infinite_cap.ok b/src/grt/test/infinite_cap.ok new file mode 100644 index 00000000000..ac0694ed133 --- /dev/null +++ b/src/grt/test/infinite_cap.ok @@ -0,0 +1,65 @@ +[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells +[INFO ODB-0128] Design: gcd +[INFO ODB-0130] Created 54 pins. +[INFO ODB-0131] Created 676 components and 2850 component-terminals. +[INFO ODB-0133] Created 579 nets and 1498 connections. +[INFO GRT-0020] Min routing layer: metal2 +[INFO GRT-0021] Max routing layer: metal10 +[INFO GRT-0022] Global adjustment: 0% +[INFO GRT-0023] Grid origin: (0, 0) +[INFO GRT-0088] Layer metal1 Track-Pitch = 0.1400 line-2-Via Pitch: 0.1350 +[INFO GRT-0088] Layer metal2 Track-Pitch = 0.1900 line-2-Via Pitch: 0.1400 +[INFO GRT-0088] Layer metal3 Track-Pitch = 0.1400 line-2-Via Pitch: 0.1400 +[INFO GRT-0088] Layer metal4 Track-Pitch = 0.2800 line-2-Via Pitch: 0.2800 +[INFO GRT-0088] Layer metal5 Track-Pitch = 0.2800 line-2-Via Pitch: 0.2800 +[INFO GRT-0088] Layer metal6 Track-Pitch = 0.2800 line-2-Via Pitch: 0.2800 +[INFO GRT-0088] Layer metal7 Track-Pitch = 0.8000 line-2-Via Pitch: 0.8000 +[INFO GRT-0088] Layer metal8 Track-Pitch = 0.8000 line-2-Via Pitch: 0.8000 +[INFO GRT-0088] Layer metal9 Track-Pitch = 1.6000 line-2-Via Pitch: 1.6000 +[INFO GRT-0088] Layer metal10 Track-Pitch = 1.6000 line-2-Via Pitch: 1.6000 +[INFO GRT-0003] Macros: 0 +[INFO GRT-0004] Blockages: 0 +[INFO GRT-0019] Found 0 clock nets. +[INFO GRT-0001] Minimum degree: 2 +[INFO GRT-0002] Maximum degree: 36 + +[INFO GRT-0053] Routing resources analysis: + Routing Original Derated Resource +Layer Direction Resources Resources Reduction (%) +--------------------------------------------------------------- +metal1 Horizontal 1190000 1190000 0.00% +metal2 Vertical 1190000 1190000 0.00% +metal3 Horizontal 1190000 1190000 0.00% +metal4 Vertical 1190000 1190000 0.00% +metal5 Horizontal 1190000 1190000 0.00% +metal6 Vertical 1190000 1190000 0.00% +metal7 Horizontal 1190000 1190000 0.00% +metal8 Vertical 1190000 1190000 0.00% +metal9 Horizontal 1190000 1190000 0.00% +metal10 Vertical 1190000 1190000 0.00% +--------------------------------------------------------------- + +[INFO GRT-0197] Via related to pin nodes: 2686 +[INFO GRT-0198] Via related Steiner nodes: 44 +[INFO GRT-0199] Via filling finished. +[INFO GRT-0111] Final number of vias: 3505 +[INFO GRT-0112] Final usage 3D: 13039 + +[INFO GRT-0096] Final congestion report: +Layer Resource Demand Usage (%) Max H / Max V / Total Overflow +--------------------------------------------------------------------------------------- +metal1 1190000 0 0.00% 0 / 0 / 0 +metal2 1190000 1172 0.10% 0 / 0 / 0 +metal3 1190000 1212 0.10% 0 / 0 / 0 +metal4 1190000 41 0.00% 0 / 0 / 0 +metal5 1190000 51 0.00% 0 / 0 / 0 +metal6 1190000 48 0.00% 0 / 0 / 0 +metal7 1190000 0 0.00% 0 / 0 / 0 +metal8 1190000 0 0.00% 0 / 0 / 0 +metal9 1190000 0 0.00% 0 / 0 / 0 +metal10 1190000 0 0.00% 0 / 0 / 0 +--------------------------------------------------------------------------------------- +Total 11900000 2524 0.02% 0 / 0 / 0 + +[INFO GRT-0018] Total wirelength: 10767 um +[INFO GRT-0014] Routed nets: 563 diff --git a/src/grt/test/infinite_cap.tcl b/src/grt/test/infinite_cap.tcl new file mode 100644 index 00000000000..7d0483ef936 --- /dev/null +++ b/src/grt/test/infinite_cap.tcl @@ -0,0 +1,8 @@ +source "helpers.tcl" +read_lef "Nangate45/Nangate45.lef" +read_liberty Nangate45/Nangate45_typ.lib +read_def "gcd.def" + +set_routing_layers -signal metal2-metal10 + +global_route -infinite_cap -verbose From 90ad1a02ead5c92e7ce60a871a761af41fd67ed3 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Wed, 28 Jan 2026 18:01:51 +0000 Subject: [PATCH 06/11] grt: init variables properly Signed-off-by: Jonas Gava --- src/grt/include/grt/GlobalRouter.h | 4 ++-- src/grt/src/GlobalRouter.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/grt/include/grt/GlobalRouter.h b/src/grt/include/grt/GlobalRouter.h index 2faf1a81a95..1b13a908b2e 100644 --- a/src/grt/include/grt/GlobalRouter.h +++ b/src/grt/include/grt/GlobalRouter.h @@ -514,7 +514,7 @@ class GlobalRouter std::vector routing_tracks_; // Flow variables - bool infinite_capacity_ = false; + bool infinite_capacity_; float adjustment_; int congestion_iterations_{50}; int congestion_report_iter_step_; @@ -564,7 +564,7 @@ class GlobalRouter // incremental grt GRouteDbCbk* grouter_cbk_; - bool is_incremental_ = false; + bool is_incremental_; friend class IncrementalGRoute; friend class GRouteDbCbk; diff --git a/src/grt/src/GlobalRouter.cpp b/src/grt/src/GlobalRouter.cpp index 85333d29217..a0c00521b08 100644 --- a/src/grt/src/GlobalRouter.cpp +++ b/src/grt/src/GlobalRouter.cpp @@ -79,7 +79,7 @@ GlobalRouter::GlobalRouter(utl::Logger* logger, grid_origin_(0, 0), groute_renderer_(nullptr), grid_(new Grid), - is_incremental_(false), + infinite_capacity_(false), adjustment_(0.0), congestion_report_iter_step_(0), allow_congestion_(false), @@ -98,7 +98,8 @@ GlobalRouter::GlobalRouter(utl::Logger* logger, heatmap_(nullptr), heatmap_rudy_(nullptr), congestion_file_name_(nullptr), - grouter_cbk_(nullptr) + grouter_cbk_(nullptr), + is_incremental_(false) { fastroute_ = new FastRouteCore(db_, logger_, callback_handler_, stt_builder_, sta_); From 390fe8a2095a4990fd5595299b5b7161172b21d2 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Fri, 20 Feb 2026 17:00:38 +0000 Subject: [PATCH 07/11] grt: enhance infinite cap implementation Signed-off-by: Jonas Gava --- src/grt/src/GlobalRouter.cpp | 62 ++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/src/grt/src/GlobalRouter.cpp b/src/grt/src/GlobalRouter.cpp index 14ecdc5f1e5..83a9e10f3ce 100644 --- a/src/grt/src/GlobalRouter.cpp +++ b/src/grt/src/GlobalRouter.cpp @@ -735,8 +735,8 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) fastroute_->initEdges(); int x_grids = grid_->getXGrids(); int y_grids = grid_->getYGrids(); - const int BIG_INT = std::numeric_limits::max(); - const int16_t big_cap = 1000; + const int kBigInt = std::numeric_limits::max(); + const int16_t kBigCap = std::numeric_limits::max() / 10; for (int layer = 1; layer <= grid_->getNumLayers(); layer++) { odb::dbTechLayer* tech_layer = db_->getTech()->findRoutingLayer(layer); @@ -751,49 +751,43 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) = tech_layer->getDirection() == odb::dbTechLayerDir::HORIZONTAL; if (tech_layer->getDirection() == odb::dbTechLayerDir::HORIZONTAL) { - int min_cap = BIG_INT; + int min_cap = kBigInt; for (int y = 1; y <= y_grids; y++) { for (int x = 1; x < x_grids; x++) { - const int cap = inside_layer_range ? computeGCellCapacity(x - 1, - y - 1, - track_init, - track_pitch, - track_count, - horizontal) - : 0; + const int cap = infinite_capacity_ ? kBigCap + : inside_layer_range + ? computeGCellCapacity(x - 1, + y - 1, + track_init, + track_pitch, + track_count, + horizontal) + : 0; min_cap = std::min(min_cap, cap); - fastroute_->setEdgeCapacity(x - 1, - y - 1, - x, - y - 1, - layer, - infinite_capacity_ ? big_cap : cap); + fastroute_->setEdgeCapacity(x - 1, y - 1, x, y - 1, layer, cap); } } - min_cap = min_cap == BIG_INT ? 0 : min_cap; - fastroute_->addHCapacity(infinite_capacity_ ? big_cap : min_cap, layer); + min_cap = min_cap == kBigInt ? 0 : min_cap; + fastroute_->addHCapacity(min_cap, layer); } else { - int min_cap = BIG_INT; + int min_cap = kBigInt; for (int x = 1; x <= x_grids; x++) { for (int y = 1; y < y_grids; y++) { - const int cap = inside_layer_range ? computeGCellCapacity(x - 1, - y - 1, - track_init, - track_pitch, - track_count, - horizontal) - : 0; + const int cap = infinite_capacity_ ? kBigCap + : inside_layer_range + ? computeGCellCapacity(x - 1, + y - 1, + track_init, + track_pitch, + track_count, + horizontal) + : 0; min_cap = std::min(min_cap, cap); - fastroute_->setEdgeCapacity(x - 1, - y - 1, - x - 1, - y, - layer, - infinite_capacity_ ? big_cap : cap); + fastroute_->setEdgeCapacity(x - 1, y - 1, x - 1, y, layer, cap); } } - min_cap = min_cap == BIG_INT ? 0 : min_cap; - fastroute_->addVCapacity(infinite_capacity_ ? big_cap : min_cap, layer); + min_cap = min_cap == kBigInt ? 0 : min_cap; + fastroute_->addVCapacity(min_cap, layer); } } fastroute_->initLowerBoundCapacities(); From 6cab8a418131b1e41b5bc3e6292c7f9556b72dc4 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Fri, 20 Feb 2026 17:44:07 +0000 Subject: [PATCH 08/11] grt: update infinite cap test Signed-off-by: Jonas Gava --- src/grt/test/infinite_cap.ok | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/grt/test/infinite_cap.ok b/src/grt/test/infinite_cap.ok index ac0694ed133..82f0acb151f 100644 --- a/src/grt/test/infinite_cap.ok +++ b/src/grt/test/infinite_cap.ok @@ -27,16 +27,16 @@ Routing Original Derated Resource Layer Direction Resources Resources Reduction (%) --------------------------------------------------------------- -metal1 Horizontal 1190000 1190000 0.00% -metal2 Vertical 1190000 1190000 0.00% -metal3 Horizontal 1190000 1190000 0.00% -metal4 Vertical 1190000 1190000 0.00% -metal5 Horizontal 1190000 1190000 0.00% -metal6 Vertical 1190000 1190000 0.00% -metal7 Horizontal 1190000 1190000 0.00% -metal8 Vertical 1190000 1190000 0.00% -metal9 Horizontal 1190000 1190000 0.00% -metal10 Vertical 1190000 1190000 0.00% +metal1 Horizontal 3898440 3898440 0.00% +metal2 Vertical 3898440 3898440 0.00% +metal3 Horizontal 3898440 3898440 0.00% +metal4 Vertical 3898440 3898440 0.00% +metal5 Horizontal 3898440 3898440 0.00% +metal6 Vertical 3898440 3898440 0.00% +metal7 Horizontal 3898440 3898440 0.00% +metal8 Vertical 3898440 3898440 0.00% +metal9 Horizontal 3898440 3898440 0.00% +metal10 Vertical 3898440 3898440 0.00% --------------------------------------------------------------- [INFO GRT-0197] Via related to pin nodes: 2686 @@ -48,18 +48,18 @@ metal10 Vertical 1190000 1190000 0.00% [INFO GRT-0096] Final congestion report: Layer Resource Demand Usage (%) Max H / Max V / Total Overflow --------------------------------------------------------------------------------------- -metal1 1190000 0 0.00% 0 / 0 / 0 -metal2 1190000 1172 0.10% 0 / 0 / 0 -metal3 1190000 1212 0.10% 0 / 0 / 0 -metal4 1190000 41 0.00% 0 / 0 / 0 -metal5 1190000 51 0.00% 0 / 0 / 0 -metal6 1190000 48 0.00% 0 / 0 / 0 -metal7 1190000 0 0.00% 0 / 0 / 0 -metal8 1190000 0 0.00% 0 / 0 / 0 -metal9 1190000 0 0.00% 0 / 0 / 0 -metal10 1190000 0 0.00% 0 / 0 / 0 +metal1 3898440 0 0.00% 0 / 0 / 0 +metal2 3898440 1172 0.03% 0 / 0 / 0 +metal3 3898440 1212 0.03% 0 / 0 / 0 +metal4 3898440 41 0.00% 0 / 0 / 0 +metal5 3898440 51 0.00% 0 / 0 / 0 +metal6 3898440 48 0.00% 0 / 0 / 0 +metal7 3898440 0 0.00% 0 / 0 / 0 +metal8 3898440 0 0.00% 0 / 0 / 0 +metal9 3898440 0 0.00% 0 / 0 / 0 +metal10 3898440 0 0.00% 0 / 0 / 0 --------------------------------------------------------------------------------------- -Total 11900000 2524 0.02% 0 / 0 / 0 +Total 38984400 2524 0.01% 0 / 0 / 0 [INFO GRT-0018] Total wirelength: 10767 um [INFO GRT-0014] Routed nets: 563 From ed38e8cf5aa57b7932572722d241d59207bc19c4 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Fri, 20 Feb 2026 19:41:53 +0000 Subject: [PATCH 09/11] grt: fix nested conditional operators Signed-off-by: Jonas Gava --- src/grt/src/GlobalRouter.cpp | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/grt/src/GlobalRouter.cpp b/src/grt/src/GlobalRouter.cpp index 83a9e10f3ce..69005ec2d26 100644 --- a/src/grt/src/GlobalRouter.cpp +++ b/src/grt/src/GlobalRouter.cpp @@ -754,15 +754,13 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) int min_cap = kBigInt; for (int y = 1; y <= y_grids; y++) { for (int x = 1; x < x_grids; x++) { - const int cap = infinite_capacity_ ? kBigCap - : inside_layer_range - ? computeGCellCapacity(x - 1, - y - 1, - track_init, - track_pitch, - track_count, - horizontal) - : 0; + int cap = 0; + if (infinite_capacity_) { + cap = kBigCap; + } else if (inside_layer_range) { + cap = computeGCellCapacity( + x - 1, y - 1, track_init, track_pitch, track_count, horizontal); + } min_cap = std::min(min_cap, cap); fastroute_->setEdgeCapacity(x - 1, y - 1, x, y - 1, layer, cap); } @@ -773,15 +771,13 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) int min_cap = kBigInt; for (int x = 1; x <= x_grids; x++) { for (int y = 1; y < y_grids; y++) { - const int cap = infinite_capacity_ ? kBigCap - : inside_layer_range - ? computeGCellCapacity(x - 1, - y - 1, - track_init, - track_pitch, - track_count, - horizontal) - : 0; + int cap = 0; + if (infinite_capacity_) { + cap = kBigCap; + } else if (inside_layer_range) { + computeGCellCapacity( + x - 1, y - 1, track_init, track_pitch, track_count, horizontal); + } min_cap = std::min(min_cap, cap); fastroute_->setEdgeCapacity(x - 1, y - 1, x - 1, y, layer, cap); } From 31b8d3173f17966ab62f2532a74a66c7a680aa02 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Fri, 20 Feb 2026 21:09:04 +0000 Subject: [PATCH 10/11] grt: fix missing variable assignment Signed-off-by: Jonas Gava --- src/grt/src/GlobalRouter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grt/src/GlobalRouter.cpp b/src/grt/src/GlobalRouter.cpp index 69005ec2d26..5d283ecc607 100644 --- a/src/grt/src/GlobalRouter.cpp +++ b/src/grt/src/GlobalRouter.cpp @@ -775,7 +775,7 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer) if (infinite_capacity_) { cap = kBigCap; } else if (inside_layer_range) { - computeGCellCapacity( + cap = computeGCellCapacity( x - 1, y - 1, track_init, track_pitch, track_count, horizontal); } min_cap = std::min(min_cap, cap); From ac08e0ddc28c7727e198fafe6a77095f5778c0a3 Mon Sep 17 00:00:00 2001 From: Jonas Gava Date: Mon, 23 Feb 2026 21:35:52 +0000 Subject: [PATCH 11/11] grt: add infinite_cap note in README Signed-off-by: Jonas Gava --- src/grt/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/grt/README.md b/src/grt/README.md index d529ff4fbf2..5a45735f0da 100644 --- a/src/grt/README.md +++ b/src/grt/README.md @@ -31,6 +31,7 @@ global_route [-end_incremental] [-use_cugr] [-resistance_aware] + [-infinite_cap] ``` #### Options @@ -50,7 +51,7 @@ global_route | `-end_incremental` | This flag run incremental GRT with the nets modified. The default is false. | | `-use_cugr` | This flag run GRT using CUGR as the router solver. NOTE: this is not ready for production. | | `-resistance_aware` | This flag enables resistance-aware layer assignment and 3D routing. NOTE: this is not ready for production. | -| `-infinite_cap` | Enables "infinite" gcell capacity for testing purpose. | +| `-infinite_cap` | Enables "infinite" gcell capacity for testing purpose. NOTE: this is not recommended for production flows. | ### Set Routing Layers