Skip to content

Commit 5d7f74d

Browse files
authored
Merge pull request #8757 from The-OpenROAD-Project-staging/gui-chiplets3
Gui chiplets progress
2 parents dd7a99f + d11e4cc commit 5d7f74d

File tree

18 files changed

+235
-155
lines changed

18 files changed

+235
-155
lines changed

.clang-tidy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ Checks: >
6060
-misc-use-anonymous-namespace,
6161
6262
CheckOptions:
63-
- key: google-runtime-int.TypeSuffix
64-
value: _t
65-
63+
- key: google-runtime-int.TypeSuffix
64+
value: _t
65+
- key: misc-include-cleaner.IgnoreHeaders
66+
value: '.*/QtCore/.*;.*/QtGui/.*;.*/QtWidgets/.*;.*/spdlog/fmt/bundled/.*'
67+
6668
# All modules but sta
6769
# Exclude build as there is too much noise from swig generated code
6870
HeaderFilterRegex: "(?!build/.*)/(ant|cgt|cts|cut|dbSta|dft|dpl|drt|dst|est|exa|fin|gpl|grt|gui|ifp|mpl|odb|ord|pad|par|pdn|ppl|psm|rcx|ram|rmp|rsz|stt|tap|upf|utl)/.*"

src/gui/src/displayControls.cpp

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,18 +2157,34 @@ void DisplayControls::blockLoaded(odb::dbBlock* block)
21572157
addTech(block->getTech());
21582158
}
21592159

2160-
void DisplayControls::setCurrentBlock(odb::dbBlock* block)
2160+
void DisplayControls::setCurrentChip(odb::dbChip* chip)
21612161
{
2162-
if (!block) {
2162+
if (!chip) {
21632163
return;
21642164
}
2165-
auto tech = block->getTech();
2166-
addTech(tech);
21672165

2168-
std::set<odb::dbTech*> visible_techs{tech};
2169-
for (auto child : block->getChildren()) {
2170-
visible_techs.insert(child->getTech());
2171-
}
2166+
std::set<odb::dbTech*> visible_techs;
2167+
2168+
std::function<void(odb::dbChip*)> collect_techs = [&](odb::dbChip* chip) {
2169+
auto tech = chip->getTech();
2170+
if (tech) {
2171+
addTech(tech);
2172+
visible_techs.insert(tech);
2173+
}
2174+
2175+
odb::dbBlock* block = chip->getBlock();
2176+
if (block) {
2177+
for (auto child : block->getChildren()) {
2178+
visible_techs.insert(child->getTech());
2179+
}
2180+
}
2181+
2182+
for (auto* inst : chip->getChipInsts()) {
2183+
collect_techs(inst->getMasterChip());
2184+
}
2185+
};
2186+
2187+
collect_techs(chip);
21722188

21732189
for (auto& [layer, row] : layer_controls_) {
21742190
const bool visible

src/gui/src/displayControls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class DisplayControls : public QDockWidget,
271271
// options displayed need to match
272272
void blockLoaded(odb::dbBlock* block);
273273

274-
void setCurrentBlock(odb::dbBlock* block);
274+
void setCurrentChip(odb::dbChip* chip);
275275

276276
// This is called by the check boxes to update the state
277277
void itemChanged(QStandardItem* item);

src/gui/src/layoutTabs.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ void LayoutTabs::updateBackgroundColor(LayoutViewer* viewer)
6767
viewer->setAutoFillBackground(true);
6868
}
6969

70-
void LayoutTabs::blockLoaded(odb::dbBlock* block)
70+
void LayoutTabs::chipLoaded(odb::dbChip* chip)
7171
{
7272
// Check if we already have a tab for this block
7373
for (LayoutViewer* viewer : viewers_) {
74-
if (viewer->getBlock() == block) {
74+
if (viewer->getChip() == chip) {
7575
return;
7676
}
7777
}
7878

79-
populateModuleColors(block);
79+
populateModuleColors(chip->getBlock());
8080
auto viewer = new LayoutViewer(options_,
8181
output_widget_,
8282
selected_,
@@ -99,10 +99,11 @@ void LayoutTabs::blockLoaded(odb::dbBlock* block)
9999
}
100100
auto scroll = new LayoutScroll(
101101
viewer, default_mouse_wheel_zoom_, arrow_keys_scroll_step_, this);
102-
viewer->blockLoaded(block);
102+
viewer->chipLoaded(chip);
103103

104-
auto tech = block->getTech();
105-
const auto name = fmt::format("{} ({})", block->getName(), tech->getName());
104+
auto tech = chip->getTech();
105+
const auto name
106+
= fmt::format("{} ({})", chip->getName(), tech ? tech->getName() : "-");
106107
addTab(scroll, name.c_str());
107108

108109
updateBackgroundColor(viewer);
@@ -131,7 +132,7 @@ void LayoutTabs::tabChange(int index)
131132
{
132133
current_viewer_ = viewers_[index];
133134

134-
emit setCurrentBlock(current_viewer_->getBlock());
135+
emit setCurrentChip(current_viewer_->getChip());
135136
}
136137

137138
void LayoutTabs::setLogger(utl::Logger* logger)

src/gui/src/layoutTabs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class LayoutTabs : public QTabWidget
7171
void clearNetTracks();
7272

7373
signals:
74-
void setCurrentBlock(odb::dbBlock* block);
74+
void setCurrentChip(odb::dbChip* chip);
7575
void newViewer(LayoutViewer* viewer);
7676

7777
// These are just forwarding from the LayoutViewer(s). Only the
@@ -95,7 +95,7 @@ class LayoutTabs : public QTabWidget
9595
void zoomIn();
9696
void zoomOut();
9797
void zoomTo(const odb::Rect& rect_dbu);
98-
void blockLoaded(odb::dbBlock* block);
98+
void chipLoaded(odb::dbChip* chip);
9999
void fit();
100100
void fullRepaint();
101101
void startRulerBuild();

0 commit comments

Comments
 (0)