-
Notifications
You must be signed in to change notification settings - Fork 864
drt/odb: fix non-determinism on pin access #10085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5cb7027
f98e2c9
a38bf6c
7a67a57
084c2ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -801,7 +801,9 @@ void dbITerm::setAccessPoint(dbMPin* pin, dbAccessPoint* ap) | |
| if (ap != nullptr) { | ||
| iterm->aps_[pin->getImpl()->getOID()] = ap->getImpl()->getOID(); | ||
| _dbAccessPoint* _ap = (_dbAccessPoint*) ap; | ||
| _ap->iterms_.push_back(iterm->getOID()); | ||
| auto& iterms = _ap->iterms_; | ||
| auto pos = std::lower_bound(iterms.begin(), iterms.end(), iterm->getOID()); | ||
| iterms.insert(pos, iterm->getOID()); | ||
|
Comment on lines
+804
to
+806
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this relate to non-determinism? I don’t see how preserving insertion order would introduce non-deterministic behavior.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| } else { | ||
| iterm->aps_[pin->getImpl()->getOID()] = dbId<_dbAccessPoint>(); | ||
| } | ||
eder-matheus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
@@ -861,8 +863,16 @@ std::vector<dbAccessPoint*> dbITerm::getPrefAccessPoints() const | |
| void dbITerm::clearPrefAccessPoints() | ||
| { | ||
| _dbITerm* iterm = (_dbITerm*) this; | ||
| // Clear aps_ map instead of destroying dbAccessPoint object to prevent | ||
| // destroying APs of other iterms. | ||
| _dbBlock* block = (_dbBlock*) iterm->getOwner(); | ||
| // Remove this iterm from each AP's back-reference list before clearing. | ||
| for (auto& [pin_id, ap_id] : iterm->aps_) { | ||
| if (ap_id.isValid()) { | ||
| auto* ap = block->ap_tbl_->getPtr(ap_id); | ||
| auto& iterms = ap->iterms_; | ||
| iterms.erase(std::remove(iterms.begin(), iterms.end(), iterm->getOID()), | ||
eder-matheus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| iterms.end()); | ||
| } | ||
| } | ||
| iterm->aps_.clear(); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.