Skip to content

grt: connect pad pins at their core-facing edge - #12254

Open
jfgava wants to merge 7 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-pad-pin-12171
Open

jfgava wants to merge 7 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-pad-pin-12171

Conversation

@jfgava

@jfgava jfgava commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Pick a pad pin's connection layer and access points at its core-facing edge, not its bond pad. A port on the pad pin's metal shares that pin's position instead of being routed through the pad.

Fixes #12171

Summary

In the gf180mcu analog pad gf180mcu_fd_io__asig_5p0, pin ASIG5V has Metal2 stripes that reach the core-facing edge and a Metal5 bond pad on the outer side, behind the pad's obstructions. Global routing had two problems with it:

  1. Connection on the bond pad. On east and west pads, Pin::determineEdge picked Metal5, the only pin layer whose preferred direction matches the edge, so the connection landed on the bond pad. With DRT access points, the bond pad's many access points could still outvote the stripes.
  2. Port routed as a separate pin. place_io_terminals puts the top-level port on the bond pad, and GRT routed it as one more pin, through or around the pad.

In the reporter's design, two connections of about 150 µm took 11,986 µm of wire and left 30 overflow entries after 51 congestion iterations.

The fix applies to both FastRoute and CUGR:

  • Connection layer: determineEdge chooses only among layers that have a shape at the pin's edge.
  • Access points: for pins of PAD and BLOCK instances, only the access points closest to the pin's edge compete for its position.
  • Covered ports: a port whose shapes lie inside a same-net instance pin's shapes on the same layer takes that pin's grid position or access point and gets no route of its own.

Type of Change

  • Bug fix

Impact

Net wirelength on a model of the reporter's pad (8 Metal2 stripes, port on the bond pad) with LibreLane's GRT settings. The reporter's ODB isn't attached to the issue, so their design hasn't been re-run.

Pad pin_access Router Before After
West no FastRoute 966 µm, 50 extra iterations 159 µm
West no CUGR 756 µm 159 µm
West yes FastRoute 739 µm, 50 extra iterations 184 µm
West yes CUGR 840 µm 184 µm
South no FastRoute 806 µm, 50 extra iterations 184 µm
South no CUGR 504 µm 294 µm
South yes FastRoute 898 µm, 50 extra iterations 176 µm

No run needs extra iterations after the fix. For reference, the west net routes at 159 µm when the bond pad isn't part of the pin, and CUGR routes the south net at 294 µm with the port detached.

  • Detailed routing: on the pad_pin_edge test design, detailed_route finishes with 0 violations and 159 µm, and runs no wire to the port. DRT code is unchanged.
  • Other designs: results can change only for pad and macro pins or ports with a layer that has no shape at the pin's edge, for pad and macro pins whose access points lie in gcells at different distances from the edge, and for ports inside a same-net pin's shapes. tinyRocket (2 macros) keeps its GRT wirelength of 768,032 µm. All 199 GRT tests pass without golden changes, as do the rsz, est, ant, cts, drt, rcx, wmk, and pad tests and the gcd and tinyRocket nangate45 flow tests.
  • Parasitic estimation: estimate_parasitics -global_routing joins a covered port to its grid position with a straight wire, so the port's estimated wire now spans the pad instead of following the old route.
  • Runtime: when GRT builds pins, it checks each placed port against the instance pins on the port's net. This cost wasn't measured.

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have included tests to prevent regressions.
  • I have signed my commits (DCO).

Pick a pad pin's connection layer and access points at its core-facing
edge, not its bond pad. A port on the pad pin's metal shares that pin's
position instead of being routed through the pad.

Fixes The-OpenROAD-Project#12171

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
@jfgava jfgava self-assigned this Nov 11, 2026

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

Copy link
Copy Markdown
Contributor

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 new PinGeometry utility to encapsulate pin edge and geometry calculations, refactoring Pin::determineEdge and updating the global router and CUGR to handle pad/macro pin access points and same-net port connections. Feedback on the changes highlights a potential std::out_of_range crash in Pin::determineEdge when using .at() on layers without pin boxes, and a potential null pointer dereference in findCoveringITerm when querying the type of a null tech layer. Additionally, it is recommended to filter out null or non-routing layers when populating pin_shapes for better safety and efficiency.

