Skip to content

grt: replace assert with logger error in CUGR maze route#9870

Merged
eder-matheus merged 7 commits intoThe-OpenROAD-Project:masterfrom
Divinesoumyadip:fix/grt-cugr-assert-to-logger
Mar 25, 2026
Merged

grt: replace assert with logger error in CUGR maze route#9870
eder-matheus merged 7 commits intoThe-OpenROAD-Project:masterfrom
Divinesoumyadip:fix/grt-cugr-assert-to-logger

Conversation

@Divinesoumyadip
Copy link
Copy Markdown
Contributor

Fixes #9869

Replaces raw assert statements in src/grt/src/cugr/src/CUGR.cpp with proper logger_->error() calls following OpenROAD conventions. assert(tree != nullptr) is replaced with logger error GRT 610 and assert(constants_.min_routing_layer + 1 < grid_graph_->getNumLayers()) is replaced with logger error GRT 611. Removed unused #include <cassert>. Raw asserts crash silently in release builds while logger_->error() provides proper error reporting consistent with the rest of the codebase.

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces assert calls with logger_->error for better error reporting, which is a good improvement. I've found one potential issue in mazeRoute where using logger_->error could lead to an inconsistent program state. I've suggested using logger_->warn and continuing to the next net to make the router more robust. The other changes look good.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
@Divinesoumyadip
Copy link
Copy Markdown
Contributor Author

@eder-matheus Kindly review it .Thnaks in advance.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Member

@eder-matheus eder-matheus left a comment

Choose a reason for hiding this comment

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

Jenkins is failing on multiple CUGR tests. Investigate why it's happening.

sortNetIndices(net_indices);
for (const int net_index : net_indices) {
if (gr_nets_[net_index]->getNumPins() < 2) {
continue;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why removing the continue here? If this check isn't relevant, you can just remove the if. But I think they are actually relevant, so restore them.

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"


auto& routing_tree = net->getRoutingTree();
if (!routing_tree) {
continue;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Restore continue or explain why removing it.

for (int layer = 0; layer < grid_graph_->getNumLayers(); layer++) {
odb::dbTechLayer* db_layer = db_tech->findRoutingLayer(layer + 1);
if (db_layer == nullptr) {
continue;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Restore continue or explain why removing it.

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@Divinesoumyadip
Copy link
Copy Markdown
Contributor Author

@eder-matheus All continue statements have been restored.The continue statements for if (!routing_tree) and if (db_layer == nullptr) were accidentally removed in an earlier commit , they are now fully restored in the latest push.

@eder-matheus eder-matheus enabled auto-merge March 24, 2026 16:15
@eder-matheus eder-matheus merged commit 12a569e into The-OpenROAD-Project:master Mar 25, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grt: replace assert with logger error in CUGR maze route

2 participants