grt: replace assert with logger error in CUGR maze route#9870
grt: replace assert with logger error in CUGR maze route#9870Divinesoumyadip wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
There was a problem hiding this comment.
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.
| if (tree == nullptr) { | ||
| logger_->error(GRT, 610, "Failed to generate Steiner tree for net {}.", net->getName()); | ||
| } |
There was a problem hiding this comment.
Using logger_->error will throw an exception and terminate the mazeRoute function. This will prevent subsequent nets in net_indices from being routed. However, grid_graph_->removeTreeUsage was already called for all these nets in a separate loop before this one (lines 215-217). This will leave the grid graph usage data in an inconsistent state if the exception is caught and the program continues.
To make the router more robust, consider logging a warning and skipping only the failed net. This allows the process to continue for other nets and keeps the program state consistent.
if (tree == nullptr) {
logger_->warn(GRT, 610, "Failed to generate Steiner tree for net {}. Skipping net.", net->getName());
continue;
}|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
|
@eder-matheus Kindly review it .Thnaks in advance. |
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
Fixes #9869
Replaces raw
assertstatements insrc/grt/src/cugr/src/CUGR.cppwith properlogger_->error()calls following OpenROAD conventions.assert(tree != nullptr)is replaced with logger error GRT 610 andassert(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 whilelogger_->error()provides proper error reporting consistent with the rest of the codebase.