Skip to content

odb: enable reading different odb files in a single openroad session#10072

Open
openroad-ci wants to merge 10 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:odb_reload
Open

odb: enable reading different odb files in a single openroad session#10072
openroad-ci wants to merge 10 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:odb_reload

Conversation

@openroad-ci
Copy link
Copy Markdown
Collaborator

Summary

This PR enables the reload of the database in a single openroad session.

Type of Change

  • New feature

Impact

Allow reading multiple ODB files in the same openroad session.

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).

Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
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 enables the ability to reload a database by clearing the existing state instead of throwing an error when the database is already populated. It introduces a preDbClear observer notification, allowing components like STA, the GUI, and ODB to perform necessary cleanup before the database is reset. Key implementation details include preserving session-level state (observers and loggers) during the database clear process, stopping GUI render threads, and resetting network and tech data. Review feedback suggests ensuring that GUI render threads are fully joined before proceeding with the clear and using the provided database pointer in dbSta to avoid potential null pointer issues during re-initialization.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

clang-tidy review says "All clean, LGTM! 👍"

eder-matheus and others added 3 commits April 7, 2026 21:07
Clear staCell pointers on all masters before freeing the network to
prevent the GUI render thread from accessing freed ConcreteCell objects.
Recreate the default scene after deleteScenes() so cmd_scene_ remains
valid for heatmap settings queries on exit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Call destroyMap() in HeatMapDataSource::setChip when the chip changes
to invalidate cached heatmap data. Fix the MapSettingMultiChoice getter
type from const std::string to std::string to avoid std::function
double-wrapping. Stop render threads in saveSettings before serializing
renderer state to prevent races with the render thread on exit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Override setChip in RoutingCongestionDataSource to reset the cached
layer pointer. Override setChip in RUDYDataSource to reset the cached
rudy pointer, unregister from the old block, and re-register on the
new block. Add GlobalRouter::clearRudy() to delete the cached Rudy
so it is recreated for the new block. Reset layer_, net_, and corner_
in IRDropDataSource::setChip to prevent dangling pointer access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus requested a review from maliberty April 8, 2026 01:02
@maliberty
Copy link
Copy Markdown
Member

How have you verified this change? For example I see nothing that updates tap and it holds an dbDatabase* member.

@eder-matheus
Copy link
Copy Markdown
Member

How have you verified this change? For example I see nothing that updates tap and it holds an dbDatabase* member.

I tested mainly with the GUI, by switching over different ODB files from different stages of the flow. Everything looks fine visually (wires are loaded/removed according to the stage I'm loading, instances are only shown in the ODBs post-floorplan, etc.)

I also tested with a simple script that loads the ODB file and print some data from the design (net count and instance count) and compared it with loading the ODB files on a specific openroad run, and things were also matching.

@maliberty
Copy link
Copy Markdown
Member

You might try load one db, switch to the input to step N, then run step N, verify the result is the same as for that step without the prior load. I expect it will fail for tapcell for example.

@eder-matheus
Copy link
Copy Markdown
Member

You might try load one db, switch to the input to step N, then run step N, verify the result is the same as for that step without the prior load. I expect it will fail for tapcell for example.

Tapcell actually worked, but mainly because its internal state is not so important when reloading ODB and re-running the tool. Everything is computed from scratch again, so I was able to reproduce the same results.

However, I need to reset other tools (like GRT, DPL, CTS, etc.) to ensure that, when reloading ODB, the state of each module is correct to ensure reproducibility.

The current state of my implementation on this branch works for visualization only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants