Skip to content

Commit 255f8c0

Browse files
committed
grt: apply layer adjustments into grid graph edges
Signed-off-by: Eder Monteiro <[email protected]>
1 parent 19950c1 commit 255f8c0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/grt/src/cugr/src/GridGraph.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ GridGraph::GridGraph(const Design* design,
228228
}
229229
}
230230
}
231+
232+
// Apply user-defined capacity adjustment
233+
for (int layer_index = 0; layer_index < num_layers_; layer_index++) {
234+
const float adjustment = design->getLayer(layer_index).getAdjustment();
235+
if (adjustment != 0.0) {
236+
for (size_t x = 0; x < x_size_; x++) {
237+
for (size_t y = 0; y < y_size_; y++) {
238+
graph_edges_[layer_index][x][y].capacity
239+
= graph_edges_[layer_index][x][y].capacity * (1.0 - adjustment);
240+
}
241+
}
242+
}
243+
}
231244
}
232245

233246
IntervalT GridGraph::rangeSearchGridlines(const int dimension,

0 commit comments

Comments
 (0)