Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 43 additions & 31 deletions src/grt/src/cugr/src/CUGR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,17 @@ void CUGR::updateOverflowNets(std::vector<int>& net_indices)
net_indices.push_back(net->getIndex());
}
}
logger_->report("Nets with overflow: {}.", net_indices.size());
const int num_nets = gr_nets_.size();
logger_->info(utl::GRT,
1258,
"{} / {} nets have overflow.",
netIndices.size(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'netIndices'; did you mean 'net_indices'? [clang-diagnostic-error]

Suggested change
netIndices.size(),
net_indices.size(),
Additional context

src/grt/src/cugr/src/CUGR.cpp:130: 'net_indices' declared here

void CUGR::updateOverflowNets(std::vector<int>& net_indices)
                                                ^

num_nets);
}

void CUGR::patternRoute(std::vector<int>& net_indices)
{
logger_->report("Stage 1: Pattern routing.");
logger_->info(utl::GRT, 1259, "Stage 1: pattern routing.");

if (critical_nets_percentage_ != 0) {
setInitialNetSlacks();
Expand Down Expand Up @@ -172,7 +177,8 @@ void CUGR::patternRouteWithDetours(std::vector<int>& net_indices)
if (net_indices.empty()) {
return;
}
logger_->report("Stage 2: Pattern routing with detours.");
logger_->info(
utl::GRT, 1260, "Stage 2: pattern routing with possible detours.");

if (critical_nets_percentage_ != 0) {
calculatePartialSlack();
Expand Down Expand Up @@ -206,7 +212,8 @@ void CUGR::mazeRoute(std::vector<int>& net_indices)
if (net_indices.empty()) {
return;
}
logger_->report("Stage 3: Maze routing on sparsified graph.");
logger_->info(
utl::GRT, 1261, "Stage 3: maze routing on sparsified routing graph.");

if (critical_nets_percentage_ != 0) {
calculatePartialSlack();
Expand All @@ -219,19 +226,16 @@ void CUGR::mazeRoute(std::vector<int>& net_indices)
grid_graph_->extractWireCostView(wire_cost_view);
sortNetIndices(net_indices);
SparseGrid grid(10, 10, 0, 0);
for (const int net_index : net_indices) {
GRNet* net = gr_nets_[net_index].get();
if (net->getNumPins() < 2) {
continue;
}
MazeRoute maze_route(net, grid_graph_.get(), logger_);
maze_route.constructSparsifiedGraph(wire_cost_view, grid);
maze_route.run();
std::shared_ptr<SteinerTreeNode> tree = maze_route.getSteinerTree();
for (const int netIndex : netIndices) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'netIndices'; did you mean 'net_indices'? [clang-diagnostic-error]

Suggested change
for (const int netIndex : netIndices) {
for (const int netIndex : net_indices) {
Additional context

src/grt/src/cugr/src/CUGR.cpp:209: 'net_indices' declared here

void CUGR::mazeRoute(std::vector<int>& net_indices)
                                       ^

GRNet* net = gr_nets_[netIndex].get();
MazeRoute mazeRoute(net, grid_graph_.get(), logger_);
mazeRoute.constructSparsifiedGraph(wireCostView, grid);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'wireCostView'; did you mean 'wire_cost_view'? [clang-diagnostic-error]

Suggested change
mazeRoute.constructSparsifiedGraph(wireCostView, grid);
mazeRoute.constructSparsifiedGraph(wire_cost_view, grid);
Additional context

src/grt/src/cugr/src/CUGR.cpp:224: 'wire_cost_view' declared here

  GridGraphView<CostT> wire_cost_view;
                       ^

mazeRoute.run();
std::shared_ptr<SteinerTreeNode> tree = mazeRoute.getSteinerTree();
if (tree == nullptr) {
logger_->error(GRT,
610,
"Failed to generate Steiner tree for net {}.",
logger_->error(utl::GRT,
1270,
"Steiner tree is null for net {} during maze routing.",
net->getName());
}

Expand Down Expand Up @@ -294,10 +298,14 @@ void CUGR::write(const std::string& guide_file)
}
ss << ")\n";
}
logger_->report("Total area of pin access patches: {}.",
area_of_pin_patches_);
logger_->report("Total area of wire segment patches: {}.",
area_of_wire_patches_);
logger_->info(utl::GRT,
1262,
"Total area of pin access patches: {}.",
area_of_pin_patches_);
logger_->info(utl::GRT,
1263,
"Total area of wire segment patches: {}.",
area_of_wire_patches_);
std::ofstream fout(guide_file);
fout << ss.str();
fout.close();
Expand Down Expand Up @@ -424,10 +432,11 @@ void CUGR::getGuides(const GRNet* net,

// 1. Pin access patches
if (constants_.min_routing_layer + 1 >= grid_graph_->getNumLayers()) {
logger_->error(GRT,
611,
"Min routing layer {} exceeds available layers.",
constants_.min_routing_layer);
logger_->error(utl::GRT,
1271,
"Min routing layer {} exceeds number of layers {}.",
constants_.min_routing_layer,
grid_graph_->getNumLayers());
}
for (auto& gpts : net->getPinAccessPoints()) {
for (auto& gpt : gpts) {
Expand Down Expand Up @@ -499,7 +508,7 @@ void CUGR::getGuides(const GRNet* net,

void CUGR::printStatistics() const
{
logger_->report("Routing statistics");
logger_->info(utl::GRT, 1264, "Routing statistics:");

// wire length and via count
uint64_t wire_length = 0;
Expand Down Expand Up @@ -559,12 +568,15 @@ void CUGR::printStatistics() const
}
}

logger_->report("Wire length: {}",
wire_length / grid_graph_->getM2Pitch());
logger_->report("Total via count: {}", via_count);
logger_->report("Total wire overflow: {}", (int) overflow);
logger_->report("Min resource: {}", min_resource);
logger_->report("Bottleneck: {}", bottleneck);
logger_->info(utl::GRT,
1265,
"Wire length (metric): {}.",
wireLength / grid_graph_->getM2Pitch());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'wireLength'; did you mean 'wire_length'? [clang-diagnostic-error]

Suggested change
wireLength / grid_graph_->getM2Pitch());
wire_length / grid_graph_->getM2Pitch());
Additional context

src/grt/src/cugr/src/CUGR.cpp:513: 'wire_length' declared here

  uint64_t wire_length = 0;
           ^

logger_->info(utl::GRT, 1266, "Total via count: {}.", viaCount);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'viaCount'; did you mean 'via_count'? [clang-diagnostic-error]

Suggested change
logger_->info(utl::GRT, 1266, "Total via count: {}.", viaCount);
logger_->info(utl::GRT, 1266, "Total via count: {}.", via_count);
Additional context

src/grt/src/cugr/src/CUGR.cpp:514: 'via_count' declared here

  int via_count = 0;
      ^

logger_->info(utl::GRT, 1267, "Total wire overflow: {}.", (int) overflow);

logger_->info(utl::GRT, 1268, "Min resource: {}.", minResource);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use of undeclared identifier 'minResource'; did you mean 'min_resource'? [clang-diagnostic-error]

Suggested change
logger_->info(utl::GRT, 1268, "Min resource: {}.", minResource);
logger_->info(utl::GRT, 1268, "Min resource: {}.", min_resource);
Additional context

src/grt/src/cugr/src/CUGR.cpp:546: 'min_resource' declared here

  CapacityT min_resource = std::numeric_limits<CapacityT>::max();
            ^

logger_->info(utl::GRT, 1269, "Bottleneck: {}.", bottleneck);
}

void CUGR::updateDbCongestion()
Expand Down
Loading