Skip to content

Commit 21f34f4

Browse files
committed
grt: update loop parameters and code cleaning
Signed-off-by: Jonas Gava <[email protected]>
1 parent a8d1fa1 commit 21f34f4

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

src/grt/src/fastroute/include/Graph2D.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ class Graph2D
3636
{
3737
int net_id; // NDR net id
3838
uint16_t num_edges; // number of congested edges
39+
40+
NDRCongestion(int net_id, uint16_t num_edges)
41+
: net_id(net_id), num_edges(num_edges)
42+
{
43+
}
3944
};
4045

4146
struct NDRCongestionComparator

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,7 @@ NetRouteMap FastRouteCore::run()
11961196
int max_adj;
11971197
int long_edge_len = 40;
11981198
const int short_edge_len = 12;
1199+
const int soft_ndr_overflow_th = 10000;
11991200

12001201
// call FLUTE to generate RSMT and break the nets into segments (2-pin nets)
12011202
via_cost_ = 0;
@@ -1543,7 +1544,7 @@ NetRouteMap FastRouteCore::run()
15431544
// If the congestion is not that high (note that the overflow is inflated
15441545
// by 100x when there is no capacity available for a NDR net in a specific
15451546
// edge)
1546-
if (total_overflow_ < 10000) {
1547+
if (total_overflow_ < soft_ndr_overflow_th) {
15471548
// Select one NDR net to be disabled
15481549
int net_id = graph2d_.getOneCongestedNDRnet();
15491550
if (net_id != -1) {
@@ -1560,7 +1561,16 @@ NetRouteMap FastRouteCore::run()
15601561

15611562
// Reset loop parameters
15621563
overflow_increases = 0;
1563-
i = 0;
1564+
i = 1;
1565+
costheight_ = COSHEIGHT;
1566+
enlarge_ = ENLARGE;
1567+
ripup_threshold = Ripvalue;
1568+
minofl = total_overflow_;
1569+
bmfl = minofl;
1570+
stopDEC = false;
1571+
1572+
slope = 20;
1573+
L = 1;
15641574

15651575
// Increase maze route 3D threshold to fix bad routes
15661576
long_edge_len = BIG_INT;
@@ -1662,7 +1672,8 @@ NetRouteMap FastRouteCore::run()
16621672
void FastRouteCore::applySoftNDR(const std::vector<int>& net_ids)
16631673
{
16641674
for (auto net_id : net_ids) {
1665-
logger_->warn(GRT, 273, "Disabling NDR net {}", nets_[net_id]->getName());
1675+
logger_->warn(
1676+
GRT, 273, "Disabled NDR for the {} net.", nets_[net_id]->getName());
16661677

16671678
// Remove the usage of all the edges involved with this net
16681679
updateSoftNDRNetUsage(net_id, -nets_[net_id]->getEdgeCost());

src/grt/src/fastroute/src/graph2d.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,14 +493,11 @@ void Graph2D::initNDRnets()
493493
{
494494
v_ndr_nets_.resize(boost::extents[x_grid_][y_grid_]);
495495
h_ndr_nets_.resize(boost::extents[x_grid_][y_grid_]);
496-
497-
// congested_ndrs_.resize(boost::extents[x_grid_][y_grid_]);
498496
}
499497

500498
void Graph2D::addCongestedNDRnet(const int net_id, const uint16_t num_edges)
501499
{
502-
NDRCongestion ndr_net = {net_id, num_edges};
503-
congested_ndrs_.push_back(ndr_net);
500+
congested_ndrs_.emplace_back(net_id, num_edges);
504501
}
505502

506503
void Graph2D::sortCongestedNDRnets()

0 commit comments

Comments
 (0)