Skip to content

Commit

Permalink
gui: ensure that a timing report generated by clicking on the slack h…
Browse files Browse the repository at this point in the history
…istogram shows only endpoints of the selected pathgroup filter

Signed-off-by: Arthur Koucher <[email protected]>
  • Loading branch information
AcKoucher committed Jul 26, 2024
1 parent 9a6e277 commit 1ab14aa
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 24 deletions.
8 changes: 5 additions & 3 deletions src/gui/src/chartsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ void ChartsWidget::updatePathGroupMenuIndexes()
{
if (filters_menu_->count() != 0) {
filters_menu_->clear();
path_group_name_.clear();
}

filters_menu_->addItem("No Path Group"); // Index 0
Expand Down Expand Up @@ -422,7 +423,7 @@ void ChartsWidget::emitEndPointsInBucket(const int bar_index)
++pin_count;
}

emit endPointsToReport(report_pins);
emit endPointsToReport(report_pins, path_group_name_);
}

void ChartsWidget::setBucketInterval()
Expand Down Expand Up @@ -651,10 +652,11 @@ void ChartsWidget::changePathGroupFilter()
const int filter_index = filters_menu_->currentIndex();

if (filter_index > 0) {
std::string path_group = filter_index_to_path_group_name_.at(filter_index);
end_point_to_slack = stagui_->getEndPointToSlackMap(path_group);
path_group_name_ = filter_index_to_path_group_name_.at(filter_index);
end_point_to_slack = stagui_->getEndPointToSlackMap(path_group_name_);
setLimits(end_point_to_slack);
} else {
path_group_name_.clear();
end_points = stagui_->getEndPoints();
removeUnconstrainedPinsAndSetLimits(end_points);
}
Expand Down
4 changes: 3 additions & 1 deletion src/gui/src/chartsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class ChartsWidget : public QDockWidget
}

signals:
void endPointsToReport(const std::set<const sta::Pin*>& report_pins);
void endPointsToReport(const std::set<const sta::Pin*>& report_pins,
const std::string& path_group_name);

private slots:
void changeMode();
Expand Down Expand Up @@ -170,6 +171,7 @@ class ChartsWidget : public QDockWidget
QValueAxis* axis_y_;
QPushButton* refresh_filters_button_;

std::string path_group_name_; // Current selected filter
std::set<sta::Clock*> clocks_;
std::unique_ptr<Buckets> buckets_;
std::map<int, std::string> filter_index_to_path_group_name_;
Expand Down
5 changes: 3 additions & 2 deletions src/gui/src/mainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,8 @@ void MainWindow::saveDesign()

#ifdef ENABLE_CHARTS
void MainWindow::reportSlackHistogramPaths(
const std::set<const sta::Pin*>& report_pins)
const std::set<const sta::Pin*>& report_pins,
const std::string& path_group_name)
{
if (!timing_widget_->isVisible()) {
timing_widget_->show();
Expand All @@ -1695,7 +1696,7 @@ void MainWindow::reportSlackHistogramPaths(
timing_widget_->raise();
}

timing_widget_->reportSlackHistogramPaths(report_pins);
timing_widget_->reportSlackHistogramPaths(report_pins, path_group_name);
}
#endif
} // namespace gui
3 changes: 2 additions & 1 deletion src/gui/src/mainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ class MainWindow : public QMainWindow, public ord::OpenRoadObserver
void openDesign();
void saveDesign();
#ifdef ENABLE_CHARTS
void reportSlackHistogramPaths(const std::set<const sta::Pin*>& report_pins);
void reportSlackHistogramPaths(const std::set<const sta::Pin*>& report_pins,
const std::string& path_group_name);
#endif

protected:
Expand Down
10 changes: 6 additions & 4 deletions src/gui/src/staGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,25 +280,27 @@ void TimingPathsModel::sort(int col_index, Qt::SortOrder sort_order)
void TimingPathsModel::populateModel(
const std::set<const sta::Pin*>& from,
const std::vector<std::set<const sta::Pin*>>& thru,
const std::set<const sta::Pin*>& to)
const std::set<const sta::Pin*>& to,
const std::string& path_group_name)
{
beginResetModel();
timing_paths_.clear();
populatePaths(from, thru, to);
populatePaths(from, thru, to, path_group_name);
endResetModel();
}

bool TimingPathsModel::populatePaths(
const std::set<const sta::Pin*>& from,
const std::vector<std::set<const sta::Pin*>>& thru,
const std::set<const sta::Pin*>& to)
const std::set<const sta::Pin*>& to,
const std::string& path_group_name)
{
// On lines of DataBaseHandler
QApplication::setOverrideCursor(Qt::WaitCursor);

const bool sta_max = sta_->isUseMax();
sta_->setUseMax(is_setup_);
timing_paths_ = sta_->getTimingPaths(from, thru, to);
timing_paths_ = sta_->getTimingPaths(from, thru, to, path_group_name);
sta_->setUseMax(sta_max);

QApplication::restoreOverrideCursor();
Expand Down
6 changes: 4 additions & 2 deletions src/gui/src/staGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,17 @@ class TimingPathsModel : public QAbstractTableModel
void resetModel();
void populateModel(const std::set<const sta::Pin*>& from,
const std::vector<std::set<const sta::Pin*>>& thru,
const std::set<const sta::Pin*>& to);
const std::set<const sta::Pin*>& to,
const std::string& path_group_name);

public slots:
void sort(int col_index, Qt::SortOrder sort_order) override;

private:
bool populatePaths(const std::set<const sta::Pin*>& from,
const std::vector<std::set<const sta::Pin*>>& thru,
const std::set<const sta::Pin*>& to);
const std::set<const sta::Pin*>& to,
const std::string& path_group_name);

STAGuiInterface* sta_;
bool is_setup_;
Expand Down
11 changes: 9 additions & 2 deletions src/gui/src/staGuiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,13 +990,14 @@ std::unique_ptr<TimingPathNode> STAGuiInterface::getTimingNode(

TimingPathList STAGuiInterface::getTimingPaths(const sta::Pin* thru) const
{
return getTimingPaths({}, {{thru}}, {});
return getTimingPaths({}, {{thru}}, {}, "" /* path group name */);
}

TimingPathList STAGuiInterface::getTimingPaths(
const StaPins& from,
const std::vector<StaPins>& thrus,
const StaPins& to) const
const StaPins& to,
const std::string& path_group_name) const
{
TimingPathList paths;

Expand Down Expand Up @@ -1063,7 +1064,13 @@ TimingPathList STAGuiInterface::getTimingPaths(
false,
false);

sta::PathGroup* path_group
= search->findPathGroup(path_group_name.c_str(), sta::MinMax::max());
for (auto& path_end : path_ends) {
if (path_group && path_group != search->pathGroup(path_end)) {
continue;
}

TimingPath* timing_path = new TimingPath();
sta::Path* path = path_end->path();

Expand Down
3 changes: 2 additions & 1 deletion src/gui/src/staGuiInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ class STAGuiInterface

TimingPathList getTimingPaths(const StaPins& from,
const std::vector<StaPins>& thrus,
const StaPins& to) const;
const StaPins& to,
const std::string& path_group_name) const;
TimingPathList getTimingPaths(const sta::Pin* thru) const;

std::unique_ptr<TimingPathNode> getTimingNode(const sta::Pin* pin) const;
Expand Down
14 changes: 8 additions & 6 deletions src/gui/src/timingWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,17 @@ void TimingWidget::populatePaths()
const auto thru = settings_->getThruPins();
const auto to = settings_->getToPins();

populateAndSortModels(from, thru, to);
populateAndSortModels(from, thru, to, "" /* path group name */);
}

void TimingWidget::populateAndSortModels(
const std::set<const sta::Pin*>& from,
const std::vector<std::set<const sta::Pin*>>& thru,
const std::set<const sta::Pin*>& to)
const std::set<const sta::Pin*>& to,
const std::string& path_group_name)
{
setup_timing_paths_model_->populateModel(from, thru, to);
hold_timing_paths_model_->populateModel(from, thru, to);
setup_timing_paths_model_->populateModel(from, thru, to, path_group_name);
hold_timing_paths_model_->populateModel(from, thru, to, path_group_name);

// honor selected sort
auto setup_header = setup_timing_table_view_->horizontalHeader();
Expand Down Expand Up @@ -732,10 +733,11 @@ void TimingWidget::showSettings()

#ifdef ENABLE_CHARTS
void TimingWidget::reportSlackHistogramPaths(
const std::set<const sta::Pin*>& report_pins)
const std::set<const sta::Pin*>& report_pins,
const std::string& path_group_name)
{
clearPathDetails();
populateAndSortModels({}, {report_pins}, {});
populateAndSortModels({}, {report_pins}, {}, path_group_name);
}
#endif

Expand Down
6 changes: 4 additions & 2 deletions src/gui/src/timingWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class TimingWidget : public QDockWidget

void updatePaths();
#ifdef ENABLE_CHARTS
void reportSlackHistogramPaths(const std::set<const sta::Pin*>& report_pins);
void reportSlackHistogramPaths(const std::set<const sta::Pin*>& report_pins,
const std::string& path_group_name);
#endif

signals:
Expand Down Expand Up @@ -141,7 +142,8 @@ class TimingWidget : public QDockWidget
void addCommandsMenuActions();
void populateAndSortModels(const std::set<const sta::Pin*>& from,
const std::vector<std::set<const sta::Pin*>>& thru,
const std::set<const sta::Pin*>& to);
const std::set<const sta::Pin*>& to,
const std::string& path_group_name);
void setInitialColumnsVisibility(const QVariant& columns_visibility);
QVariantList getColumnsVisibility() const;

Expand Down

0 comments on commit 1ab14aa

Please sign in to comment.