Skip to content

Commit e4cfdfb

Browse files
committed
gui: include TCL command to save worst path
Signed-off-by: Augusto Berndt <[email protected]>
1 parent f745f67 commit e4cfdfb

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

src/gui/include/gui/gui.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ class Gui
773773
int width_px = 0,
774774
int height_px = 0);
775775

776+
void showWorstPath(bool setup);
777+
776778
// modify display controls
777779
void setDisplayControlsVisible(const std::string& name, bool value);
778780
void setDisplayControlsSelectable(const std::string& name, bool value);

src/gui/src/gui.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ void Gui::saveImage(const std::string& filename,
782782
const double dbu_per_micron = tech->getDbUnitsPerMicron();
783783

784784
std::string save_cmds;
785+
785786
// build display control commands
786787
save_cmds = "set ::gui::display_settings [gui::DisplayControlMap]\n";
787788
for (const auto& [control, value] : display_settings) {
@@ -863,6 +864,13 @@ void Gui::saveHistogramImage(const std::string& filename,
863864
filename, chart_mode, width, height);
864865
}
865866

867+
void Gui::showWorstPath(bool setup)
868+
{
869+
if (main_window->getTimingWidget()) {
870+
main_window->getTimingWidget()->showWorstPath(setup);
871+
}
872+
}
873+
866874
void Gui::selectClockviewerClock(const std::string& clock_name,
867875
std::optional<int> depth)
868876
{

src/gui/src/gui.i

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,15 @@ void save_histogram_image(const char* filename, const char* mode, int width_px =
332332
gui->saveHistogramImage(filename, mode, width_px, height_px);
333333
}
334334

335+
void show_worst_path(bool setup = true)
336+
{
337+
if (!check_gui("show_worst_path")) {
338+
return;
339+
}
340+
auto gui = gui::Gui::get();
341+
gui->showWorstPath(setup);
342+
}
343+
335344
void clear_rulers()
336345
{
337346
if (!check_gui("clear_rulers")) {

src/gui/src/timingWidget.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,24 @@ void TimingWidget::hideEvent(QHideEvent* event)
789789
toggleRenderer(false);
790790
}
791791

792+
793+
void TimingWidget::showWorstPath(bool setup)
794+
{
795+
populatePaths();
796+
QTableView* table_view = setup ? setup_timing_table_view_ : hold_timing_table_view_;
797+
QAbstractItemModel* model = table_view->model();
798+
if (model->rowCount() > 0) {
799+
QModelIndex index = model->index(0, 0);
800+
table_view->setCurrentIndex(index);
801+
// Ensure the selection signal is emitted even if the index was already selected
802+
if (setup) {
803+
selectedRowChanged(table_view->selectionModel()->selection(), QItemSelection());
804+
} else {
805+
selectedCaptureRowChanged(table_view->selectionModel()->selection(), QItemSelection());
806+
}
807+
}
808+
}
809+
792810
void TimingWidget::modelWasReset()
793811
{
794812
setup_timing_table_view_->resizeColumnsToContents();

src/gui/src/timingWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class TimingWidget : public QDockWidget
7171
void updatePaths();
7272
void reportSlackHistogramPaths(const std::set<const sta::Pin*>& report_pins,
7373
const std::string& path_group_name);
74+
void showWorstPath(bool setup);
7475

7576
signals:
7677
void highlightTimingPath(TimingPath* timing_path);

0 commit comments

Comments
 (0)