Skip to content

Commit ae5b090

Browse files
committed
gui: add halo to dbInst descriptor and draw with placement blockages
Signed-off-by: Peter Gadfort <[email protected]>
1 parent 27ac731 commit ae5b090

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

src/gui/src/dbDescriptors.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,11 @@ Descriptor::Properties DbInstDescriptor::getDBProperties(
630630
props.push_back({"Region", gui->makeSelected(region)});
631631
}
632632

633+
auto* halo = inst->getHalo();
634+
if (halo != nullptr) {
635+
props.push_back({"Halo", gui->makeSelected(halo)});
636+
}
637+
633638
sta::Instance* sta_inst = sta_->getDbNetwork()->dbToSta(inst);
634639
if (sta_inst != nullptr) {
635640
props.push_back({"Timing/Power", gui->makeSelected(sta_inst)});

src/gui/src/renderThread.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ bool RenderThread::drawTextInBBox(const QColor& text_color,
820820

821821
void RenderThread::drawBlockages(QPainter* painter,
822822
odb::dbBlock* block,
823-
const Rect& bounds)
823+
const Rect& bounds,
824+
const std::vector<odb::dbInst*>& insts)
824825
{
825826
if (!viewer_->options_->areBlockagesVisible()) {
826827
return;
@@ -844,6 +845,23 @@ void RenderThread::drawBlockages(QPainter* painter,
844845
Rect bbox = blockage->getBBox()->getBox();
845846
painter->drawRect(bbox.xMin(), bbox.yMin(), bbox.dx(), bbox.dy());
846847
}
848+
849+
for (odb::dbInst* inst : insts) {
850+
if (restart_) {
851+
break;
852+
}
853+
odb::dbBox* halo = inst->getHalo();
854+
if (halo != nullptr) {
855+
Rect instbox = inst->getBBox()->getBox();
856+
Rect halobox = halo->getBox();
857+
instbox.set_xlo(instbox.xMin() - halobox.xMin());
858+
instbox.set_ylo(instbox.yMin() - halobox.yMin());
859+
instbox.set_xhi(instbox.xMax() + halobox.xMax());
860+
instbox.set_yhi(instbox.yMax() + halobox.yMax());
861+
painter->drawRect(
862+
instbox.xMin(), instbox.yMin(), instbox.dx(), instbox.dy());
863+
}
864+
}
847865
}
848866

849867
void RenderThread::drawObstructions(odb::dbBlock* block,
@@ -1198,7 +1216,7 @@ void RenderThread::drawChip(QPainter* painter,
11981216

11991217
// draw blockages
12001218
utl::Timer inst_blockages;
1201-
drawBlockages(painter, block, bounds);
1219+
drawBlockages(painter, block, bounds, insts);
12021220
debugPrint(logger_, GUI, "draw", 1, "blockages {}", inst_blockages);
12031221

12041222
dbTech* tech = block->getTech();

src/gui/src/renderThread.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ class RenderThread : public QThread
103103

104104
void drawBlockages(QPainter* painter,
105105
odb::dbBlock* block,
106-
const odb::Rect& bounds);
106+
const odb::Rect& bounds,
107+
const std::vector<odb::dbInst*>& insts);
107108
void drawObstructions(odb::dbBlock* block,
108109
odb::dbTechLayer* layer,
109110
QPainter* painter,

0 commit comments

Comments
 (0)