Skip to content

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

Open
openroad-ci wants to merge 14 commits into
The-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 14 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:odb_reload

Conversation

@openroad-ci

Copy link
Copy Markdown
Member

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/gui/src/layoutTabs.cpp
Comment thread src/dbSta/src/dbSta.cc
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

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

1 similar comment
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

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.

eder-matheus and others added 14 commits April 27, 2026 17:14
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>
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>
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>
@eder-matheus

eder-matheus commented Apr 27, 2026

Copy link
Copy Markdown
Member

@maliberty I've pushed some changes in different tools to ensure that, after reloading the ODB file, their state will also be reset.

I tested with the regression tests under OpenROAD/test, and it's working as expected. The same results are produced when running a single openroad session compared to reloading ODB.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 21 days if no further activity occurs. Remove the Stale label or comment to keep it open.

@github-actions github-actions Bot added the Stale A stale PR or issue subject to automated closure. label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Stale A stale PR or issue subject to automated closure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants