Skip to content

est: make OpenSTA's parasitic entries before making parasitics - #11652

Closed
oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:est-parasitics-entries
Closed

oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:est-parasitics-entries

Conversation

@oharboe

@oharboe oharboe commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

OpenSTA's parasitics store now finds and makes parasitics without a lock (parallaxsw/OpenSTA a54fb953..b7d866ff). It needs an entry for every driver and its net made up front, by Parasitics::ensureParasitics, and makeParasiticNetwork no longer adds a missing one. est makes its own stores and never makes the entries, so after the next OpenSTA bump the first estimate_parasitics segfaults in makeParasiticNetwork, even at one thread.

This PR makes est create the entries, so the bump can go in without a crash. With the OpenSTA OpenROAD pins today, it changes nothing.

What

  • After each new store (estimateWireParasitics, estimateGlobalRouteRC, MakeWireParasitics::clearParasitics): make the entries for the whole design, before the parallel loops.
  • Serial single-net paths (ensureWireParasitic, estimateWireParasitic(net), estimateGlobalRouteRC(net), estimateGlobalRouteParasitics, updateGlobalRouteParasitics, makeWireParasitic): make the entries for the net's drivers, since the net may have been made after the store (repair_design's buffers).
  • eraseParasitics: skip a net with no entry, since deleteParasiticNetwork now needs one.
  • TestLambertW: make the driver's entry, and build on the net the store keys it by (highestConnectedNet).

The calls go through a requires expression in src/est/src/StaParasiticsEntries.h. Against today's OpenSTA they compile to nothing; once the bump is in, they can become plain calls.

Hierarchical designs need an OpenSTA fix too

In -hier mode, two places in OpenSTA make an entry under a different net than est uses: the top-level-port branch of findParasiticNet, and read_spef -path. That crashes pinswap_hier, repair_fanout1_hier and read_vcd, and est cannot fix it. It is filed as parallaxsw/OpenSTA#524.

Tests

The est, rsz, grt, cts and dbSta tests (3076), plus a stress script (aes: 20× estimate_parasitics -placement at 16 threads compared pin by pin with 1 thread, then repair_design, repair_timing):

OpenSTA under this PR master's est this PR
today's pin (e983e15b) all pass all pass
pin + lock removal (5 commits cherry-picked) segfault in est_placement_threads and the stress script all pass with parallaxsw/OpenSTA#524

report_checks -group_path_count 200 -format end -digits 6 after the stress script is byte-identical to master in every passing row. No new test: with today's OpenSTA there is nothing to observe, and after the bump the tests above cover it.

The lock removal in OpenSTA is the heavy lifting; this only keeps est in step with it. Claude made the changes and stared at paint drying, which is how beta-testing works these days.

🤖 Generated with Claude Code

OpenSTA's parasitics store now finds and makes parasitics without a
lock (parallaxsw/OpenSTA a54fb953..b7d866ff). For that, every driver
and its net need an entry, made by Parasitics::ensureParasitics before
any thread uses the store, and makeParasiticNetwork no longer adds a
missing one. est makes its own stores and never calls it, so the first
estimate_parasitics after the next OpenSTA bump segfaults in
makeParasiticNetwork, even at one thread.

est now makes the entries for the whole design after each new store,
before the parallel loops, and for a net's drivers on the serial
single-net paths that may see a net made after the store. A net with
no entry is not deleted, since deleteParasiticNetwork needs the entry.
TestLambertW makes its driver's entry and builds on the net the store
keys it by.

The calls go through a requires-expression, so with the OpenSTA
OpenROAD pins today they compile to nothing and nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe
oharboe requested review from a team as code owners October 7, 2026 06:16
@github-actions github-actions Bot added the size/S label Oct 7, 2026

@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 integrates with OpenSTA's lock-free parasitics store by ensuring parasitics entries are created for net drivers before networks are built. It introduces a helper header StaParasiticsEntries.h and updates EstimateParasitics and MakeWireParasitics to invoke these helpers during parasitic estimation and routing updates. The review feedback focuses on improving robustness by adding nullptr checks for parasitics, drvr_pin, and net across several of the newly introduced or modified functions to prevent potential segmentation faults.

Comment thread src/est/src/StaParasiticsEntries.h
Comment thread src/est/src/StaParasiticsEntries.h
Comment thread src/est/src/EstimateParasitics.cpp
Comment thread src/est/src/EstimateParasitics.cpp
@oharboe

oharboe commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

@jhkim-pii @maliberty @eder-matheus without changes, OpenROAD will crash on next opensta upgrade, this is a future proofing PR.

Anything more needed from me?

@oharboe

oharboe commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

The pr-merge CI failure is unrelated and should fix itself when it runs next.

@eder-matheus

Copy link
Copy Markdown
Member

Some Claude review:

  • question: OpenSTA upstream has changed since this PR was written. In
    parallaxsw/OpenSTA 6d8f13f2 ("ensure parasitics", Oct 8),
    makeParasiticNetwork try_emplaces a missing net entry again and adds the
    driver entries itself (ensureReducedParasitics). deleteParasiticNetwork
    also no longer fails when the entry is missing. becb3294 fixes issue while repairing hold violation on input pin #524,
    which is now closed. So against what the bump will pull in, est no longer
    segfaults "even at one thread". The part that is still needed is the
    whole-store ensureParasitics() before the two omp loops. Without it, the
    threads try_emplace into the same std::map at once: a silent data race,
    not a crash. Can you re-run the matrix against current parallaxsw/master
    and check whether these are still needed:
    the per-net calls on the serial paths, the eraseParasitics guard, and the
    TestLambertW ensure call?

  • src/est/src/StaParasiticsEntries.h:11-15 The comment "makeParasiticNetwork
    no longer adds the entry itself" no longer matches upstream. The reason to
    keep these calls is lock-free parallel access, not a missing entry.

  • src/est/src/EstimateParasitics.cpp:129 stale comment: "The parasitics store
    locks its own writes". After the bump this loop is safe only because
    clearParasitics() / estimateGlobalRouteRC() made the entries first. This is
    the comment a future reader will rely on, so please update it here.

  • nit: the member makeParasiticsEntries(const Net*) has the same name as the
    free est::makeParasiticsEntries(Parasitics*), so every call from a member
    needs the est:: prefix. Consider renaming the member
    (makeNetParasiticsEntries?). The template parameter named Parasitics also
    shadows sta::Parasitics; P would read better.

  • PR description: the "Hierarchical designs need an OpenSTA fix too" section
    is out of date. issue while repairing hold violation on input pin #524 is closed and merged upstream (becb3294).

@oharboe

oharboe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@eder-matheus Can you take it from here?

@oharboe

oharboe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@maliberty OpenROAD will crash on next opensta bump, this PR/patch works for me meanwhile. I think it is more expedient if you handle the opensta bump.

@oharboe oharboe closed this Oct 13, 2026
@eder-matheus

Copy link
Copy Markdown
Member

@eder-matheus Can you take it from here?

Yeah, I can apply the suggested changes from here once we bump opensta version.

@oharboe

oharboe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@eder-matheus Thank you! I'm sure there will be a couple of things to iron out! 😅

@dsengupta0628

Copy link
Copy Markdown
Contributor

Already in the process of being merged STA PR The-OpenROAD-Project/OpenSTA#422
corresponding OpenROAD PR to bump sta pointer and the changes needed to make the new OpenSTA work #11726 (avoid GRT/GPL crashes)

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.

3 participants