drt: initMazeCost_ap_helper refactor#10040
drt: initMazeCost_ap_helper refactor#10040openroad-ci wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: bnmfw <bernardoborgessandoval@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request refactors initMazeCost_ap_helper in FlexDR_init.cpp to improve readability through early exits and consolidated logic. In FlexGridGraph.h, the correctU method was replaced with a more general correct function. Feedback suggests replacing a std::cout warning with a proper logger error call when failing to find grids for marker costs to ensure critical failures are not missed.
| std::cout << "Warning: marker bloat 4x width but could not find " | ||
| "two grids " | ||
| "to add marker cost\n"; |
There was a problem hiding this comment.
Unexpected failures during the routing flow, such as failing to find grids to add marker cost, should be logged as an error instead of a warning. This ensures that critical failure messages are not missed by the user. Additionally, avoid manual formatting changes and rely on the logger's standard output.
| std::cout << "Warning: marker bloat 4x width but could not find " | |
| "two grids " | |
| "to add marker cost\n"; | |
| logger->error(utl::DRT, 1000, "marker bloat 4x width but could not find two grids to add marker cost"); |
References
- Unexpected failures during the routing flow, such as failing to generate a Steiner tree, should be logged as an error, not a warning. This ensures the end user does not miss critical failure messages.
- Rely on clang-format for code formatting instead of applying manual style changes.
There was a problem hiding this comment.
@maliberty I sometimes find these kinds of "internal DRT errors" which look obsolete/legacy to me, should we transform them into actual error or get rid of them?
There was a problem hiding this comment.
Transform them unless you are certain they can't happen.
|
clang-tidy review says "All clean, LGTM! 👍" |
Summary
the
initMazeCost_ap_helperis verbose and has a lot of unnecessary indentation. I mostly moved things around and applied guards when possible. The function does the exact same thing.Clang-format made some changes by itself when I fed it through the file.
I also used the
reverse()function inside thecorrect()function and eliminatedcorrectU()as it was completely equivalent tocorrect()in every context it was called.Type of Change
Impact
No functional behavior changed
Verification
./etc/Build.sh).Related Issues
#9850