Skip to content

Commit e495a56

Browse files
committed
grt/cugr: add missing verbosity guards
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
1 parent ae9df28 commit e495a56

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/grt/src/GlobalRouter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ std::vector<Net*> GlobalRouter::initCUGR(int min_routing_layer,
217217
}
218218
cugr_->setCriticalNetsPercentage(0);
219219
}
220+
// Set before init so Design::read() gates its statistics on verbosity.
221+
cugr_->setVerbose(verbose_);
220222
cugr_->init(min_routing_layer, max_routing_layer, clock_nets);
221223
return nets;
222224
}
@@ -473,7 +475,6 @@ void GlobalRouter::globalRoute(bool save_guides)
473475

474476
if (use_cugr_) {
475477
std::vector<Net*> nets = initCUGR(min_layer, max_layer);
476-
cugr_->setVerbose(verbose_);
477478
if (verbose_) {
478479
reportResources();
479480
}

src/grt/src/cugr/src/CUGR.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ void CUGR::init(const int min_routing_layer,
9191
constants_,
9292
min_routing_layer,
9393
max_routing_layer,
94-
clock_nets);
94+
clock_nets,
95+
verbose_);
9596
grid_graph_ = std::make_unique<GridGraph>(design_.get(), constants_, logger_);
9697
// Instantiate the global routing netlist
9798
const std::vector<CUGRNet>& base_nets = design_->getAllNets();
@@ -822,7 +823,7 @@ void CUGR::iterativeRRR(std::vector<int>& net_indices)
822823
mazeRoute(net_indices);
823824
}
824825
grid_graph_->setCostMultiplier(1.0);
825-
if (soft_ndr_demotions > 0) {
826+
if (verbose_ && soft_ndr_demotions > 0) {
826827
logger_->info(GRT,
827828
306,
828829
"Iterative RRR soft-demoted {} NDR net(s) total.",

src/grt/src/cugr/src/Design.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ Design::Design(odb::dbDatabase* db,
2424
const Constants& constants,
2525
const int min_routing_layer,
2626
const int max_routing_layer,
27-
const odb::PtrSet<odb::dbNet>& clock_nets)
27+
const odb::PtrSet<odb::dbNet>& clock_nets,
28+
const bool verbose)
2829
: block_(db->getChip()->getBlock()),
2930
tech_(db->getTech()),
3031
logger_(logger),
3132
constants_(constants),
3233
min_routing_layer_(min_routing_layer),
3334
max_routing_layer_(max_routing_layer),
34-
clock_nets_(clock_nets)
35+
clock_nets_(clock_nets),
36+
verbose_(verbose)
3537
{
3638
read();
3739
setUnitCosts();
@@ -55,10 +57,12 @@ void Design::read()
5557

5658
computeGrid();
5759

58-
logger_->report("Design statistics");
59-
logger_->report("Nets: {}", nets_.size());
60-
logger_->report("Special nets: {}", num_special_nets);
61-
logger_->report("Routing layers: {}", getNumLayers());
60+
if (verbose_) {
61+
logger_->report("Design statistics");
62+
logger_->report("Nets: {}", nets_.size());
63+
logger_->report("Special nets: {}", num_special_nets);
64+
logger_->report("Routing layers: {}", getNumLayers());
65+
}
6266
}
6367

6468
void Design::readLayers()

src/grt/src/cugr/src/Design.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class Design
4040
const Constants& constants,
4141
int min_routing_layer,
4242
int max_routing_layer,
43-
const odb::PtrSet<odb::dbNet>& clock_nets);
43+
const odb::PtrSet<odb::dbNet>& clock_nets,
44+
bool verbose);
4445
int getLibDBU() const { return lib_dbu_; }
4546

4647
CostT getUnitLengthWireCost() const { return unit_length_wire_cost_; }
@@ -113,6 +114,7 @@ class Design
113114
const int min_routing_layer_;
114115
const int max_routing_layer_;
115116
odb::PtrSet<odb::dbNet> clock_nets_;
117+
const bool verbose_;
116118
};
117119

118120
} // namespace grt

0 commit comments

Comments
 (0)