Skip to content

Commit

Permalink
gui: use placed iterms and bterms to determine dbNet bounding box
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Gadfort <peter.gadfort.civ@army.mil>
  • Loading branch information
gadfort committed Dec 2, 2021
1 parent 5da9458 commit d1367a6
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions src/gui/src/dbDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,36 @@ bool DbNetDescriptor::getBBox(std::any object, odb::Rect& bbox) const
{
auto net = std::any_cast<odb::dbNet*>(object);
auto wire = net->getWire();
if (wire && wire->getBBox(bbox)) {
return true;
bool has_box = false;
bbox.mergeInit();
if (wire) {
odb::Rect wire_box;
if (wire->getBBox(wire_box)) {
bbox.merge(wire_box);
has_box = true;
}
}
return false;

for (auto inst_term : net->getITerms()) {
if (!inst_term->getInst()->getPlacementStatus().isPlaced()) {
continue;
}

odb::dbBox* term_bbox = inst_term->getInst()->getBBox();
odb::Rect rect;
term_bbox->getBox(rect);
bbox.merge(rect);
has_box = true;
}

for (auto blk_term : net->getBTerms()) {
for (auto pin : blk_term->getBPins()) {
bbox.merge(pin->getBBox());
has_box = true;
}
}

return has_box;
}

void DbNetDescriptor::findSourcesAndSinks(odb::dbNet* net,
Expand Down

0 comments on commit d1367a6

Please sign in to comment.