Skip to content

Commit e50a364

Browse files
authored
Merge pull request #7990 from The-OpenROAD-Project-staging/grt-refactoring
Grt refactoring
2 parents bc31388 + 6ae378e commit e50a364

File tree

4 files changed

+126
-142
lines changed

4 files changed

+126
-142
lines changed

src/grt/src/fastroute/include/FastRoute.h

Lines changed: 89 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ struct CostParams
7676
const float cost_height;
7777
const int slope;
7878

79-
CostParams(const float logistic_coef,
80-
const float cost_height,
81-
const int slope)
79+
CostParams(float logistic_coef, float cost_height, int slope)
8280
: logistic_coef(logistic_coef), cost_height(cost_height), slope(slope)
8381
{
8482
}
@@ -126,13 +124,13 @@ class FastRouteCore
126124
void addVerticalAdjustments(
127125
const odb::Point& first_tile,
128126
const odb::Point& last_tile,
129-
const int layer,
127+
int layer,
130128
const interval<int>::type& first_tile_reduce_interval,
131129
const interval<int>::type& last_tile_reduce_interval);
132130
void addHorizontalAdjustments(
133131
const odb::Point& first_tile,
134132
const odb::Point& last_tile,
135-
const int layer,
133+
int layer,
136134
const interval<int>::type& first_tile_reduce_interval,
137135
const interval<int>::type& last_tile_reduce_interval);
138136
void initBlockedIntervals(std::vector<int>& track_space);
@@ -241,13 +239,13 @@ class FastRouteCore
241239
// maze functions
242240
// Maze-routing in different orders
243241
double getCost(int index, bool is_horizontal, const CostParams& cost_params);
244-
void mazeRouteMSMD(const int iter,
245-
const int expand,
246-
const int ripup_threshold,
247-
const int maze_edge_threshold,
248-
const bool ordering,
249-
const int via,
250-
const int L,
242+
void mazeRouteMSMD(int iter,
243+
int expand,
244+
int ripup_threshold,
245+
int maze_edge_threshold,
246+
bool ordering,
247+
int via,
248+
int L,
251249
const CostParams& cost_params,
252250
float& slack_th);
253251
void convertToMazeroute();
@@ -260,60 +258,60 @@ class FastRouteCore
260258
int dir,
261259
int& radius);
262260
void SaveLastRouteLen();
263-
void checkAndFixEmbeddedTree(const int net_id);
264-
bool areEdgesOverlapping(const int net_id,
265-
const int edge_id,
261+
void checkAndFixEmbeddedTree(int net_id);
262+
bool areEdgesOverlapping(int net_id,
263+
int edge_id,
266264
const std::vector<int>& edges);
267265
void fixOverlappingEdge(
268-
const int net_id,
266+
int net_id,
269267
int edge,
270268
std::vector<std::pair<int16_t, int16_t>>& blocked_positions);
271269
void routeLShape(const TreeNode& startpoint,
272270
const TreeNode& endpoint,
273271
std::vector<std::pair<short, short>>& blocked_positions,
274272
std::vector<GPoint3D>& new_route);
275-
void convertToMazerouteNet(const int netID);
276-
void setupHeap(const int netID,
277-
const int edgeID,
273+
void convertToMazerouteNet(int netID);
274+
void setupHeap(int netID,
275+
int edgeID,
278276
std::vector<double*>& src_heap,
279277
std::vector<double*>& dest_heap,
280278
multi_array<double, 2>& d1,
281279
multi_array<double, 2>& d2,
282-
const int regionX1,
283-
const int regionX2,
284-
const int regionY1,
285-
const int regionY2);
280+
int regionX1,
281+
int regionX2,
282+
int regionY1,
283+
int regionY2);
286284
int copyGrids(const std::vector<TreeNode>& treenodes,
287-
const int n1,
288-
const int n2,
285+
int n1,
286+
int n2,
289287
const std::vector<TreeEdge>& treeedges,
290-
const int edge_n1n2,
288+
int edge_n1n2,
291289
std::vector<int>& gridsX_n1n2,
292290
std::vector<int>& gridsY_n1n2);
293-
bool updateRouteType1(const int net_id,
291+
bool updateRouteType1(int net_id,
294292
const std::vector<TreeNode>& treenodes,
295-
const int n1,
296-
const int A1,
297-
const int A2,
298-
const int E1x,
299-
const int E1y,
293+
int n1,
294+
int A1,
295+
int A2,
296+
int E1x,
297+
int E1y,
300298
std::vector<TreeEdge>& treeedges,
301-
const int edge_n1A1,
302-
const int edge_n1A2);
303-
bool updateRouteType2(const int net_id,
299+
int edge_n1A1,
300+
int edge_n1A2);
301+
bool updateRouteType2(int net_id,
304302
const std::vector<TreeNode>& treenodes,
305-
const int n1,
306-
const int A1,
307-
const int A2,
308-
const int C1,
309-
const int C2,
310-
const int E1x,
311-
const int E1y,
303+
int n1,
304+
int A1,
305+
int A2,
306+
int C1,
307+
int C2,
308+
int E1x,
309+
int E1y,
312310
std::vector<TreeEdge>& treeedges,
313-
const int edge_n1A1,
314-
const int edge_n1A2,
315-
const int edge_C1C2);
316-
void reInitTree(const int netID);
311+
int edge_n1A1,
312+
int edge_n1A2,
313+
int edge_C1C2);
314+
void reInitTree(int netID);
317315

318316
// maze3D functions
319317
void mazeRouteMSMDOrder3D(int expand, int ripupTHlb, int ripupTHub);
@@ -337,9 +335,9 @@ class FastRouteCore
337335
int regionY1,
338336
int regionY2);
339337
void newUpdateNodeLayers(std::vector<TreeNode>& treenodes,
340-
const int edgeID,
341-
const int n1,
342-
const int lastL);
338+
int edgeID,
339+
int n1,
340+
int lastL);
343341
int copyGrids3D(std::vector<TreeNode>& treenodes,
344342
int n1,
345343
int n2,
@@ -371,28 +369,28 @@ class FastRouteCore
371369
int edge_C1C2);
372370

