Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/grt/include/grt/GlobalRouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ class GlobalRouter
int repairAntennas(odb::dbMTerm* diode_mterm,
int iterations,
float ratio_margin,
bool jumper_only,
bool diode_only,
int num_threads = 1);
void updateResources(const int& init_x,
const int& init_y,
Expand Down
6 changes: 4 additions & 2 deletions src/grt/src/GlobalRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ void GlobalRouter::updateDbCongestion()
int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
int iterations,
float ratio_margin,
bool jumper_only,
bool diode_only,
const int num_threads)
{
if (!initialized_ || haveDetailedRoutes()) {
Expand Down Expand Up @@ -504,7 +506,7 @@ int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
// if run in GRT and it need run jumper insertion
std::vector<odb::dbNet*> nets_with_jumpers;
if (!haveDetailedRoutes(nets_to_repair)
&& repair_antennas_->hasNewViolations()) {
&& repair_antennas_->hasNewViolations() && !diode_only) {
// Run jumper insertion and clean
repair_antennas_->jumperInsertion(routes_,
grid_->getTileSize(),
Expand All @@ -523,7 +525,7 @@ int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
num_threads);
updateDbCongestion();
}
if (violations) {
if (violations && !jumper_only) {
IncrementalGRoute incr_groute(this, block_);
repair_antennas_->repairAntennas(diode_mterm);
total_diodes_count_ += repair_antennas_->getDiodesCount();
Expand Down
4 changes: 2 additions & 2 deletions src/grt/src/GlobalRouter.i
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ route_layer_lengths(odb::dbNet* db_net)
}

int
repair_antennas(odb::dbMTerm* diode_mterm, int iterations, float ratio_margin)
repair_antennas(odb::dbMTerm* diode_mterm, int iterations, float ratio_margin, bool jumper_only, bool diode_only)
{
const int num_threads = ord::OpenRoad::openRoad()->getThreadCount();
return getGlobalRouter()->repairAntennas(diode_mterm, iterations, ratio_margin, num_threads);
return getGlobalRouter()->repairAntennas(diode_mterm, iterations, ratio_margin, jumper_only, diode_only, num_threads);
}

void
Expand Down
19 changes: 16 additions & 3 deletions src/grt/src/GlobalRouter.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,14 @@ proc global_route { args } {

sta::define_cmd_args "repair_antennas" { diode_cell \
[-iterations iterations] \
[-ratio_margin ratio_margin]}
[-ratio_margin ratio_margin] \
[-jumper_only] \
[-diode_only] \
[-allow_congestion]}
Comment on lines +245 to +247
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The indentation for the new flags uses tabs, while the existing code in this block uses spaces for alignment. For consistency with the surrounding code, please use spaces instead of tabs.

                                         [-jumper_only] \
                                         [-diode_only] \
                                         [-allow_congestion]}


proc repair_antennas { args } {
sta::parse_key_args "repair_antennas" args \
keys {-iterations -ratio_margin} flags {}
keys {-iterations -ratio_margin} flags {-jumper_only -diode_only -allow_congestion}
if { [ord::get_db_block] == "NULL" } {
utl::error GRT 104 "No design block found."
}
Expand Down Expand Up @@ -285,6 +288,16 @@ proc repair_antennas { args } {
sta::check_positive_integer "-iterations" $iterations
}

set allow_congestion [info exists flags(-allow_congestion)]
grt::set_allow_congestion $allow_congestion

set jumper_only [info exists flags(-jumper_only)]
set diode_only [info exists flags(-diode_only)]

if { $jumper_only && $diode_only } {
utl::error GRT 294 "Only use either -jumper_only or -diode_only flag"
}

set ratio_margin 0
if { [info exists keys(-ratio_margin)] } {
set ratio_margin $keys(-ratio_margin)
Expand All @@ -293,7 +306,7 @@ proc repair_antennas { args } {
}
}

return [grt::repair_antennas $diode_mterm $iterations $ratio_margin]
return [grt::repair_antennas $diode_mterm $iterations $ratio_margin $jumper_only $diode_only]
} else {
utl::error GRT 45 "Run global_route before repair_antennas."
}
Expand Down