The-OpenROAD-Project / OpenROAD

OpenROAD's unified application implementing an RTL-to-GDS Flow. Documentation at https://openroad.readthedocs.io/en/latest/
https://theopenroadproject.org/
BSD 3-Clause "New" or "Revised" License
1.64k stars 564 forks source link

odb: write_odb fails with not so pretty iostream message #6120

Closed titan73 closed 2 weeks ago

titan73 commented 2 weeks ago

Describe the bug

See title.

Expected Behavior

write_db should succeed.

Environment

v2.0-16855-ga15114a95

To Reproduce

openroad test.tcl

write_db.zip

Relevant log output

No response

Screenshots

No response

Additional Context

No response

eder-matheus commented 2 weeks ago

@titan73 If I manually create the dbs directory, the command don't fail. I'm not sure if any of our write commands should create directories. @maliberty any comments?

titan73 commented 2 weeks ago

@eder-matheus yeah indeed I've just figured out that dbs folder was removed but the error message was not very helpful and I couldn't pinpoint the problem. I don't expect write_db to create the folder but that would propably be good to have a error message complaining about the missing "dbs" folder.

maliberty commented 2 weeks ago

What was the message?

maliberty commented 2 weeks ago

I don't think there is any change here so "anymore" seems inaccurate.

eder-matheus commented 2 weeks ago

What was the message?

@maliberty This: Error: test.tcl, 8 basic_ios::clear: iostream error (failed to open 'dbs/floorplan.odb.1'): iostream error.

My guess is that we are not checking if the file was properly created before trying to write to it.

maliberty commented 2 weeks ago

"failed to open" is pretty clear that it is a file system error but we could make it prettier.

titan73 commented 2 weeks ago

Updated title.

Indeed the message says what's wrong. I got confused with its complicated message (like an assert) and thought there was a bug. So nothing wrong actually but yes a better message could be nice. Btw is this message sent to the logger? And I don't understand. The message refers to file 'dbs/floorplan.odb.1' but the file is 'dbs/floorplan.odb'. What is this '.1'?

titan73 commented 2 weeks ago

It actually goes to the logger.

titan73 commented 2 weeks ago

read_db has a better error message:

>>> read_db foo/bar
[ERROR ORD-0007] foo/bar does not exist.

You can assigned this issue to me. I'll send a PR.

titan73 commented 2 weeks ago

Fixed by merged PR https://github.com/The-OpenROAD-Project/OpenROAD/pull/6133.