Skip to content
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
24 changes: 16 additions & 8 deletions src/gui/src/layoutViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,19 +634,23 @@ std::pair<LayoutViewer::Edge, bool> LayoutViewer::searchNearestEdge(

const bool routing_visible = options_->areRoutingSegmentsVisible();
const bool vias_visible = options_->areRoutingViasVisible();
if (routing_visible || vias_visible) {
const bool io_pins_visible = options_->areIOPinsVisible();
if (routing_visible || vias_visible || io_pins_visible) {
auto box_shapes = search_.searchBoxShapes(block_,
layer,
search_line.xMin(),
search_line.yMin(),
search_line.xMax(),
search_line.yMax(),
shape_limit);
for (const auto& [box, is_via, net] : box_shapes) {
if (!routing_visible && !is_via) {
for (const auto& [box, type, net] : box_shapes) {
if (!routing_visible && type == Search::WIRE) {
continue;
}
if (!vias_visible && is_via) {
if (!vias_visible && type == Search::VIA) {
continue;
}
if (!io_pins_visible && type == Search::BTERM) {
continue;
}
if (isNetVisible(net)) {
Expand Down Expand Up @@ -855,7 +859,8 @@ void LayoutViewer::selectAt(odb::Rect region, std::vector<Selected>& selections)

const bool routing_visible = options_->areRoutingSegmentsVisible();
const bool vias_visible = options_->areRoutingViasVisible();
if (routing_visible || vias_visible) {
const bool io_pins_visible = options_->areIOPinsVisible();
if (routing_visible || vias_visible || io_pins_visible) {
auto box_shapes = search_.searchBoxShapes(block_,
layer,
region.xMin(),
Expand All @@ -864,11 +869,14 @@ void LayoutViewer::selectAt(odb::Rect region, std::vector<Selected>& selections)
region.yMax(),
shape_limit);

for (auto& [box, is_via, net] : box_shapes) {
if (!routing_visible && !is_via) {
for (auto& [box, type, net] : box_shapes) {
if (!routing_visible && type == Search::WIRE) {
continue;
}
if (!vias_visible && type == Search::VIA) {
continue;
}
if (!vias_visible && is_via) {
if (!io_pins_visible && type == Search::BTERM) {
continue;
}
if (isNetVisible(net) && options_->isNetSelectable(net)) {
Expand Down
8 changes: 4 additions & 4 deletions src/gui/src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void Search::updateShapes(odb::dbBlock* block)
continue;
}
odb::dbTechLayer* layer = box->getTechLayer();
net_shapes[layer].emplace_back(box->getBox(), false, term->getNet());
net_shapes[layer].emplace_back(box->getBox(), BTERM, term->getNet());
}
}
}
Expand Down Expand Up @@ -406,14 +406,14 @@ void Search::addVia(
for (odb::dbBox* box : via->getBoxes()) {
odb::Rect bbox = box->getBox();
bbox.moveDelta(x, y);
tree_shapes[box->getTechLayer()].emplace_back(bbox, true, net);
tree_shapes[box->getTechLayer()].emplace_back(bbox, VIA, net);
}
} else {
odb::dbVia* via = shape->getVia();
for (odb::dbBox* box : via->getBoxes()) {
odb::Rect bbox = box->getBox();
bbox.moveDelta(x, y);
tree_shapes[box->getTechLayer()].emplace_back(bbox, true, net);
tree_shapes[box->getTechLayer()].emplace_back(bbox, VIA, net);
}
}
}
Expand Down Expand Up @@ -462,7 +462,7 @@ void Search::addNet(
if (s.isVia()) {
addVia(net, &s, itr._prev_x, itr._prev_y, tree_shapes);
} else {
tree_shapes[s.getTechLayer()].emplace_back(s.getBox(), false, net);
tree_shapes[s.getTechLayer()].emplace_back(s.getBox(), WIRE, net);
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/gui/src/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ class Search : public QObject, public odb::dbBlockCallBackObj
class PolygonIntersectPredicate;

public:
enum RouteBoxType
{
WIRE,
VIA,
BTERM
};

template <typename T>
using LayerMap = std::map<odb::dbTechLayer*, T>;

template <typename T>
using RectValue = std::pair<odb::Rect, T>;
template <typename T>
using RouteBoxValue = std::tuple<odb::Rect, bool, T>;
using RouteBoxValue = std::tuple<odb::Rect, RouteBoxType, T>;
template <typename T>
using SNetValue = std::tuple<odb::dbSBox*, odb::Polygon, T>;
template <typename T>
Expand Down