Skip to content

expose libertybuilder for 3DIC support in dbsta#362

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:sta_fix_bazel_stuff
May 13, 2026
Merged

expose libertybuilder for 3DIC support in dbsta#362
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:sta_fix_bazel_stuff

Conversation

@dsengupta0628
Copy link
Copy Markdown
Contributor

Added liberty/LibertyBuilder.hh to OpenSTA's public hdrs list in src/sta/BUILD. Same section already exports other private headers needed by SWIG; mine joins that block with a comment explaining why dbSta needs it.
Needed by dbSta for 3DIC support The-OpenROAD-Project/OpenROAD#10417

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
@dsengupta0628 dsengupta0628 self-assigned this May 13, 2026
Copy link
Copy Markdown

@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 adds the liberty/LibertyBuilder.hh header to the exported headers in the BUILD file to enable programmatic LibertyCell synthesis. The review feedback correctly identifies that several transitive dependencies required by this header are currently private, which will lead to compilation errors for external consumers. It is recommended to export the additional headers as suggested.

Comment thread BUILD
Comment on lines +365 to +366
# Needed by src/dbSta to synthesize LibertyCells programmatically.
"liberty/LibertyBuilder.hh",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The header liberty/LibertyBuilder.hh includes several other headers that are not currently exported in the hdrs list, such as MinMax.hh, Transition.hh, LibertyClass.hh, and ConcreteLibrary.hh.

Since these headers are located in the liberty/ directory and are currently private (only included in srcs via glob), any external consumer like dbSta that includes LibertyBuilder.hh will fail to compile because these transitive dependencies will not be found. Additionally, LibertyBuilder.hh uses types like LibertyCell, LibertyPort, and TimingArcSet whose definitions are in these private headers.

You should export these dependencies as well to make LibertyBuilder.hh usable by external components.

Suggested change
# Needed by src/dbSta to synthesize LibertyCells programmatically.
"liberty/LibertyBuilder.hh",
# Needed by src/dbSta to synthesize LibertyCells programmatically.
"liberty/LibertyBuilder.hh",
"liberty/LibertyClass.hh",
"liberty/Transition.hh",
"liberty/MinMax.hh",
"liberty/ConcreteLibrary.hh",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are wrong.

  1. All four headers ARE already public, under src/sta/include/sta/:
    - MinMax.hh, Transition.hh, LibertyClass.hh, ConcreteLibrary.hh.
  2. They're already in hdrs via glob(["include/sta/*.hh"]) at line 350 — that glob picks all four up.
  3. include/sta is already in the propagated includes at line 388. Bazel propagates includes to every consumer of the OpenSTA library, so a bare #include "MinMax.hh" from LibertyBuilder.hh resolves to include/sta/MinMax.hh automatically — no layering violation.

The reason LibertyBuilder.hh uses bare names ("MinMax.hh") instead of "sta/MinMax.hh" is that OpenSTA's PRIVATE compile flags include -Iinclude/sta, AND Bazel publishes that same path to consumers via includes. Both internal and external compiles see those bare names resolve cleanly.

@maliberty maliberty merged commit 6766779 into The-OpenROAD-Project:master May 13, 2026
7 checks passed
@openroad-ci openroad-ci deleted the sta_fix_bazel_stuff branch May 13, 2026 20:59
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.

2 participants