Skip to content

Commit 0aa5e62

Browse files
authored
Merge pull request The-OpenROAD-Project#9500 from The-OpenROAD-Project-staging/grt-infinite-resources
grt: infinite resources for testing purpose
2 parents 446934a + bd2eea0 commit 0aa5e62

File tree

9 files changed

+122
-24
lines changed

9 files changed

+122
-24
lines changed

src/grt/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ global_route
3131
[-end_incremental]
3232
[-use_cugr]
3333
[-resistance_aware]
34+
[-infinite_cap]
3435
```
3536

3637
#### Options
@@ -50,6 +51,7 @@ global_route
5051
| `-end_incremental` | This flag run incremental GRT with the nets modified. The default is false. |
5152
| `-use_cugr` | This flag run GRT using CUGR as the router solver. NOTE: this is not ready for production. |
5253
| `-resistance_aware` | This flag enables resistance-aware layer assignment and 3D routing. NOTE: this is not ready for production. |
54+
| `-infinite_cap` | Enables "infinite" gcell capacity for testing purpose. NOTE: this is not recommended for production flows. |
5355

5456
### Set Routing Layers
5557

src/grt/include/grt/GlobalRouter.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ class GlobalRouter
160160
skip_large_fanout_ = skip_large_fanout;
161161
};
162162

163+
void setInfiniteCapacity(bool infinite_capacity);
164+
163165
// flow functions
164166
void readGuides(const char* file_name);
165167
void loadGuidesFromDB();
@@ -513,7 +515,7 @@ class GlobalRouter
513515
std::vector<RoutingTracks> routing_tracks_;
514516

515517
// Flow variables
516-
bool is_incremental_;
518+
bool infinite_capacity_;
517519
float adjustment_;
518520
int congestion_iterations_{50};
519521
int congestion_report_iter_step_;
@@ -563,6 +565,7 @@ class GlobalRouter
563565

564566
// incremental grt
565567
GRouteDbCbk* grouter_cbk_;
568+
bool is_incremental_;
566569

567570
friend class IncrementalGRoute;
568571
friend class GRouteDbCbk;

src/grt/src/GlobalRouter.cpp

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ GlobalRouter::GlobalRouter(utl::Logger* logger,
8282
grid_origin_(0, 0),
8383
groute_renderer_(nullptr),
8484
grid_(new Grid),
85-
is_incremental_(false),
85+
infinite_capacity_(false),
8686
adjustment_(0.0),
8787
congestion_report_iter_step_(0),
8888
allow_congestion_(false),
@@ -101,7 +101,8 @@ GlobalRouter::GlobalRouter(utl::Logger* logger,
101101
heatmap_(nullptr),
102102
heatmap_rudy_(nullptr),
103103
congestion_file_name_(nullptr),
104-
grouter_cbk_(nullptr)
104+
grouter_cbk_(nullptr),
105+
is_incremental_(false)
105106
{
106107
fastroute_
107108
= new FastRouteCore(db_, logger_, callback_handler_, stt_builder_, sta_);
@@ -734,6 +735,8 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer)
734735
fastroute_->initEdges();
735736
int x_grids = grid_->getXGrids();
736737
int y_grids = grid_->getYGrids();
738+
const int kBigInt = std::numeric_limits<int>::max();
739+
const int16_t kBigCap = std::numeric_limits<int16_t>::max() / 10;
737740

738741
for (int layer = 1; layer <= grid_->getNumLayers(); layer++) {
739742
odb::dbTechLayer* tech_layer = db_->getTech()->findRoutingLayer(layer);
@@ -748,44 +751,49 @@ void GlobalRouter::setCapacities(int min_routing_layer, int max_routing_layer)
748751
= tech_layer->getDirection() == odb::dbTechLayerDir::HORIZONTAL;
749752

750753
if (tech_layer->getDirection() == odb::dbTechLayerDir::HORIZONTAL) {
751-
int min_cap = std::numeric_limits<int>::max();
754+
int min_cap = kBigInt;
752755
for (int y = 1; y <= y_grids; y++) {
753756
for (int x = 1; x < x_grids; x++) {
754-
const int cap = inside_layer_range ? computeGCellCapacity(x - 1,
755-
y - 1,
756-
track_init,
757-
track_pitch,
758-
track_count,
759-
horizontal)
760-
: 0;
757+
int cap = 0;
758+
if (infinite_capacity_) {
759+
cap = kBigCap;
760+
} else if (inside_layer_range) {
761+
cap = computeGCellCapacity(
762+
x - 1, y - 1, track_init, track_pitch, track_count, horizontal);
763+
}
761764
min_cap = std::min(min_cap, cap);
762765
fastroute_->setEdgeCapacity(x - 1, y - 1, x, y - 1, layer, cap);
763766
}
764767
}
765-
min_cap = min_cap == std::numeric_limits<int>::max() ? 0 : min_cap;
768+
min_cap = min_cap == kBigInt ? 0 : min_cap;
766769
fastroute_->addHCapacity(min_cap, layer);
767770
} else {
768-
int min_cap = std::numeric_limits<int>::max();
771+
int min_cap = kBigInt;
769772
for (int x = 1; x <= x_grids; x++) {
770773
for (int y = 1; y < y_grids; y++) {
771-
const int cap = inside_layer_range ? computeGCellCapacity(x - 1,
772-
y - 1,
773-
track_init,
774-
track_pitch,
775-
track_count,
776-
horizontal)
777-
: 0;
774+
int cap = 0;
775+
if (infinite_capacity_) {
776+
cap = kBigCap;
777+
} else if (inside_layer_range) {
778+
cap = computeGCellCapacity(
779+
x - 1, y - 1, track_init, track_pitch, track_count, horizontal);
780+
}
778781
min_cap = std::min(min_cap, cap);
779782
fastroute_->setEdgeCapacity(x - 1, y - 1, x - 1, y, layer, cap);
780783
}
781784
}
782-
min_cap = min_cap == std::numeric_limits<int>::max() ? 0 : min_cap;
785+
min_cap = min_cap == kBigInt ? 0 : min_cap;
783786
fastroute_->addVCapacity(min_cap, layer);
784787
}
785788
}
786789
fastroute_->initLowerBoundCapacities();
787790
}
788791

792+
void GlobalRouter::setInfiniteCapacity(bool infinite_capacity)
793+
{
794+
infinite_capacity_ = infinite_capacity;
795+
}
796+
789797
int GlobalRouter::computeGCellCapacity(const int x,
790798
const int y,
791799
const int track_init,

src/grt/src/GlobalRouter.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ set_skip_large_fanout(int skip_large_fanout)
152152
getGlobalRouter()->setSkipLargeFanoutNets(skip_large_fanout);
153153
}
154154

155+
void
156+
set_infinite_cap(bool infinite_capacity)
157+
{
158+
getGlobalRouter()->setInfiniteCapacity(infinite_capacity);
159+
}
160+
155161
void start_incremental()
156162
{
157163
getGlobalRouter()->startIncremental();

src/grt/src/GlobalRouter.tcl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ sta::define_cmd_args "global_route" {[-guide_file out_file] \
152152
[-start_incremental] \
153153
[-end_incremental] \
154154
[-use_cugr] \
155-
[-resistance_aware]
155+
[-resistance_aware] \
156+
[-infinite_cap]
156157
}
157158

158159
proc global_route { args } {
@@ -161,8 +162,8 @@ proc global_route { args } {
161162
-grid_origin -critical_nets_percentage -congestion_report_iter_step\
162163
-skip_large_fanout_nets
163164
} \
164-
flags {-allow_congestion -resistance_aware -verbose -start_incremental -end_incremental \
165-
-use_cugr}
165+
flags {-allow_congestion -resistance_aware -infinite_cap -verbose -start_incremental \
166+
-end_incremental -use_cugr}
166167

167168
sta::check_argc_eq0 "global_route" $args
168169

@@ -228,6 +229,9 @@ proc global_route { args } {
228229
set resistance_aware [info exists flags(-resistance_aware)]
229230
grt::set_resistance_aware $resistance_aware
230231

232+
set infinite_cap [info exists flags(-infinite_cap)]
233+
grt::set_infinite_cap $infinite_cap
234+
231235
set start_incremental [info exists flags(-start_incremental)]
232236
set end_incremental [info exists flags(-end_incremental)]
233237

src/grt/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ TESTS = [
3232
"gcd_cugr",
3333
"gcd_flute",
3434
"increase_capacity1",
35+
"infinite_cap",
3536
"inst_pin_out_of_die",
3637
"invalid_pin_placement",
3738
"invalid_routing_layer",

src/grt/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ or_integration_tests(
3030
gcd_cugr
3131
gcd_flute
3232
increase_capacity1
33+
infinite_cap
3334
inst_pin_out_of_die
3435
invalid_pin_placement
3536
invalid_routing_layer

src/grt/test/infinite_cap.ok

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: gcd
3+
[INFO ODB-0130] Created 54 pins.
4+
[INFO ODB-0131] Created 676 components and 2850 component-terminals.
5+
[INFO ODB-0133] Created 579 nets and 1498 connections.
6+
[INFO GRT-0020] Min routing layer: metal2
7+
[INFO GRT-0021] Max routing layer: metal10
8+
[INFO GRT-0022] Global adjustment: 0%
9+
[INFO GRT-0023] Grid origin: (0, 0)
10+
[INFO GRT-0088] Layer metal1 Track-Pitch = 0.1400 line-2-Via Pitch: 0.1350
11+
[INFO GRT-0088] Layer metal2 Track-Pitch = 0.1900 line-2-Via Pitch: 0.1400
12+
[INFO GRT-0088] Layer metal3 Track-Pitch = 0.1400 line-2-Via Pitch: 0.1400
13+
[INFO GRT-0088] Layer metal4 Track-Pitch = 0.2800 line-2-Via Pitch: 0.2800
14+
[INFO GRT-0088] Layer metal5 Track-Pitch = 0.2800 line-2-Via Pitch: 0.2800
15+
[INFO GRT-0088] Layer metal6 Track-Pitch = 0.2800 line-2-Via Pitch: 0.2800
16+
[INFO GRT-0088] Layer metal7 Track-Pitch = 0.8000 line-2-Via Pitch: 0.8000
17+
[INFO GRT-0088] Layer metal8 Track-Pitch = 0.8000 line-2-Via Pitch: 0.8000
18+
[INFO GRT-0088] Layer metal9 Track-Pitch = 1.6000 line-2-Via Pitch: 1.6000
19+
[INFO GRT-0088] Layer metal10 Track-Pitch = 1.6000 line-2-Via Pitch: 1.6000
20+
[INFO GRT-0003] Macros: 0
21+
[INFO GRT-0004] Blockages: 0
22+
[INFO GRT-0019] Found 0 clock nets.
23+
[INFO GRT-0001] Minimum degree: 2
24+
[INFO GRT-0002] Maximum degree: 36
25+
26+
[INFO GRT-0053] Routing resources analysis:
27+
Routing Original Derated Resource
28+
Layer Direction Resources Resources Reduction (%)
29+
---------------------------------------------------------------
30+
metal1 Horizontal 3898440 3898440 0.00%
31+
metal2 Vertical 3898440 3898440 0.00%
32+
metal3 Horizontal 3898440 3898440 0.00%
33+
metal4 Vertical 3898440 3898440 0.00%
34+
metal5 Horizontal 3898440 3898440 0.00%
35+
metal6 Vertical 3898440 3898440 0.00%
36+
metal7 Horizontal 3898440 3898440 0.00%
37+
metal8 Vertical 3898440 3898440 0.00%
38+
metal9 Horizontal 3898440 3898440 0.00%
39+
metal10 Vertical 3898440 3898440 0.00%
40+
---------------------------------------------------------------
41+
42+
[INFO GRT-0197] Via related to pin nodes: 2686
43+
[INFO GRT-0198] Via related Steiner nodes: 44
44+
[INFO GRT-0199] Via filling finished.
45+
[INFO GRT-0111] Final number of vias: 3505
46+
[INFO GRT-0112] Final usage 3D: 13039
47+
48+
[INFO GRT-0096] Final congestion report:
49+
Layer Resource Demand Usage (%) Max H / Max V / Total Overflow
50+
---------------------------------------------------------------------------------------
51+
metal1 3898440 0 0.00% 0 / 0 / 0
52+
metal2 3898440 1172 0.03% 0 / 0 / 0
53+
metal3 3898440 1212 0.03% 0 / 0 / 0
54+
metal4 3898440 41 0.00% 0 / 0 / 0
55+
metal5 3898440 51 0.00% 0 / 0 / 0
56+
metal6 3898440 48 0.00% 0 / 0 / 0
57+
metal7 3898440 0 0.00% 0 / 0 / 0
58+
metal8 3898440 0 0.00% 0 / 0 / 0
59+
metal9 3898440 0 0.00% 0 / 0 / 0
60+
metal10 3898440 0 0.00% 0 / 0 / 0
61+
---------------------------------------------------------------------------------------
62+
Total 38984400 2524 0.01% 0 / 0 / 0
63+
64+
[INFO GRT-0018] Total wirelength: 10767 um
65+
[INFO GRT-0014] Routed nets: 563

src/grt/test/infinite_cap.tcl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "helpers.tcl"
2+
read_lef "Nangate45/Nangate45.lef"
3+
read_liberty Nangate45/Nangate45_typ.lib
4+
read_def "gcd.def"
5+
6+
set_routing_layers -signal metal2-metal10
7+
8+
global_route -infinite_cap -verbose

0 commit comments

Comments
 (0)