Skip to content

Commit a43c6df

Browse files
authored
Merge pull request #8822 from eder-matheus/grt_skip_large_fanout_nets
grt: add option to skip large fanout nets
2 parents 0785636 + c9eba38 commit a43c6df

File tree

10 files changed

+5330
-1
lines changed

10 files changed

+5330
-1
lines changed

src/grt/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ global_route
2424
[-congestion_report_iter_step steps]
2525
[-grid_origin {x y}]
2626
[-critical_nets_percentage percent]
27+
[-skip_large_fanout_nets fanout]
2728
[-allow_congestion]
2829
[-verbose]
2930
[-start_incremental]
@@ -42,6 +43,7 @@ global_route
4243
| `-congestion_report_iter_step` | Set the number of iterations to report. The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
4344
| `-grid_origin` | Set the (x, y) origin of the routing grid in DBU. For example, `-grid_origin {1 1}` corresponds to the die (0, 0) + 1 DBU in each x--, y- direction. |
4445
| `-critical_nets_percentage` | Set the percentage of nets with the worst slack value that are considered timing critical, having preference over other nets during congestion iterations (e.g. `-critical_nets_percentage 30`). The default value is `0`, and the allowed values are integers `[0, MAX_INT]`. |
46+
| `-skip_large_fanout_nets` | Skips routing for nets with a fanout higher than the specified limit. Nets above this pin count threshold are ignored by the global router and will not have routing guides, meaning they will also be skipped during detailed routing. This option is useful in debugging or estimation flows where high-fanout nets (such as pre-CTS clock nets) can be ignored. The default value is 0, indicating no fanout limit. The default value is `MAX_INT`. The allowed values are integers `[0, MAX_INT]`. |
4547
| `-allow_congestion` | Allow global routing results to be generated with remaining congestion. The default is false. |
4648
| `-verbose` | This flag enables the full reporting of the global routing. |
4749
| `-start_incremental` | This flag initializes the GRT listener to get the net modified. The default is false. |

src/grt/include/grt/GlobalRouter.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <cstdint>
77
#include <fstream>
8+
#include <limits>
89
#include <map>
910
#include <memory>
1011
#include <set>
@@ -154,6 +155,10 @@ class GlobalRouter
154155
void setResistanceAware(bool resistance_aware);
155156
void setMacroExtension(int macro_extension);
156157
void setUseCUGR(bool use_cugr) { use_cugr_ = use_cugr; };
158+
void setSkipLargeFanoutNets(int skip_large_fanout)
159+
{
160+
skip_large_fanout_ = skip_large_fanout;
161+
};
157162

158163
// flow functions
159164
void readGuides(const char* file_name);
@@ -495,6 +500,7 @@ class GlobalRouter
495500
int total_diodes_count_;
496501
bool is_congested_{false};
497502
bool use_cugr_{false};
503+
int skip_large_fanout_{std::numeric_limits<int>::max()};
498504

499505
// Region adjustment variables
500506
std::vector<RegionAdjustment> region_adjustments_;

src/grt/src/GlobalRouter.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3743,7 +3743,28 @@ std::vector<Net*> GlobalRouter::findNets(bool init_clock_nets)
37433743
db_nets = nets_to_route_;
37443744
}
37453745
std::vector<Net*> clk_nets;
3746+
const int large_fanout_threshold = 1000;
37463747
for (odb::dbNet* db_net : db_nets) {
3748+
const bool is_special
3749+
= db_net->getSigType().isSupply() && db_net->isSpecial();
3750+
if (!is_special && db_net->getTermCount() > skip_large_fanout_) {
3751+
logger_->info(GRT,
3752+
280,
3753+
"Skipping net {} with {} terminals.",
3754+
db_net->getConstName(),
3755+
db_net->getTermCount(),
3756+
skip_large_fanout_);
3757+
continue;
3758+
}
3759+
3760+
if (!is_special && db_net->getTermCount() > large_fanout_threshold) {
3761+
logger_->warn(GRT,
3762+
281,
3763+
"Net {} has a large fanout of {} terminals.",
3764+
db_net->getConstName(),
3765+
db_net->getTermCount());
3766+
}
3767+
37473768
Net* net = addNet(db_net);
37483769
// add clock nets not connected to a leaf first
37493770
if (net) {

src/grt/src/GlobalRouter.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ set_use_cugr(bool use_cugr)
146146
getGlobalRouter()->setUseCUGR(use_cugr);
147147
}
148148

149+
void
150+
set_skip_large_fanout(int skip_large_fanout)
151+
{
152+
getGlobalRouter()->setSkipLargeFanoutNets(skip_large_fanout);
153+
}
154+
149155
void
150156
global_route(bool start_incremental, bool end_incremental)
151157
{

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+
[-skip_large_fanout_nets fanout] \
149150
[-allow_congestion] \
150151
[-verbose] \
151152
[-start_incremental] \
@@ -157,7 +158,8 @@ sta::define_cmd_args "global_route" {[-guide_file out_file] \
157158
proc global_route { args } {
158159
sta::parse_key_args "global_route" args \
159160
keys {-guide_file -congestion_iterations -congestion_report_file \
160-
-grid_origin -critical_nets_percentage -congestion_report_iter_step
161+
-grid_origin -critical_nets_percentage -congestion_report_iter_step\
162+
-skip_large_fanout_nets
161163
} \
162164
flags {-allow_congestion -resistance_aware -verbose -start_incremental -end_incremental \
163165
-use_cugr}
@@ -214,6 +216,12 @@ proc global_route { args } {
214216

215217
grt::set_use_cugr [info exists flags(-use_cugr)]
216218

219+
if { [info exists keys(-skip_large_fanout_nets)] } {
220+
set fanout $keys(-skip_large_fanout_nets)
221+
sta::check_positive_integer "-skip_large_fanout_nets" $fanout
222+
grt::set_skip_large_fanout $fanout
223+
}
224+
217225
set allow_congestion [info exists flags(-allow_congestion)]
218226
grt::set_allow_congestion $allow_congestion
219227

src/grt/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ TESTS = [
7878
"set_nets_to_route1",
7979
"silence",
8080
"single_row",
81+
"skip_large_fanout1",
8182
"soft_ndr_4w_6s",
8283
"top_level_term1",
8384
"top_level_term2",

src/grt/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ or_integration_tests(
7676
set_nets_to_route1
7777
silence
7878
single_row
79+
skip_large_fanout1
7980
soft_ndr_4w_6s
8081
top_level_term1
8182
top_level_term2

0 commit comments

Comments
 (0)