Skip to content

Commit 0702233

Browse files
authored
Merge pull request #8400 from eder-matheus/grt_cugr_adjustment
grt: apply user-defined adjustments into CUGR flow
2 parents 0974240 + 5ad2b56 commit 0702233

22 files changed

+28182
-5
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ 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 *= (1.0 - adjustment);
239+
}
240+
}
241+
}
242+
}
231243
}
232244

233245
IntervalT GridGraph::rangeSearchGridlines(const int dimension,

src/grt/src/cugr/src/Layers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ MetalLayer::MetalLayer(odb::dbTechLayer* tech_layer,
7979
max_eol_within_ = std::max(max_eol_within_, static_cast<int>(eol_within));
8080
}
8181
}
82+
83+
adjustment_ = tech_layer->getLayerAdjustment();
8284
}
8385

8486
int MetalLayer::getTrackLocation(const int track_index) const

src/grt/src/cugr/src/Layers.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class MetalLayer
1717
MetalLayer(odb::dbTechLayer* tech_layer, odb::dbTrackGrid* track_grid);
1818

1919
std::string getName() const { return name_; }
20+
int getIndex() const { return index_; }
2021
int getDirection() const { return direction_; }
2122
int getWidth() const { return width_; }
2223
int getPitch() const { return pitch_; }
@@ -29,6 +30,8 @@ class MetalLayer
2930
int getDefaultSpacing() const { return default_spacing_; }
3031
int getParallelSpacing(int width, int length = 0) const;
3132
int getMaxEolSpacing() const { return max_eol_spacing_; }
33+
float getAdjustment() const { return adjustment_; }
34+
void setAdjustment(float adjustment) { adjustment_ = adjustment; }
3235

3336
private:
3437
std::string name_;
@@ -58,6 +61,9 @@ class MetalLayer
5861
int max_eol_width_ = 0;
5962
int max_eol_within_ = 0;
6063

64+
// User-defined capacity adjustment
65+
float adjustment_ = 0.0;
66+
6167
// Corner spacing
6268
};
6369

src/grt/test/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ TESTS = [
44
"bus_route",
55
"clock_route",
66
"clock_route_cugr",
7+
"clock_route_cugr2",
78
"clock_route_alpha",
89
"clock_route_error1",
910
"clock_route_error2",
@@ -15,11 +16,15 @@ TESTS = [
1516
"congestion6",
1617
"congestion7",
1718
"critical_nets_percentage",
19+
"cugr_adjustment1",
20+
"cugr_adjustment2",
21+
"cugr_adjustment3",
1822
"est_rc1",
1923
"est_rc2",
2024
"est_rc3",
2125
"est_rc4",
2226
"gcd",
27+
"gcd_cugr",
2328
"gcd_flute",
2429
"inst_pin_out_of_die",
2530
"invalid_pin_placement",

src/grt/test/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ or_integration_tests(
44
bus_route
55
clock_route
66
clock_route_cugr
7+
clock_route_cugr2
78
clock_route_alpha
89
clock_route_error1
910
clock_route_error2
@@ -15,11 +16,15 @@ or_integration_tests(
1516
congestion6
1617
congestion7
1718
critical_nets_percentage
19+
cugr_adjustment1
20+
cugr_adjustment2
21+
cugr_adjustment3
1822
est_rc1
1923
est_rc2
2024
est_rc3
2125
est_rc4
2226
gcd
27+
gcd_cugr
2328
gcd_flute
2429
inst_pin_out_of_die
2530
invalid_pin_placement

src/grt/test/clock_route_cugr.ok

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[INFO ODB-0133] Created 15 nets and 72 connections.
77
[INFO GRT-0020] Min routing layer: met1
88
[INFO GRT-0021] Max routing layer: met5
9-
[INFO GRT-0022] Global adjustment: 50%
9+
[INFO GRT-0022] Global adjustment: 0%
1010
[INFO GRT-0023] Grid origin: (0, 0)
1111
[INFO GRT-0088] Layer li1 Track-Pitch = 0.4800 line-2-Via Pitch: 0.3400
1212
[INFO GRT-0088] Layer met1 Track-Pitch = 0.3700 line-2-Via Pitch: 0.3400

src/grt/test/clock_route_cugr.tcl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ set_propagated_clock [get_clocks {core_clock}]
1212

1313
set guide_file [make_result_file clock_route_cugr.guide]
1414

15-
set_global_routing_layer_adjustment met1 0.8
16-
set_global_routing_layer_adjustment met2 0.7
17-
set_global_routing_layer_adjustment * 0.5
18-
1915
set_routing_layers -signal met1-met5 -clock met3-met5
2016

2117
global_route -verbose -use_cugr

0 commit comments

Comments
 (0)