Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#4675 from luis201420/grt_incr…
Browse files Browse the repository at this point in the history
…_improving_runtime

Grt: Avoiding iterating all gcells and nets
  • Loading branch information
eder-matheus authored Feb 16, 2024
2 parents 114a83d + 071f80f commit 59acbf4
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/grt/src/fastroute/src/maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2463,25 +2463,21 @@ int FastRouteCore::getOverflow3D()
int total_usage = 0;

for (int k = 0; k < num_layers_; k++) {
for (int i = 0; i < y_grid_; i++) {
for (int j = 0; j < x_grid_ - 1; j++) {
total_usage += h_edges_3D_[k][i][j].usage;
overflow = h_edges_3D_[k][i][j].usage - h_edges_3D_[k][i][j].cap;
for (const auto& [i, j] : h_used_ggrid_) {
total_usage += h_edges_3D_[k][i][j].usage;
overflow = h_edges_3D_[k][i][j].usage - h_edges_3D_[k][i][j].cap;

if (overflow > 0) {
H_overflow += overflow;
max_H_overflow = std::max(max_H_overflow, overflow);
}
if (overflow > 0) {
H_overflow += overflow;
max_H_overflow = std::max(max_H_overflow, overflow);
}
}
for (int i = 0; i < y_grid_ - 1; i++) {
for (int j = 0; j < x_grid_; j++) {
total_usage += v_edges_3D_[k][i][j].usage;
overflow = v_edges_3D_[k][i][j].usage - v_edges_3D_[k][i][j].cap;
if (overflow > 0) {
V_overflow += overflow;
max_V_overflow = std::max(max_V_overflow, overflow);
}
for (const auto& [i, j] : v_used_ggrid_) {
total_usage += v_edges_3D_[k][i][j].usage;
overflow = v_edges_3D_[k][i][j].usage - v_edges_3D_[k][i][j].cap;
if (overflow > 0) {
V_overflow += overflow;
max_V_overflow = std::max(max_V_overflow, overflow);
}
}
}
Expand Down Expand Up @@ -2571,7 +2567,7 @@ void FastRouteCore::InitLastUsage(const int upType)
void FastRouteCore::SaveLastRouteLen()
{
for (int netID = 0; netID < netCount(); netID++) {
if (nets_[netID] == nullptr) {
if (skipNet(netID)) {
continue;
}
auto& treeedges = sttrees_[netID].edges;
Expand Down

0 comments on commit 59acbf4

Please sign in to comment.