Skip to content

odb: convert areas from double/int/uint to int64_t#10570

Open
gadfort wants to merge 8 commits into
The-OpenROAD-Project:masterfrom
gadfort:odb-areas
Open

odb: convert areas from double/int/uint to int64_t#10570
gadfort wants to merge 8 commits into
The-OpenROAD-Project:masterfrom
gadfort:odb-areas

Conversation

@gadfort
Copy link
Copy Markdown
Contributor

@gadfort gadfort commented May 31, 2026

Summary

In the database we were incorrectly storing areas as distances or as doubles.
This converts them to int64_t (atleast those I could find), I chose this since it's the return type of Rect::area() so trying to be consistent there.
I searched through the code to find the callers and adjust them (this should be checked carefully).
I added a custom-serial flag to the code generator since I couldn't see a way to change datatype changes nicely.

Type of Change

  • Bug fix
  • Refactoring

Impact

No change expected

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

Related Issues

N/A

gadfort added 5 commits May 31, 2026 10:17
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
@gadfort gadfort requested a review from maliberty May 31, 2026 14:40
@gadfort gadfort requested review from a team as code owners May 31, 2026 14:40
@gadfort gadfort requested a review from eder-matheus May 31, 2026 14:40
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 migrates the storage of area values in the database from double or int to int64_t (in square DBUs) across various technology rules and layers, updating the schema version to 131 and adding backward compatibility for older database files. The review feedback is highly constructive, pointing out a critical migration bug in dbTechLayerCutSpacingRule.cpp where the area was not properly scaled by dbu_per_micron for older schemas. Additionally, the feedback identifies potential integer overflow risks during deserialization in dbTechLayerAreaRule.cpp and dbTechLayerMinCutRule.cpp, and recommends replacing C-style casts with static_cast for improved type safety.

Comment thread src/odb/src/db/dbTechLayerCutSpacingRule.cpp
Comment thread src/odb/src/db/dbTechLayerAreaRule.cpp Outdated
Comment thread src/odb/src/db/dbTechLayerMinCutRule.cpp Outdated
Comment thread src/odb/src/db/dbTechLayer.cpp
Comment thread src/odb/src/db/dbTechLayerSpacingRule.cpp
gadfort added 3 commits May 31, 2026 10:47
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant