Skip to content

Commit 7e6fbff

Browse files
authored
Merge pull request #2697 from gadfort/gui-sta-endpoints
gui: add option to select just one path per endpoint in staGui
2 parents 5247317 + bc7ec98 commit 7e6fbff

File tree

5 files changed

+33
-1
lines changed

5 files changed

+33
-1
lines changed

src/gui/src/staGui.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
10581058
path_count_spin_box_(new QSpinBox(this)),
10591059
corner_box_(new QComboBox(this)),
10601060
unconstrained_(new QCheckBox(this)),
1061+
one_path_per_endpoint_(new QCheckBox(this)),
10611062
expand_clk_(new QCheckBox(this)),
10621063
from_(new PinSetWidget(false, this)),
10631064
thru_({}),
@@ -1078,6 +1079,7 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
10781079

10791080
setUnconstrained(false);
10801081
layout_->addRow("Unconstrained:", unconstrained_);
1082+
layout_->addRow("One path per endpoint:", one_path_per_endpoint_);
10811083

10821084
setLayout(layout_);
10831085

@@ -1088,6 +1090,10 @@ TimingControlsDialog::TimingControlsDialog(QWidget* parent)
10881090
sta_->setIncludeUnconstrainedPaths(unconstrained_->checkState()
10891091
== Qt::Checked);
10901092
});
1093+
connect(one_path_per_endpoint_, &QCheckBox::stateChanged, [this]() {
1094+
sta_->setOnePathPerEndpoint(one_path_per_endpoint_->checkState()
1095+
== Qt::Checked);
1096+
});
10911097

10921098
connect(corner_box_,
10931099
QOverload<int>::of(&QComboBox::currentIndexChanged),
@@ -1132,6 +1138,12 @@ void TimingControlsDialog::setSTA(sta::dbSta* sta)
11321138
to_->setSTA(sta_->getSTA());
11331139
}
11341140

1141+
void TimingControlsDialog::setOnePathPerEndpoint(bool value)
1142+
{
1143+
sta_->setOnePathPerEndpoint(value);
1144+
one_path_per_endpoint_->setCheckState(value ? Qt::Checked : Qt::Unchecked);
1145+
}
1146+
11351147
void TimingControlsDialog::setUnconstrained(bool unconstrained)
11361148
{
11371149
sta_->setIncludeUnconstrainedPaths(unconstrained);

src/gui/src/staGui.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ class TimingControlsDialog : public QDialog
367367
void setUnconstrained(bool uncontrained);
368368
bool getUnconstrained() const { return sta_->isIncludeUnconstrainedPaths(); }
369369

370+
void setOnePathPerEndpoint(bool value);
371+
bool getOnePathPerEndpoint() const { return sta_->isOnePathPerEndpoint(); }
372+
370373
void setExpandClock(bool expand);
371374
bool getExpandClock() const;
372375

@@ -402,6 +405,7 @@ class TimingControlsDialog : public QDialog
402405
QComboBox* corner_box_;
403406

404407
QCheckBox* unconstrained_;
408+
QCheckBox* one_path_per_endpoint_;
405409
QCheckBox* expand_clk_;
406410

407411
PinSetWidget* from_;

src/gui/src/staGuiInterface.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,12 +693,18 @@ STAGuiInterface::STAGuiInterface(sta::dbSta* sta)
693693
: sta_(sta),
694694
corner_(nullptr),
695695
use_max_(true),
696+
one_path_per_endpoint_(true),
696697
max_path_count_(1000),
697698
include_unconstrained_(false),
698699
include_capture_path_(false)
699700
{
700701
}
701702

703+
int STAGuiInterface::getEndPointCount() const
704+
{
705+
return sta_->endpoints()->size();
706+
}
707+
702708
std::unique_ptr<TimingPathNode> STAGuiInterface::getTimingNode(
703709
sta::Pin* pin) const
704710
{
@@ -776,7 +782,7 @@ TimingPathList STAGuiInterface::getTimingPaths(
776782
use_max_ ? sta::MinMaxAll::max() : sta::MinMaxAll::min(),
777783
// group_count, endpoint_count, unique_pins
778784
max_path_count_,
779-
max_path_count_,
785+
one_path_per_endpoint_ ? 1 : max_path_count_,
780786
true,
781787
-sta::INF,
782788
sta::INF, // slack_min, slack_max,

src/gui/src/staGuiInterface.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ class STAGuiInterface
324324
include_unconstrained_ = value;
325325
}
326326

327+
bool isOnePathPerEndpoint() const { return one_path_per_endpoint_; }
328+
void setOnePathPerEndpoint(bool value) { one_path_per_endpoint_ = value; }
329+
327330
bool isIncludeCapturePaths() const { return include_capture_path_; }
328331
void setIncludeCapturePaths(bool value) { include_capture_path_ = value; }
329332

@@ -341,11 +344,14 @@ class STAGuiInterface
341344

342345
std::vector<std::unique_ptr<ClockTree>> getClockTrees() const;
343346

347+
int getEndPointCount() const;
348+
344349
private:
345350
sta::dbSta* sta_;
346351

347352
sta::Corner* corner_;
348353
bool use_max_;
354+
bool one_path_per_endpoint_;
349355
int max_path_count_;
350356

351357
bool include_unconstrained_;

src/gui/src/timingWidget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ void TimingWidget::readSettings(QSettings* settings)
212212

213213
settings_->setPathCount(
214214
settings->value("path_count", settings_->getPathCount()).toInt());
215+
settings_->setOnePathPerEndpoint(
216+
settings->value("one_path_per_endpoint").toBool());
215217
settings_->setExpandClock(
216218
settings->value("expand_clk", settings_->getExpandClock()).toBool());
217219
delay_detail_splitter_->restoreState(
@@ -226,6 +228,8 @@ void TimingWidget::writeSettings(QSettings* settings)
226228
settings->beginGroup(objectName());
227229

228230
settings->setValue("path_count", settings_->getPathCount());
231+
settings->setValue("one_path_per_endpoint",
232+
settings_->getOnePathPerEndpoint());
229233
settings->setValue("expand_clk", settings_->getExpandClock());
230234
settings->setValue("splitter", delay_detail_splitter_->saveState());
231235

0 commit comments

Comments
 (0)