Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/drt/src/pa/FlexPA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ void FlexPA::removeDirtyInst(frInst* inst)

void FlexPA::updateDirtyInsts()
{
std::set<UniqueClass*> dirty_unique_classes;
auto cmp = [](UniqueClass* a, UniqueClass* b) { return a->key() < b->key(); };
std::set<UniqueClass*, decltype(cmp)> dirty_unique_classes(cmp);
frOrderedIdSet<frInst*>
pattern_insts; // list of insts that need row pattern generation
for (const auto& inst : dirty_insts_) {
Expand Down
16 changes: 13 additions & 3 deletions src/odb/src/db/dbITerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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>();
}
Expand Down Expand Up @@ -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()),
iterms.end());
}
}
iterm->aps_.clear();
}

Expand Down
Loading