drt/odb: fix non-determinism on pin access#10085
drt/odb: fix non-determinism on pin access#10085eder-matheus merged 5 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
Move the iterms_ sort from dbAccessPoint serialization to insertion time in setAccessPoint, using lower_bound + insert instead of push_back. This keeps the serialization code generator-safe (the previous sort in operator<< was outside user code markers and would be overwritten by the ODB code generator). Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request introduces deterministic ordering for unique classes in FlexPA and improves back-reference management in dbITerm by maintaining sorted iterm lists and cleaning up references during clearing. However, the setAccessPoint implementation is incomplete as it fails to remove old back-references when a pin is reassigned, which can lead to stale data and duplicate entries.
|
@maliberty Secure-CI is passing for these changes. |
|
@osamahammad21 please review and merge if ok |
| auto& iterms = _ap->iterms_; | ||
| auto pos = std::lower_bound(iterms.begin(), iterms.end(), iterm->getOID()); | ||
| iterms.insert(pos, iterm->getOID()); |
There was a problem hiding this comment.
Does this relate to non-determinism? I don’t see how preserving insertion order would introduce non-deterministic behavior.
There was a problem hiding this comment.
It doesn't impact the final result in terms of routing (wire and via location, wire count, etc) but it can impact the final ODB. In the issue, the main concern was different sha1 between the ODBs generated on different runs that must produce the same output. This change in dbITerm ensures that the ODB files will be consistent.
…ROAD into drt_odb_stable
|
@osamahammad21 any other comments? |
3ab4b4a
into
The-OpenROAD-Project:master
Summary
Three fixes for ODB serialization non-determinism: (1)
setAccessPointnow inserts into AP'siterms_in sorted order vialower_boundfor deterministic serialization, (2)clearPrefAccessPointsremoves stale iterm back-references from access points before clearing, and (3)dirty_unique_classesinFlexPA::updateDirtyInstsuses key-based ordering instead of pointer-based to ensure deterministicpin_access_idxassignment across runs.Type of Change
Impact
Ensure stable results when running incremental repairs, specifically incremental pin access.
Verification
./etc/Build.sh).Related Issues
Fixes #10023.