Skip to content

Commit 05492f9

Browse files
authored
Merge pull request #8843 from gadfort/gui-physical
gui: add physical insts controls to hierarchy browser
2 parents effb4b1 + 85ba2f0 commit 05492f9

File tree

2 files changed

+56
-2
lines changed

2 files changed

+56
-2
lines changed

src/gui/src/browserWidget.cpp

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ BrowserWidget::BrowserWidget(
109109
display_controls_(controls),
110110
display_controls_warning_(
111111
new QPushButton("Module view is not enabled", this)),
112+
include_physical_cells_(new QCheckBox("Include physical", this)),
112113
modulesettings_(modulesettings),
113114
view_(new QTreeView(this)),
114115
model_(new QStandardItemModel(this)),
@@ -119,13 +120,19 @@ BrowserWidget::BrowserWidget(
119120
{
120121
setObjectName("hierarchy_viewer"); // for settings
121122

123+
QHBoxLayout* setting_layout = new QHBoxLayout;
124+
setting_layout->addWidget(display_controls_warning_);
125+
setting_layout->addStretch();
126+
setting_layout->addWidget(include_physical_cells_);
127+
122128
QWidget* widget = new QWidget(this);
123129
QVBoxLayout* layout = new QVBoxLayout;
124130
widget->setLayout(layout);
125-
layout->addWidget(display_controls_warning_);
131+
layout->addLayout(setting_layout);
126132
layout->addWidget(view_);
127133

128134
display_controls_warning_->setStyleSheet("color: red;");
135+
include_physical_cells_->setCheckState(Qt::Checked);
129136

130137
model_->setHorizontalHeaderLabels({"Instance",
131138
"Module",
@@ -185,6 +192,11 @@ BrowserWidget::BrowserWidget(
185192
&QPushButton::pressed,
186193
this,
187194
&BrowserWidget::enableModuleView);
195+
196+
connect(include_physical_cells_,
197+
&QCheckBox::stateChanged,
198+
this,
199+
&BrowserWidget::markModelModified);
188200
}
189201

190202
void BrowserWidget::displayControlsUpdated()
@@ -270,13 +282,18 @@ void BrowserWidget::readSettings(QSettings* settings)
270282
settings->beginGroup(objectName());
271283
view_->header()->restoreState(
272284
settings->value("headers", view_->header()->saveState()).toByteArray());
285+
include_physical_cells_->setCheckState(
286+
settings->value("include_physical_cells").toBool() ? Qt::Checked
287+
: Qt::Unchecked);
273288
settings->endGroup();
274289
}
275290

276291
void BrowserWidget::writeSettings(QSettings* settings)
277292
{
278293
settings->beginGroup(objectName());
279294
settings->setValue("headers", view_->header()->saveState());
295+
settings->setValue("include_physical_cells",
296+
include_physical_cells_->isChecked());
280297
settings->endGroup();
281298
}
282299

@@ -423,6 +440,41 @@ BrowserWidget::ModuleStats BrowserWidget::populateModule(odb::dbModule* module,
423440

424441
std::vector<odb::dbInst*> insts;
425442
for (auto* inst : module->getInsts()) {
443+
if (!include_physical_cells_->isChecked()) {
444+
switch (sta_->getInstanceType(inst)) {
445+
case sta::dbSta::InstType::ENDCAP:
446+
case sta::dbSta::InstType::FILL:
447+
case sta::dbSta::InstType::TAPCELL:
448+
case sta::dbSta::InstType::STD_PHYSICAL:
449+
case sta::dbSta::InstType::BUMP:
450+
case sta::dbSta::InstType::COVER:
451+
case sta::dbSta::InstType::ANTENNA:
452+
continue;
453+
case sta::dbSta::InstType::BLOCK:
454+
case sta::dbSta::InstType::PAD:
455+
case sta::dbSta::InstType::PAD_INPUT:
456+
case sta::dbSta::InstType::PAD_OUTPUT:
457+
case sta::dbSta::InstType::PAD_INOUT:
458+
case sta::dbSta::InstType::PAD_POWER:
459+
case sta::dbSta::InstType::PAD_SPACER:
460+
case sta::dbSta::InstType::PAD_AREAIO:
461+
case sta::dbSta::InstType::TIE:
462+
case sta::dbSta::InstType::LEF_OTHER:
463+
case sta::dbSta::InstType::STD_CELL:
464+
case sta::dbSta::InstType::STD_INV:
465+
case sta::dbSta::InstType::STD_BUF:
466+
case sta::dbSta::InstType::STD_BUF_CLK_TREE:
467+
case sta::dbSta::InstType::STD_INV_CLK_TREE:
468+
case sta::dbSta::InstType::STD_BUF_TIMING_REPAIR:
469+
case sta::dbSta::InstType::STD_INV_TIMING_REPAIR:
470+
case sta::dbSta::InstType::STD_CLOCK_GATE:
471+
case sta::dbSta::InstType::STD_LEVEL_SHIFT:
472+
case sta::dbSta::InstType::STD_SEQUENTIAL:
473+
case sta::dbSta::InstType::STD_COMBINATIONAL:
474+
case sta::dbSta::InstType::STD_OTHER:
475+
break;
476+
}
477+
}
426478
insts.push_back(inst);
427479
}
428480
stats += addInstanceItems(insts, "Leaf instances", parent);

src/gui/src/browserWidget.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#pragma once
55

6+
#include <QCheckBox>
67
#include <QColor>
78
#include <QDockWidget>
89
#include <QMenu>
@@ -95,11 +96,11 @@ class BrowserWidget : public QDockWidget,
9596
void itemExpanded(const QModelIndex& index);
9697
void updateModuleColorIcon(odb::dbModule* module, const QColor& color);
9798
void enableModuleView();
99+
void markModelModified();
98100

99101
private:
100102
void updateModel();
101103
void clearModel();
102-
void markModelModified();
103104

104105
void makeMenu();
105106

@@ -112,6 +113,7 @@ class BrowserWidget : public QDockWidget,
112113
DbInstDescriptor* inst_descriptor_;
113114
DisplayControls* display_controls_;
114115
QPushButton* display_controls_warning_;
116+
QCheckBox* include_physical_cells_;
115117

116118
const std::map<odb::dbModule*, LayoutViewer::ModuleSettings>& modulesettings_;
117119

0 commit comments

Comments
 (0)