Skip to content

odb: impl 3dblox checker checkNetConnectivity#9550

Open
ahmed532 wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
ahmed532:feat/3dblox-checker-checkNetConnectivity
Open

odb: impl 3dblox checker checkNetConnectivity#9550
ahmed532 wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
ahmed532:feat/3dblox-checker-checkNetConnectivity

Conversation

@ahmed532
Copy link

Summary

Implements Checker::checkNetConnectivity, a new verification pass that detects electrically open nets in a 3D-stacked chip assembly.

Background

The 3DBlox checker previously verified chip placement, floating chips, overlapping chips, and connection regions, but had no way to detect broken signal paths: a dbChipNet whose bumps are not all reachable from each other through either intra-chip wiring or inter-chip connections. This PR adds that capability.

What Changed

New API

ThreeDBlox::check() now accepts an optional bump_pitch_tolerance (default 0). When non-zero, bumps that are within this distance of each other across a connection are considered bonded even if their XY positions do not match exactly.

void ThreeDBlox::check(int bump_pitch_tolerance = 0);

Algorithm

The check uses a Union-Find over the bumps of each dbChipNet:

  1. Intra-chip connectivity — for bumps on the same chip, their dbBTerm BPin boxes are matched against the chip's dbWireGraph. Bumps whose BTerm pins land on the same wire-graph tree root are united.
  2. Inter-chip connectivity — connections are pre-indexed by region. For each connected region pair, bumps are united if their global XY positions match within the tolerance (exact hash-map lookup at tolerance=0, sorted sweep-line at tolerance>0).
  3. Group analysis — after union-find, nets with more than one group are flagged. The largest group is assumed to be the main net; remaining bumps are reported as disconnected. An Open nets marker is created with sources pointing to the affected bumps.

Helper methods added to Checker

Method Purpose
checkIntraChipConnectivity Groups bumps by chip and calls verifyChipConnectivity per chip
verifyChipConnectivity Walks the dbWireGraph and maps BTerm pins to connected components
checkInterChipConnectivity Iterates region pairs via the connection index and calls connectBumpsBetweenRegions
connectBumpsBetweenRegions Unites bumps from two regions by XY match (exact or tolerance)

Signed-off-by: Ahmed R. Mohamed <ahmed@precisioninno.com>
@ahmed532 ahmed532 self-assigned this Feb 26, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable new verification pass, checkNetConnectivity, to detect open nets in 3D-stacked chip assemblies. The implementation correctly uses a Union-Find algorithm to determine connectivity within and between chips, and the new tests are comprehensive. I have a couple of suggestions to improve code clarity and maintainability.

Comment on lines +340 to +362
auto* marker = dbMarker::create(cat);
marker->addSource(net.chip_net);

int disconnected_count = 0;
for (auto& group : groups) {
for (int idx : group) {
disconnected_count++;
auto* b = net.connected_bumps[idx];
if (b->bump_inst) {
marker->addSource(b->bump_inst);
marker->addShape(
Rect(b->global_position.x() - kBumpMarkerHalfSize,
b->global_position.y() - kBumpMarkerHalfSize,
b->global_position.x() + kBumpMarkerHalfSize,
b->global_position.y() + kBumpMarkerHalfSize));
}
}
}
marker->setComment(
fmt::format("Net {} has {} disconnected bump(s) out of {} total.",
net.chip_net->getName(),
disconnected_count,
net.connected_bumps.size()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and separation of concerns, the logic for counting disconnected bumps can be separated from populating the marker. You can first calculate the total number of disconnected bumps, set the marker's comment, and then iterate through the groups to add sources and shapes to the marker.

      int disconnected_count = 0;
      for (const auto& group : groups) {
        disconnected_count += group.size();
      }

      auto* marker = dbMarker::create(cat);
      marker->addSource(net.chip_net);
      marker->setComment(
          fmt::format("Net {} has {} disconnected bump(s) out of {} total.",
                      net.chip_net->getName(),
                      disconnected_count,
                      net.connected_bumps.size()));

      for (const auto& group : groups) {
        for (int idx : group) {
          auto* b = net.connected_bumps[idx];
          if (b->bump_inst) {
            marker->addSource(b->bump_inst);
            marker->addShape(
                Rect(b->global_position.x() - kBumpMarkerHalfSize,
                     b->global_position.y() - kBumpMarkerHalfSize,
                     b->global_position.x() + kBumpMarkerHalfSize,
                     b->global_position.y() + kBumpMarkerHalfSize));
          }
        }
      }

Comment on lines +465 to +470
auto find_root = [](dbWireGraph::Node* n) {
while (n->in_edge()) {
n = n->in_edge()->source();
}
return n;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This helper lambda can be moved to a free function in the anonymous namespace at the top of this file, or a private static method of the Checker class. This would be more consistent with our general rule of avoiding local lambdas for reusable helper logic.

References
  1. Helper logic should be defined as a free function in a namespace rather than as a local lambda within a function.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant