Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui update timing report #6302

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/gui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,28 @@ gui::hide_widget
| ---- | ---- |
| `name` | of the widget. For example, the display controls would be "Display Control". |

### Select chart

To select a specific chart in the charts widget:

```tcl
gui::select_chart
name
```

#### Options

| Switch Name | Description |
| ---- | ---- |
| `name` | of the chart. For example, "Endpoint Slack". |

### Update timing report

Update the paths in the Timing Report widget:

```tcl
gui::update_timing_report
```

## License

Expand Down
2 changes: 2 additions & 0 deletions src/gui/include/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ class Gui
void dumpHeatMap(const std::string& name, const std::string& file);

void selectHelp(const std::string& item);
void selectChart(const std::string& name);
void updateTimingReport();

// accessors for to add and remove commands needed to restore the state of the
// gui
Expand Down
11 changes: 8 additions & 3 deletions src/gui/src/chartsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ ChartsWidget::ChartsWidget(QWidget* parent)
#ifdef ENABLE_CHARTS
void ChartsWidget::changeMode()
{
filters_menu_->clear();
clearChart();

if (mode_menu_->currentIndex() == SELECT) {
return;
}

filters_menu_->clear();
clearChart();

if (mode_menu_->currentIndex() == SLACK_HISTOGRAM) {
resetting_menu_ = true;
setSlackHistogramLayout();
Expand All @@ -147,6 +147,11 @@ void ChartsWidget::changeMode()
}
}

void ChartsWidget::setMode(Mode mode)
{
mode_menu_->setCurrentIndex(mode);
}

void ChartsWidget::setSlackHistogramLayout()
{
updatePathGroupMenuIndexes(); // so that the user doesn't have to refresh
Expand Down
14 changes: 8 additions & 6 deletions src/gui/src/chartsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ class ChartsWidget : public QDockWidget
Q_OBJECT

public:
enum Mode
{
SELECT,
SLACK_HISTOGRAM
};

ChartsWidget(QWidget* parent = nullptr);
#ifdef ENABLE_CHARTS
void setSTA(sta::dbSta* sta);
Expand All @@ -97,6 +103,8 @@ class ChartsWidget : public QDockWidget
logger_ = logger;
}

void setMode(Mode mode);

signals:
void endPointsToReport(const std::set<const sta::Pin*>& report_pins,
const std::string& path_group_name);
Expand All @@ -109,12 +117,6 @@ class ChartsWidget : public QDockWidget
void emitEndPointsInBucket(int bar_index);

private:
enum Mode
{
SELECT,
SLACK_HISTOGRAM
};

void setSlackHistogram();
void setSlackHistogramLayout();
void setModeMenu();
Expand Down
28 changes: 28 additions & 0 deletions src/gui/src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <stdexcept>
#include <string>

#include "chartsWidget.h"
#include "clockWidget.h"
#include "displayControls.h"
#include "drcWidget.h"
Expand All @@ -54,6 +55,7 @@
#include "ruler.h"
#include "scriptWidget.h"
#include "sta/StaMain.hh"
#include "timingWidget.h"
#include "utl/Logger.h"
#include "utl/exception.h"

Expand Down Expand Up @@ -1296,6 +1298,32 @@ void Gui::selectHelp(const std::string& item)
main_window->getHelpViewer()->selectHelp(item);
}

void Gui::selectChart(const std::string& name)
{
#ifdef ENABLE_CHARTS
if (!enabled()) {
return;
}

ChartsWidget::Mode mode;
if (name == "Endpoint Slack") {
mode = ChartsWidget::Mode::SLACK_HISTOGRAM;
} else if (name == "Select Mode") {
mode = ChartsWidget::Mode::SELECT;
} else {
logger_->error(utl::GUI, 105, "Chart {} is unknown.", name);
}
main_window->getChartsWidget()->setMode(mode);
#else
logger_->warn(utl::GUI, 106, "Charts are not enabled.");
#endif
}

void Gui::updateTimingReport()
{
main_window->getTimingWidget()->populatePaths();
}

class SafeApplication : public QApplication
{
public:
Expand Down
17 changes: 17 additions & 0 deletions src/gui/src/gui.i
Original file line number Diff line number Diff line change
Expand Up @@ -750,4 +750,21 @@ void show_help(const std::string& item)
gui->selectHelp(item);
}

void select_chart(const std::string& name)
{
if (!check_gui("select_chart")) {
return;
}
auto gui = gui::Gui::get();
gui->selectChart(name);
}

void update_timing_report()
{
if (!check_gui("update_timing_report")) {
return;
}
auto gui = gui::Gui::get();
gui->updateTimingReport();
}
%} // inline
2 changes: 2 additions & 0 deletions src/gui/src/mainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class MainWindow : public QMainWindow, public ord::OpenRoadObserver
ScriptWidget* getScriptWidget() const { return script_; }
Inspector* getInspector() const { return inspector_; }
HelpWidget* getHelpViewer() const { return help_widget_; }
ChartsWidget* getChartsWidget() const { return charts_widget_; }
TimingWidget* getTimingWidget() const { return timing_widget_; }

std::vector<std::string> getRestoreTclCommands();

Expand Down
Loading