Skip to content

Commit 514fd69

Browse files
authored
Merge pull request The-OpenROAD-Project#9181 from luis201420/grt_add_flags_to_repair_antennas
GRT: add options for repair antennas
2 parents ac2d843 + 969dd19 commit 514fd69

19 files changed

+25813
-8
lines changed

src/grt/include/grt/GlobalRouter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ class GlobalRouter
201201
int repairAntennas(odb::dbMTerm* diode_mterm,
202202
int iterations,
203203
float ratio_margin,
204+
bool jumper_only,
205+
bool diode_only,
204206
int num_threads = 1);
205207
void updateResources(const int& init_x,
206208
const int& init_y,

src/grt/src/GlobalRouter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ void GlobalRouter::updateDbCongestion()
448448
int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
449449
int iterations,
450450
float ratio_margin,
451+
bool jumper_only,
452+
bool diode_only,
451453
const int num_threads)
452454
{
453455
if (!initialized_ || haveDetailedRoutes()) {
@@ -504,7 +506,7 @@ int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
504506
// if run in GRT and it need run jumper insertion
505507
std::vector<odb::dbNet*> nets_with_jumpers;
506508
if (!haveDetailedRoutes(nets_to_repair)
507-
&& repair_antennas_->hasNewViolations()) {
509+
&& repair_antennas_->hasNewViolations() && !diode_only) {
508510
// Run jumper insertion and clean
509511
repair_antennas_->jumperInsertion(routes_,
510512
grid_->getTileSize(),
@@ -523,7 +525,7 @@ int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
523525
num_threads);
524526
updateDbCongestion();
525527
}
526-
if (violations) {
528+
if (violations && !jumper_only) {
527529
IncrementalGRoute incr_groute(this, block_);
528530
repair_antennas_->repairAntennas(diode_mterm);
529531
total_diodes_count_ += repair_antennas_->getDiodesCount();

src/grt/src/GlobalRouter.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ route_layer_lengths(odb::dbNet* db_net)
165165
}
166166

167167
int
168-
repair_antennas(odb::dbMTerm* diode_mterm, int iterations, float ratio_margin)
168+
repair_antennas(odb::dbMTerm* diode_mterm, int iterations, float ratio_margin, bool jumper_only, bool diode_only)
169169
{
170170
const int num_threads = ord::OpenRoad::openRoad()->getThreadCount();
171-
return getGlobalRouter()->repairAntennas(diode_mterm, iterations, ratio_margin, num_threads);
171+
return getGlobalRouter()->repairAntennas(diode_mterm, iterations, ratio_margin, jumper_only, diode_only, num_threads);
172172
}
173173

174174
void

src/grt/src/GlobalRouter.tcl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,14 @@ proc global_route { args } {
241241

242242
sta::define_cmd_args "repair_antennas" { diode_cell \
243243
[-iterations iterations] \
244-
[-ratio_margin ratio_margin]}
244+
[-ratio_margin ratio_margin] \
245+
[-jumper_only] \
246+
[-diode_only] \
247+
[-allow_congestion]}
245248

246249
proc repair_antennas { args } {
247250
sta::parse_key_args "repair_antennas" args \
248-
keys {-iterations -ratio_margin} flags {}
251+
keys {-iterations -ratio_margin} flags {-jumper_only -diode_only -allow_congestion}
249252
if { [ord::get_db_block] == "NULL" } {
250253
utl::error GRT 104 "No design block found."
251254
}
@@ -285,6 +288,16 @@ proc repair_antennas { args } {
285288
sta::check_positive_integer "-iterations" $iterations
286289
}
287290

291+
set allow_congestion [info exists flags(-allow_congestion)]
292+
grt::set_allow_congestion $allow_congestion
293+
294+
set jumper_only [info exists flags(-jumper_only)]
295+
set diode_only [info exists flags(-diode_only)]
296+
297+
if { $jumper_only && $diode_only } {
298+
utl::error GRT 294 "Only use either -jumper_only or -diode_only flag"
299+
}
300+
288301
set ratio_margin 0
289302
if { [info exists keys(-ratio_margin)] } {
290303
set ratio_margin $keys(-ratio_margin)
@@ -293,7 +306,7 @@ proc repair_antennas { args } {
293306
}
294307
}
295308

296-
return [grt::repair_antennas $diode_mterm $iterations $ratio_margin]
309+
return [grt::repair_antennas $diode_mterm $iterations $ratio_margin $jumper_only $diode_only]
297310
} else {
298311
utl::error GRT 45 "Run global_route before repair_antennas."
299312
}

src/grt/test/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ TESTS = [
7272
"repair_antennas4",
7373
"repair_antennas_error1",
7474
"repair_antennas_error2",
75+
"repair_antennas_only_diodes",
76+
"repair_antennas_only_jumpers",
77+
"repair_antennas_allow_congestion",
7578
"report_wire_length1",
7679
"report_wire_length2",
7780
"report_wire_length3",

src/grt/test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ or_integration_tests(
7070
repair_antennas4
7171
repair_antennas_error1
7272
repair_antennas_error2
73+
repair_antennas_only_diodes
74+
repair_antennas_only_jumpers
75+
repair_antennas_allow_congestion
7376
report_wire_length1
7477
report_wire_length2
7578
report_wire_length3

src/grt/test/repair_antennas1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
ant = design.getAntennaChecker()
2222

2323
ant.checkAntennas()
24-
gr.repairAntennas(None, 1, 0)
24+
gr.repairAntennas(None, 1, 0, False, False)
2525
ant.checkAntennas()
2626

2727
design.evalTclString("check_placement")

0 commit comments

Comments
 (0)