From 7e5cf1326bd91fbff90893de14cc3a6401573f15 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 1 May 2025 17:34:51 -0700 Subject: [PATCH] non-determinism in required times resolves orfs #3046 Signed-off-by: James Cherry --- include/sta/Path.hh | 5 ++- include/sta/SearchClass.hh | 2 +- search/Path.cc | 62 +++++++++++--------------------------- search/TagGroup.cc | 8 ++--- 4 files changed, 23 insertions(+), 54 deletions(-) diff --git a/include/sta/Path.hh b/include/sta/Path.hh index 27444e7a..542afbe1 100644 --- a/include/sta/Path.hh +++ b/include/sta/Path.hh @@ -217,15 +217,14 @@ private: void findNext(); const Search *search_; - //bool filtered_; + bool filtered_; const RiseFall *rf_; const PathAnalysisPt *path_ap_; const MinMax *min_max_; Path *paths_; size_t path_count_; - //size_t path_index_; + size_t path_index_; Path *next_; - PathIndexMap::Iterator path_iter_; }; } // namespace diff --git a/include/sta/SearchClass.hh b/include/sta/SearchClass.hh index 2e304781..d9268b94 100644 --- a/include/sta/SearchClass.hh +++ b/include/sta/SearchClass.hh @@ -115,7 +115,7 @@ typedef StringSet PathGroupNameSet; typedef Vector PathEndSeq; typedef Vector ArrivalSeq; typedef Map VertexPathCountMap; -typedef UnorderedMap PathIndexMap; +typedef Map PathIndexMap; typedef Vector SlackSeq; typedef Delay Crpr; typedef Vector PathSeq; diff --git a/search/Path.cc b/search/Path.cc index 670be92f..780af193 100644 --- a/search/Path.cc +++ b/search/Path.cc @@ -697,19 +697,18 @@ Path::lessAll(const Path *path1, VertexPathIterator::VertexPathIterator(Vertex *vertex, const StaState *sta) : search_(sta->search()), - //filtered_(false), + filtered_(false), rf_(nullptr), path_ap_(nullptr), min_max_(nullptr), paths_(vertex->paths()), path_count_(0), - //path_index_(0), + path_index_(0), next_(nullptr) { TagGroup *tag_group = search_->tagGroup(vertex); if (tag_group) { path_count_ = tag_group->pathCount(); - path_iter_.init(tag_group->pathIndexMap()); findNext(); } } @@ -721,19 +720,18 @@ VertexPathIterator::VertexPathIterator(Vertex *vertex, const PathAnalysisPt *path_ap, const StaState *sta) : search_(sta->search()), - //filtered_(true), + filtered_(true), rf_(rf), path_ap_(path_ap), min_max_(nullptr), paths_(vertex->paths()), - //path_count_(0), - //path_index_(0), + path_count_(0), + path_index_(0), next_(nullptr) { TagGroup *tag_group = search_->tagGroup(vertex); if (tag_group) { path_count_ = tag_group->pathCount(); - path_iter_.init(tag_group->pathIndexMap()); findNext(); } } @@ -743,19 +741,18 @@ VertexPathIterator::VertexPathIterator(Vertex *vertex, const MinMax *min_max, const StaState *sta) : search_(sta->search()), - //filtered_(true), + filtered_(true), rf_(rf), path_ap_(nullptr), min_max_(min_max), paths_(vertex->paths()), - //path_count_(0), - //path_index_(0), + path_count_(0), + path_index_(0), next_(nullptr) { TagGroup *tag_group = search_->tagGroup(vertex); if (tag_group) { path_count_ = tag_group->pathCount(); - path_iter_.init(tag_group->pathIndexMap()); findNext(); } } @@ -766,34 +763,22 @@ VertexPathIterator::VertexPathIterator(Vertex *vertex, const MinMax *min_max, const StaState *sta) : search_(sta->search()), - //filtered_(true), + filtered_(true), rf_(rf), path_ap_(path_ap), min_max_(min_max), paths_(vertex->paths()), - //path_count_(0), - //path_index_(0), + path_count_(0), + path_index_(0), next_(nullptr) { TagGroup *tag_group = search_->tagGroup(vertex); if (tag_group) { path_count_ = tag_group->pathCount(); - path_iter_.init(tag_group->pathIndexMap()); findNext(); } } -VertexPathIterator::~VertexPathIterator() -{ -} - -bool -VertexPathIterator::hasNext() -{ - return next_ != nullptr; -} - -#if 0 void VertexPathIterator::findNext() { @@ -818,26 +803,15 @@ VertexPathIterator::findNext() } next_ = nullptr; } -#endif -void -VertexPathIterator::findNext() +VertexPathIterator::~VertexPathIterator() { - while (path_iter_.hasNext()) { - Tag *tag; - size_t path_index; - path_iter_.next(tag, path_index); - if ((rf_ == nullptr - || tag->rfIndex() == rf_->index()) - && (path_ap_ == nullptr - || tag->pathAPIndex() == path_ap_->index()) - && (min_max_ == nullptr - || tag->pathAnalysisPt(search_)->pathMinMax() == min_max_)) { - next_ = &paths_[path_index]; - return; - } - } - next_ = nullptr; +} + +bool +VertexPathIterator::hasNext() +{ + return next_ != nullptr; } Path * diff --git a/search/TagGroup.cc b/search/TagGroup.cc index dfd1fc74..f060463b 100644 --- a/search/TagGroup.cc +++ b/search/TagGroup.cc @@ -131,9 +131,7 @@ TagGroupBldr::TagGroupBldr(bool match_crpr_clk_pin, default_path_count_(sta->corners()->count() * RiseFall::index_count * MinMax::index_count), - path_index_map_(default_path_count_, - TagMatchHash(match_crpr_clk_pin, sta), - TagMatchEqual(match_crpr_clk_pin, sta)), + path_index_map_(TagMatchLess(match_crpr_clk_pin, sta)), paths_(default_path_count_), has_clk_tag_(false), has_genclk_src_tag_(false), @@ -284,9 +282,7 @@ TagGroupBldr::makeTagGroup(TagGroupIndex index, PathIndexMap * TagGroupBldr::makePathIndexMap(const StaState *sta) { - PathIndexMap *path_index_map = new PathIndexMap(path_index_map_.size(), - TagMatchHash(true, sta), - TagMatchEqual(true, sta)); + PathIndexMap *path_index_map = new PathIndexMap(TagMatchLess(true, sta)); size_t path_index = 0; for (auto const [tag, path_index1] : path_index_map_) {