33
44#include " staGui.h"
55
6+ #include < qchar.h>
7+ #include < qglobal.h>
8+
69#include < QAbstractItemView>
710#include < QAction>
811#include < QApplication>
1518#include < cstddef>
1619#include < fstream>
1720#include < functional>
18- #include < iostream>
1921#include < iterator>
2022#include < limits>
2123#include < map>
3032#include " dbDescriptors.h"
3133#include " db_sta/dbNetwork.hh"
3234#include " db_sta/dbSta.hh"
35+ #include " gui/gui.h"
3336#include " odb/db.h"
3437#include " odb/dbObject.h"
3538#include " odb/dbShape.h"
3639#include " odb/geom.h"
40+ #include " sta/Clock.hh"
3741#include " sta/Corner.hh"
3842#include " sta/PatternMatch.hh"
3943#include " sta/Units.hh"
@@ -266,26 +270,28 @@ void TimingPathsModel::populateModel(
266270 const std::set<const sta::Pin*>& from,
267271 const std::vector<std::set<const sta::Pin*>>& thru,
268272 const std::set<const sta::Pin*>& to,
269- const std::string& path_group_name)
273+ const std::string& path_group_name,
274+ sta::ClockSet* clks)
270275{
271276 beginResetModel ();
272277 timing_paths_.clear ();
273- populatePaths (from, thru, to, path_group_name);
278+ populatePaths (from, thru, to, path_group_name, clks );
274279 endResetModel ();
275280}
276281
277282bool TimingPathsModel::populatePaths (
278283 const std::set<const sta::Pin*>& from,
279284 const std::vector<std::set<const sta::Pin*>>& thru,
280285 const std::set<const sta::Pin*>& to,
281- const std::string& path_group_name)
286+ const std::string& path_group_name,
287+ sta::ClockSet* clks)
282288{
283289 // On lines of DataBaseHandler
284290 QApplication::setOverrideCursor (Qt::WaitCursor);
285291
286292 const bool sta_max = sta_->isUseMax ();
287293 sta_->setUseMax (is_setup_);
288- timing_paths_ = sta_->getTimingPaths (from, thru, to, path_group_name);
294+ timing_paths_ = sta_->getTimingPaths (from, thru, to, path_group_name, clks );
289295 sta_->setUseMax (sta_max);
290296
291297 QApplication::restoreOverrideCursor ();
@@ -1117,6 +1123,9 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
11171123 layout_(new QFormLayout),
11181124 path_count_spin_box_(new QSpinBox(this )),
11191125 corner_box_(new QComboBox(this )),
1126+ clock_box_(new DropdownCheckboxes(QString(" Select Clocks" ),
1127+ QString(" All Clocks" ),
1128+ this)),
11201129 unconstrained_(new QCheckBox(this )),
11211130 one_path_per_endpoint_(new QCheckBox(this )),
11221131 expand_clk_(new QCheckBox(this )),
@@ -1132,6 +1141,7 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
11321141 layout_->addRow (" Paths:" , path_count_spin_box_);
11331142 layout_->addRow (" Expand clock:" , expand_clk_);
11341143 layout_->addRow (" Corner:" , corner_box_);
1144+ layout_->addRow (" Clock filter:" , clock_box_);
11351145
11361146 setupPinRow (" From:" , from_);
11371147 setThruPin ({});
@@ -1250,6 +1260,20 @@ void TimingControlsDialog::populate()
12501260 }
12511261
12521262 corner_box_->setCurrentIndex (selection);
1263+
1264+ for (auto clk : *sta_->getClocks ()) {
1265+ QString clk_name = clk->name ();
1266+
1267+ if (qstring_to_clk_.count (clk_name) != 1 ) {
1268+ qstring_to_clk_[clk_name] = clk;
1269+ QStandardItem* item = new QStandardItem (clk_name);
1270+
1271+ item->setFlags (Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
1272+ item->setData (Qt::Checked, Qt::CheckStateRole);
1273+
1274+ clock_box_->model ()->appendRow (item);
1275+ }
1276+ }
12531277}
12541278
12551279void TimingControlsDialog::setPinSelections ()
@@ -1332,4 +1356,12 @@ std::vector<std::set<const sta::Pin*>> TimingControlsDialog::getThruPins() const
13321356 }
13331357 return pins;
13341358}
1335- } // namespace gui
1359+
1360+ void TimingControlsDialog::getClocks (sta::ClockSet* clock_set) const
1361+ {
1362+ for (const auto & clk_name : clock_box_->selectedItems ()) {
1363+ clock_set->insert (qstring_to_clk_[clk_name]);
1364+ }
1365+ }
1366+
1367+ } // namespace gui
0 commit comments