odb: impl 3dblox checker checkNetConnectivity#9550
odb: impl 3dblox checker checkNetConnectivity#9550ahmed532 wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: Ahmed R. Mohamed <ahmed@precisioninno.com>
There was a problem hiding this comment.
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.
| 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())); |
There was a problem hiding this comment.
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));
}
}
}| auto find_root = [](dbWireGraph::Node* n) { | ||
| while (n->in_edge()) { | ||
| n = n->in_edge()->source(); | ||
| } | ||
| return n; | ||
| }; |
There was a problem hiding this comment.
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
- Helper logic should be defined as a free function in a namespace rather than as a local lambda within a function.
|
clang-tidy review says "All clean, LGTM! 👍" |
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
dbChipNetwhose 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 optionalbump_pitch_tolerance(default0). 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.Algorithm
The check uses a Union-Find over the bumps of each
dbChipNet:dbBTermBPin boxes are matched against the chip's dbWireGraph. Bumps whose BTerm pins land on the same wire-graph tree root are united.Open netsmarker is created with sources pointing to the affected bumps.Helper methods added to Checker