-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ord: Print a simpler message when write_db fails to open file. #6123
Conversation
Signed-off-by: Christian Costa <[email protected]>
For #6120. |
clang-tidy review says "All clean, LGTM! 👍" |
src/OpenRoad.cc
Outdated
utl::StreamHandler stream_handler(filename, true); | ||
db_->write(stream_handler.getStream()); | ||
} catch (const std::ios_base::failure& f) { | ||
logger_->error(ORD, 55, "Cannot write database to {}", filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include the f.what string in the message as it may give more detail on the cause of the failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does write_def or write_lef need similar treatment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes for write_lef. write_def is different with the '.1'. Where does it come from?
>>> write_def foo/bar
[ERROR GUI-0070] No such file or directory: foo/bar.1
>>> write_lef foo/bar
[ERROR GUI-0070] basic_ios::clear: iostream error (failed to open 'foo/bar.1'): iostream error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write_lef might need to write multiple files so they get . suffixes.
write_lef/def are not part of GUI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the case where write_lef write multiple files?
Regarding write_db & write_def, why using a suffix then? Should we use basic iostream instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you read multiple LEFs in you should expect multiple out. I don't expect it on def.
Signed-off-by: Christian Costa <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Christian Costa <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to do this, then the util::StreamHandler would be the place to do it.
As I recall util::StreamHandler went through a number of iterations and lots of review feedback, a lots of tripwires...
I don't understand your suggestion.
What is the purpose of util::StreamHandler? What problem is it supposed to solve? OR uses std::ifstream for reading. |
@titan73 master for the code you propose to change is using utl::StreamHandler today. I think the code reads pretty well and the purpose is pretty clear from the code. If you ask ChatGPT/copilot to explain what it does and why it exists instead of your proposed change, I am pretty sure you will get a satisfactory answer. In this day and age, I consider simple code that ChatGPT/copilot can adequately explain purpose and implementation of sufficiently documented. |
No need for ChapGPT. Seems the code prevents the existing file to be overwritten in case of failure. |
No description provided.