Skip to content

Commit 74e967e

Browse files
authored
Merge pull request #10748 from The-OpenROAD-Project-staging/grt-res-aware-percentage
GRT: resistance-aware nets percentage TCL parameter
2 parents 59b6cd7 + d36ee63 commit 74e967e

13 files changed

Lines changed: 4603 additions & 3 deletions

src/grt/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ global_route
3232
[-end_incremental]
3333
[-use_cugr]
3434
[-resistance_aware]
35+
[-res_aware_nets_percentage percent]
3536
[-infinite_cap]
3637
```
3738

@@ -52,6 +53,7 @@ global_route
5253
| `-end_incremental` | This flag run incremental GRT with the nets modified. The default is false. |
5354
| `-use_cugr` | This flag run GRT using CUGR as the router solver. NOTE: this is not ready for production. |
5455
| `-resistance_aware` | This flag enables resistance-aware layer assignment and 3D routing. NOTE: this is not ready for production. |
56+
| `-res_aware_nets_percentage` | Set the percentage of resistance-aware nets (e.g. `-res_aware_nets_percentage 100` (for 100%)). The default value is `15` with resistance-aware enabled and `0` otherwise, and the allowed values are floats between `[0, 100]`. |
5557
| `-infinite_cap` | Enables "infinite" gcell capacity for testing purpose. NOTE: this is not recommended for production flows. |
5658
| `-snapshot_batched_width` | Set the semantic width of snapshot-batched routing (max batches per wave). The default is `0`, preserving the non-batched behavior. Set a positive integer to enable batched routing; allowed values are integers `[1, MAX_INT]`. Execution width still follows `set_thread_count`. NOTE: this is not recommended for production flows; it is intended for exploration and research projects. |
5759

src/grt/include/grt/GlobalRouter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class GlobalRouter
154154
void setGridOrigin(int x, int y);
155155
void setAllowCongestion(bool allow_congestion);
156156
void setResistanceAware(bool resistance_aware);
157+
void setResAwareNetsPercentage(float percentage);
157158
void setSnapshotBatchedWidth(int snapshot_batched_width);
158159
int getSnapshotBatchedWidth() const;
159160
int getSnapshotBatchCount() const;

src/grt/src/GlobalRouter.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,23 @@ void GlobalRouter::setResistanceAware(bool resistance_aware)
24312431
fastroute_->setResistanceAware(resistance_aware);
24322432
}
24332433

2434+
void GlobalRouter::setResAwareNetsPercentage(float percentage)
2435+
{
2436+
if (!resistance_aware_) {
2437+
percentage = 0;
2438+
logger_->warn(GRT,
2439+
308,
2440+
"Resistance-aware routing is not enabled, setting res-aware "
2441+
"nets percentage to 0.");
2442+
}
2443+
if (use_cugr_) {
2444+
// TODO
2445+
// cugr_->setResAwareNetsPercentage(percentage);
2446+
} else {
2447+
fastroute_->setResAwareNetsPercentage(percentage);
2448+
}
2449+
}
2450+
24342451
void GlobalRouter::setMacroExtension(int macro_extension)
24352452
{
24362453
macro_extension_ = macro_extension;

src/grt/src/GlobalRouter.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ set_resistance_aware(bool resistance_aware)
110110
getGlobalRouter()->setResistanceAware(resistance_aware);
111111
}
112112

113+
void
114+
set_res_aware_nets_percentage(float percentage)
115+
{
116+
getGlobalRouter()->setResAwareNetsPercentage(percentage);
117+
}
118+
113119
void
114120
set_snapshot_batched_width(int snapshot_batched_width)
115121
{

src/grt/src/GlobalRouter.tcl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ sta::define_cmd_args "global_route" {[-guide_file out_file] \
146146
[-congestion_report_iter_step steps] \
147147
[-grid_origin origin] \
148148
[-critical_nets_percentage percent] \
149+
[-res_aware_nets_percentage percent] \
149150
[-skip_large_fanout_nets fanout] \
150151
[-allow_congestion] \
151152
[-snapshot_batched_width width] \
@@ -160,7 +161,8 @@ sta::define_cmd_args "global_route" {[-guide_file out_file] \
160161
proc global_route { args } {
161162
sta::parse_key_args "global_route" args \
162163
keys {-guide_file -congestion_iterations -congestion_report_file \
163-
-grid_origin -critical_nets_percentage -congestion_report_iter_step \
164+
-grid_origin -critical_nets_percentage -res_aware_nets_percentage \
165+
-congestion_report_iter_step \
164166
-skip_large_fanout_nets -snapshot_batched_width
165167
} \
166168
flags {-allow_congestion -resistance_aware -infinite_cap -verbose -start_incremental \
@@ -243,6 +245,12 @@ proc global_route { args } {
243245
set resistance_aware [info exists flags(-resistance_aware)]
244246
grt::set_resistance_aware $resistance_aware
245247

248+
if { [info exists keys(-res_aware_nets_percentage)] } {
249+
set res_aware_percentage $keys(-res_aware_nets_percentage)
250+
sta::check_percent "-res_aware_nets_percentage" $res_aware_percentage
251+
grt::set_res_aware_nets_percentage $res_aware_percentage
252+
}
253+
246254
if { [info exists keys(-snapshot_batched_width)] } {
247255
set snapshot_batched_width $keys(-snapshot_batched_width)
248256
sta::check_positive_integer "-snapshot_batched_width" \

src/grt/src/fastroute/include/FastRoute.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ class FastRouteCore
242242
void setVerbose(bool v);
243243
void setCriticalNetsPercentage(float u);
244244
float getCriticalNetsPercentage() { return critical_nets_percentage_; };
245+
void setResAwareNetsPercentage(float percentage);
246+
float getResAwareNetsPercentage() { return res_aware_nets_percentage_; };
245247
void setOverflowIterations(int iterations);
246248
void setCongestionReportIterStep(int congestion_report_iter_step);
247249
void setCongestionReportFile(const char* congestion_file_name);
@@ -329,7 +331,7 @@ class FastRouteCore
329331
double dbuToMicrons(int dbu);
330332
odb::Rect globalRoutingToBox(const GSegment& route);
331333
NetRouteMap getRoutes();
332-
void updateSlacks(float percentage = 0.15);
334+
void updateSlacks();
333335
void preProcessTechLayers();
334336
odb::dbTechLayer* getTechLayer(int layer, bool is_via);
335337

@@ -778,6 +780,7 @@ class FastRouteCore
778780
int grid_hv_;
779781
bool verbose_;
780782
float critical_nets_percentage_;
783+
float res_aware_nets_percentage_ = 15;
781784
int via_cost_;
782785
int mazeedge_threshold_;
783786
float v_capacity_lb_;

src/grt/src/fastroute/src/FastRoute.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,6 +2776,11 @@ void FastRouteCore::setCriticalNetsPercentage(float u)
27762776
critical_nets_percentage_ = u;
27772777
}
27782778

2779+
void FastRouteCore::setResAwareNetsPercentage(float percentage)
2780+
{
2781+
res_aware_nets_percentage_ = percentage;
2782+
}
2783+
27792784
void FastRouteCore::setOverflowIterations(int iterations)
27802785
{
27812786
overflow_iterations_ = iterations;

src/grt/src/fastroute/src/utility.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ void FastRouteCore::setIncrementalGrt(bool is_incremental)
671671

672672
// Update and sort the critical nets. Finally pick a percentage of the
673673
// nets to use the resistance-aware strategy
674-
void FastRouteCore::updateSlacks(float percentage)
674+
void FastRouteCore::updateSlacks()
675675
{
676676
// Check if liberty file was loaded before calculating slack
677677
if (sta_->getDbNetwork()->defaultLibertyLibrary() == nullptr
@@ -737,6 +737,8 @@ void FastRouteCore::updateSlacks(float percentage)
737737

738738
std::ranges::stable_sort(res_aware_list, compareSlack);
739739

740+
float percentage = res_aware_nets_percentage_ / 100.0;
741+
740742
// During incremental grt, enable res-aware for all nets in the list
741743
if (is_incremental_grt_) {
742744
percentage = 1;

src/grt/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ TESTS = [
9696
"report_wire_length6",
9797
"report_wire_length7",
9898
"report_wire_length8",
99+
"res_aware_nets_percentage",
99100
"set_nets_to_route1",
100101
"silence",
101102
"single_row",

src/grt/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ or_integration_tests(
9393
report_wire_length6
9494
report_wire_length7
9595
report_wire_length8
96+
res_aware_nets_percentage
9697
set_nets_to_route1
9798
silence
9899
single_row

0 commit comments

Comments
 (0)