373371
// rsmt functions
374-
void copyStTree(const int ind, const Tree& rsmt);
375-
void gen_brk_RSMT(const bool congestionDriven,
376-
const bool reRoute,
377-
const bool genTree,
378-
const bool newType,
379-
const bool noADJ);
380-
void fluteNormal(const int netID,
372+
void copyStTree(int ind, const Tree& rsmt);
373+
void gen_brk_RSMT(bool congestionDriven,
374+
bool reRoute,
375+
bool genTree,
376+
bool newType,
377+
bool noADJ);
378+
void fluteNormal(int netID,
381379
const std::vector<int>& x,
382380
const std::vector<int>& y,
383-
const int acc,
384-
const float coeffV,
381+
int acc,
382+
float coeffV,
385383
Tree& t);
386-
void fluteCongest(const int netID,
384+
void fluteCongest(int netID,
387385
const std::vector<int>& x,
388386
const std::vector<int>& y,
389-
const int acc,
390-
const float coeffV,
387+
int acc,
388+
float coeffV,
391389
Tree& t);
392-
float coeffADJ(const int netID);
393-
bool HTreeSuite(const int netID);
394-
bool VTreeSuite(const int netID);
395-
bool netCongestion(const int netID);
390+
float coeffADJ(int netID);
391+
bool HTreeSuite(int netID);
392+
bool VTreeSuite(int netID);
393+
bool netCongestion(int netID);
396394

397395
// route functions
398396
// old functions for segment list data structure
@@ -422,33 +420,33 @@ class FastRouteCore
422420
// ripup functions
423421
void ripupSegL(const Segment* seg);
424422
void newRipup(const TreeEdge* treeedge,
425-
const int x1,
426-
const int y1,
427-
const int x2,
428-
const int y2,
429-
const int netID);
423+
int x1,
424+
int y1,
425+
int x2,
426+
int y2,
427+
int netID);
430428

431429
bool newRipupCheck(const TreeEdge* treeedge,
432-
const int x1,
433-
const int y1,
434-
const int x2,
435-
const int y2,
436-
const int ripup_threshold,
437-
const float critical_slack,
438-
const int netID,
439-
const int edgeID);
440-
441-
bool newRipupType2(const TreeEdge* treeedge,
442-
std::vector<TreeNode>& treenodes,
443-
const int x1,
444-
const int y1,
445-
const int x2,
446-
const int y2,
447-
const int deg,
448-
const int netID);
449-
bool newRipup3DType3(const int netID, const int edgeID);
450-
void newRipupNet(const int netID);
451-
void releaseNetResources(const int netID);
430+
int x1,
431+
int y1,
432+
int x2,
433+
int y2,
434+
int ripup_threshold,
435+
float critical_slack,
436+
int netID,
437+
int edgeID);
438+
439+
bool newRipupCongestedL(const TreeEdge* treeedge,
440+
std::vector<TreeNode>& treenodes,
441+
int x1,
442+
int y1,
443+
int x2,
444+
int y2,
445+
int deg,
446+
int netID);
447+
bool newRipup3DType3(int netID, int edgeID);
448+
void newRipupNet(int netID);
449+
void releaseNetResources(int netID);
452450

453451
// utility functions
454452
void setTreeNodesVariables(int netID);
@@ -457,7 +455,7 @@ class FastRouteCore
457455
int n1,
458456
int n2,
459457
int edge_n1n2);
460-
void printEdge(const int netID, const int edgeID);
458+
void printEdge(int netID, int edgeID);
461459
void ConvertToFull3DType2();
462460
void fillVIA();
463461
void getViaStackRange(int netID,

src/grt/src/fastroute/src/FastRoute.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ NetRouteMap FastRouteCore::run()
992992
int L = 0;
993993
int VIA = 2;
994994
const int Ripvalue = -1;
995-
const bool goingLV = true;
996995
const bool noADJ = false;
997996
const int thStep1 = 10;
998997
const int thStep2 = 4;
@@ -1358,7 +1357,7 @@ NetRouteMap FastRouteCore::run()
13581357
costheight_ = 3;
13591358
via_cost_ = 1;
13601359

1361-
if (goingLV && past_cong == 0) {
1360+
if (past_cong == 0) {
13621361
mazeRouteMSMDOrder3D(enlarge_, 0, 20);
13631362
mazeRouteMSMDOrder3D(enlarge_, 0, 12);
13641363
}

0 commit comments

Comments
 (0)