Skip to content

Commit b2612bc

Browse files
authored
Merge pull request #6627 from luis201420/grt_jumper_insertion_updates
Grt: Jumper insertion improvement
2 parents 337520b + 25bf9d3 commit b2612bc

13 files changed

+989
-987
lines changed

src/grt/include/grt/GlobalRouter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ class GlobalRouter : public ant::GlobalRouteSource
220220
const int& pos_x,
221221
const int& pos_y,
222222
const int& layer_level);
223+
odb::Point getPositionOnGrid(const odb::Point& real_position);
223224
int repairAntennas(odb::dbMTerm* diode_mterm,
224225
int iterations,
225226
float ratio_margin,

src/grt/src/GlobalRouter.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
456456
diode_mterm,
457457
ratio_margin,
458458
num_threads);
459+
updateDbCongestion();
459460
}
460461
if (violations) {
461462
IncrementalGRoute incr_groute(this, block_);
@@ -1674,6 +1675,12 @@ bool GlobalRouter::hasAvailableResources(bool is_horizontal,
16741675
return cap > 0;
16751676
}
16761677

1678+
// Find the position of the middle of a GCell closest to the position
1679+
odb::Point GlobalRouter::getPositionOnGrid(const odb::Point& real_position)
1680+
{
1681+
return grid_->getPositionOnGrid(real_position);
1682+
}
1683+
16771684
void GlobalRouter::updateResources(const int& init_x,
16781685
const int& init_y,
16791686
const int& final_x,
@@ -2431,6 +2438,10 @@ void GlobalRouter::saveGuides()
24312438
int offset_y = grid_origin_.y();
24322439

24332440
bool guide_is_congested = is_congested_ && !allow_congestion_;
2441+
2442+
int net_with_jumpers, total_jumpers;
2443+
net_with_jumpers = 0;
2444+
total_jumpers = 0;
24342445
for (odb::dbNet* db_net : block_->getNets()) {
24352446
auto iter = routes_.find(db_net);
24362447
if (iter == routes_.end()) {
@@ -2439,6 +2450,7 @@ void GlobalRouter::saveGuides()
24392450
Net* net = db_net_map_[db_net];
24402451
GRoute& route = iter->second;
24412452

2453+
int jumper_count = 0;
24422454
if (!route.empty()) {
24432455
db_net->clearGuides();
24442456
for (GSegment& segment : route) {
@@ -2487,14 +2499,26 @@ void GlobalRouter::saveGuides()
24872499
db_net, layer, layer, box, guide_is_congested);
24882500
if (is_jumper) {
24892501
guide->setIsJumper(true);
2502+
jumper_count++;
24902503
}
24912504
}
24922505
}
24932506
}
2507+
if (jumper_count) {
2508+
total_jumpers += jumper_count;
2509+
net_with_jumpers++;
2510+
}
24942511
auto dbGuides = db_net->getGuides();
24952512
if (dbGuides.orderReversed() && dbGuides.reversible())
24962513
dbGuides.reverse();
24972514
}
2515+
debugPrint(logger_,
2516+
GRT,
2517+
"jumper_insertion",
2518+
2,
2519+
"Remaining jumpers {} in {} repaired nets after GRT",
2520+
total_jumpers,
2521+
net_with_jumpers);
24982522
}
24992523

25002524
void GlobalRouter::writeSegments(const char* file_name)

0 commit comments

Comments
 (0)