Skip to content

Commit b7d1fe9

Browse files
committed
gui: add path group filtering to the timing report
Signed-off-by: LucasYuki <[email protected]>
1 parent 6f95421 commit b7d1fe9

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

src/gui/src/staGui.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
11251125
clock_box_(new DropdownCheckboxes(QString("Select Clocks"),
11261126
QString("All Clocks"),
11271127
this)),
1128+
path_group_box_(new QComboBox(this)),
11281129
unconstrained_(new QCheckBox(this)),
11291130
one_path_per_endpoint_(new QCheckBox(this)),
11301131
expand_clk_(new QCheckBox(this)),
@@ -1143,6 +1144,7 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
11431144
layout_->addRow("Expand clock:", expand_clk_);
11441145
layout_->addRow("Corner:", corner_box_);
11451146
layout_->addRow("Clock filter:", clock_box_);
1147+
layout_->addRow("Path group filter:", path_group_box_);
11461148

11471149
setupPinRow("From:", from_);
11481150
setThruPin({});
@@ -1201,17 +1203,15 @@ QSize TimingControlsDialog::sizeHint() const
12011203
{
12021204
int width = minimumWidth();
12031205
int top = 0, bottom = 0;
1204-
if (layout())
1205-
{
1206+
if (layout()) {
12061207
layout()->getContentsMargins(nullptr, &top, nullptr, &bottom);
12071208
}
12081209
int top2 = 0, bottom2 = 0;
1209-
if (scroll_->layout())
1210-
{
1210+
if (scroll_->layout()) {
12111211
scroll_->layout()->getContentsMargins(nullptr, &top2, nullptr, &bottom2);
12121212
}
12131213

1214-
int height = content_widget_->size().height()+top+bottom+top2+bottom2;
1214+
int height = content_widget_->size().height() + top + bottom + top2 + bottom2;
12151215
return QSize(width, height);
12161216
}
12171217

@@ -1290,7 +1290,6 @@ void TimingControlsDialog::populate()
12901290
selection = 0;
12911291
}
12921292
}
1293-
12941293
corner_box_->setCurrentIndex(selection);
12951294

12961295
for (auto clk : *sta_->getClocks()) {
@@ -1306,6 +1305,24 @@ void TimingControlsDialog::populate()
13061305
clock_box_->model()->appendRow(item);
13071306
}
13081307
}
1308+
1309+
int selected_path = 0;
1310+
if (path_group_box_->count() > 0) {
1311+
selected_path = path_group_box_->currentIndex();
1312+
}
1313+
1314+
path_group_box_->clear();
1315+
filter_index_to_path_group_name_.clear();
1316+
path_group_box_->addItem("No Path Group");
1317+
filter_index_to_path_group_name_[0] = "";
1318+
1319+
int filter_index = 1;
1320+
for (const std::string& name : sta_->getGroupPathsNames()) {
1321+
path_group_box_->addItem(name.c_str());
1322+
filter_index_to_path_group_name_[filter_index] = name;
1323+
++filter_index;
1324+
}
1325+
path_group_box_->setCurrentIndex(selected_path);
13091326
}
13101327

13111328
void TimingControlsDialog::setPinSelections()
@@ -1396,4 +1413,9 @@ void TimingControlsDialog::getClocks(sta::ClockSet* clock_set) const
13961413
}
13971414
}
13981415

1416+
std::string TimingControlsDialog::getPathGroup() const
1417+
{
1418+
return filter_index_to_path_group_name_.at(path_group_box_->currentIndex());
1419+
}
1420+
13991421
} // namespace gui

src/gui/src/staGui.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ class TimingControlsDialog : public QDialog
408408
std::vector<std::set<const sta::Pin*>> getThruPins() const;
409409
std::set<const sta::Pin*> getToPins() const { return to_->getPins(); }
410410
void getClocks(sta::ClockSet* clock_set) const;
411+
std::string getPathGroup() const;
411412

412413
const sta::Pin* convertTerm(Gui::Term term) const;
413414

@@ -434,6 +435,8 @@ class TimingControlsDialog : public QDialog
434435
QSpinBox* path_count_spin_box_;
435436
QComboBox* corner_box_;
436437
DropdownCheckboxes* clock_box_;
438+
QComboBox* path_group_box_;
439+
std::map<int, std::string> filter_index_to_path_group_name_;
437440

438441
QCheckBox* unconstrained_;
439442
QCheckBox* one_path_per_endpoint_;
@@ -446,7 +449,7 @@ class TimingControlsDialog : public QDialog
446449
QScrollArea* scroll_;
447450
QWidget* content_widget_;
448451

449-
static constexpr int kThruStartRow = 4;
452+
static constexpr int kThruStartRow = 5;
450453

451454
void setPinSelections();
452455

src/gui/src/timingWidget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,9 @@ void TimingWidget::populatePaths()
634634
const auto to = settings_->getToPins();
635635
sta::ClockSet* clks = new sta::ClockSet;
636636
settings_->getClocks(clks);
637+
const auto path_group = settings_->getPathGroup();
637638

638-
populateAndSortModels(from, thru, to, "" /* path group name */, clks);
639+
populateAndSortModels(from, thru, to, path_group, clks);
639640
}
640641

641642
void TimingWidget::populateAndSortModels(

0 commit comments

Comments
 (0)