Skip to content

Commit f77fc15

Browse files
committed
dbSta: enable computation of LoLs in wrapping code
Signed-off-by: Mike Inouye <mikeinouye@google.com>
1 parent 53ec684 commit f77fc15

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/dbSta/include/db_sta/dbSta.hh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ class dbSta : public Sta, public odb::dbDatabaseObserver
206206
bool exclude_buffers,
207207
bool exclude_inverters) const;
208208

209+
// Get the levels of logic for all endpoints.
210+
std::vector<int> levelsOfLogic(bool exclude_buffers,
211+
bool exclude_inverters) const;
212+
209213
utl::Logger* getLogger() { return logger_; }
210214

211215
// Sanity checkers

src/dbSta/src/dbSta.cc

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -817,12 +817,11 @@ void dbSta::reportTimingHistogram(int num_bins,
817817
histogram.report(/*precision=*/3);
818818
}
819819

820-
void dbSta::reportLogicDepthHistogram(int num_bins,
821-
bool exclude_buffers,
820+
std::vector<int> dbSta::levelsOfLogic(bool exclude_buffers,
822821
bool exclude_inverters) const
823822
{
824-
utl::Histogram<int> histogram(logger_);
825-
823+
std::vector<int> depths;
824+
depths.reserve(sta_->endpoints().size());
826825
sta_->worstSlack(MinMax::max()); // Update timing.
827826
for (sta::Vertex* vertex : sta_->endpoints()) {
828827
int path_length = 0;
@@ -843,9 +842,19 @@ void dbSta::reportLogicDepthHistogram(int num_bins,
843842
}
844843
path = path->prevPath();
845844
}
846-
histogram.addData(path_length);
845+
depths.push_back(path_length);
847846
}
847+
return depths;
848+
}
848849

850+
void dbSta::reportLogicDepthHistogram(int num_bins,
851+
bool exclude_buffers,
852+
bool exclude_inverters) const
853+
{
854+
utl::Histogram<int> histogram(logger_);
855+
for (int depth : levelsOfLogic(exclude_buffers, exclude_inverters)) {
856+
histogram.addData(depth);
857+
}
849858
histogram.generateBins(num_bins);
850859
histogram.report();
851860
}

0 commit comments

Comments
 (0)