Comment thread openroad/grt/src/Pin.cpp Resolved
Comment thread openroad/grt/src/PinGeometry.cpp Resolved
Comment thread openroad/grt/src/PinGeometry.cpp Resolved
@jfgava

jfgava commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@osamahammad21 FYI

@jfgava
jfgava marked this pull request as ready for review November 17, 2026 16:33
@jfgava
jfgava requested a review from a team as a code owner November 17, 2026 16:33
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@eder-matheus

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40c84314b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread openroad/grt/src/GlobalRouter.cpp Outdated
Comment on lines +1964 to +1965
port.setOnGridPosition(pin.getOnGridPosition());
port.setConnectionLayer(pin.getConnectionLayer());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Resolve covered ports through the ITerm when reloading guides

When reloading an ODB saved after the first, no-pin_access CUGR run of the new fixture, the reconstructed pad/port position is not covered by the saved guides: reconstruction selects y=1050000, while CUGR connects at y=1016400. ensurePinsPositions() consequently passes the port to findOnGridPositions(), which evaluates pin.getBoxes().at(conn_layer). The copied connection layer is Metal2, but this port only has Metal5 geometry, so guide loading throws std::out_of_range, breaking callers such as estimate_parasitics -global_routing. Restored-guide pin adjustment needs to honor the covering-ITerm association instead of independently falling back through the port's original geometry.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T13:17:45.343471Z 40c8431 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@eder-matheus

Copy link
Copy Markdown
Member

Claude comments:
PR #12254: grt: connect pad pins at their core-facing edge
Modules: grt (FastRoute + CUGR)

== Priority 1 (correctness) ==

  • grt/src/GlobalRouter.cpp:3418 question (plausible): when routing is loaded
    from guides in the database, a covered port can lose the shared position and
    end up uncovered.
    Path: findPins gives the port the pad pin's position. If the pad pin is not
    covered by the loaded guides, the port isn't either, so ensurePinsPositions
    recomputes both. findCoveredAccessPoint can rescue the pad pin from its full
    access-point list. The port only searches its own access points on the bond
    pad, and the guides never reach the bond pad, so it falls back to its own
    shapes and stays uncovered.
    Result: est then warns EST-0026 "Missing route to pin" and leaves the port
    unconnected in the parasitic network.
    Trigger: needs a mismatch between stored guides and current access points,
    e.g. guides routed before pin_access and loaded afterwards.
    Fix: share the covering pin's position with the port again at the end of
    ensurePinsPositions.
  • grt/src/Pin.cpp:88 nit: ties in findClosestEdge go north > south > east >
    west. A shape that touches both north and south (or both east and west)
    always counts as north (or east), so its layer is left out of edge_layers
    when edge_ is the other side. Checking whether the distance to edge_ equals
    the minimum distance handles the tie.

== Priority 2 (QoR) ==

  • grt/src/GlobalRouter.cpp:1899 question: the new access-point filter applies
    to every macro pin that has DRT access points, not only pads, and only
    tinyRocket was checked. Can we see ORFS/Jenkins metrics on macro-heavy
    designs (ariane133, black_parrot, mempool_group, swerv_wrapper)?

== Priority 3 (testing) ==

  • pad_pin_edge.def: all three pads are placed with orientation E, so only the
    east case of coordinateTowardEdge is tested. Add a pad facing north or south.
  • The CUGR restoreNetRoute change (skip the covered port, then share the
    pin's access point) has no test. Without the skip, the port's bond-pad cells
    aren't in the tree, so restoring the route fails. That path runs through
    repair_antennas, jumper insertion, and incremental routing; the new tests
    call none of these.

When guides loaded from the database miss a pad pin, the pad pin moves
to a covered access point; a port on its metal now moves with it
instead of falling back to the bond pad.

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
A shape that touches the voted edge and another edge now counts as
facing the voted edge, so its layer stays a connection candidate.

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
pad_pin_edge now has pads facing north, south, east, and west.
pad_pin_edge_restore_cugr undoes an ECO so CUGR restores the pad
nets from their guides.

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grt: pad pin with shapes on several layers gets its connection on the bond-pad layer; port on the pad pin is routed as a separate pin

3 participants