Skip to content

feat: enable sbend="bend_s" in route_bundle strategies#533

Merged
joamatab merged 7 commits into
mainfrom
enable-sbend-in-route-bundle
May 14, 2026
Merged

feat: enable sbend="bend_s" in route_bundle strategies#533
joamatab merged 7 commits into
mainfrom
enable-sbend-in-route-bundle

Conversation

@joamatab

@joamatab joamatab commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Enable sbend="bend_s" in all route_bundle routing strategies
  • This allows the router to use S-bends when needed to avoid collisions

Test plan

  • Verify routing still works correctly with sbend enabled

Summary by Sourcery

Enhancements:

  • Update the default route_bundle configuration to allow S-bend usage for improved collision avoidance in routing.

@sourcery-ai

sourcery-ai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Configures route_bundle to pass sbend="bend_s" to gf.routing.route_bundle so that S-bends can be used in bundle routing while keeping other routing behavior unchanged.

Sequence diagram for updated route_bundle call with sbend bend_s

sequenceDiagram
    participant UserCode
    participant ubcpdk_tech as ubcpdk_tech
    participant gf_routing as gf_routing

    UserCode->>ubcpdk_tech: route_bundle(ports, separation, other_args)
    note right of ubcpdk_tech: route_bundle is a partial of gf.routing.route_bundle
    ubcpdk_tech->>gf_routing: route_bundle(ports, separation, cross_section=strip, sbend=bend_s, other_args)
    gf_routing-->>ubcpdk_tech: routes_with_optional_sbends
    ubcpdk_tech-->>UserCode: routes_with_optional_sbends
Loading

Flow diagram for route_bundle configuration with sbend bend_s

flowchart LR
    A[ubcpdk_tech route_bundle definition] --> B[partial of gf.routing.route_bundle]
    B --> C[cross_section=strip]
    B --> D[sbend=bend_s]
    C --> E[User calls ubcpdk_tech.route_bundle]
    D --> E
    E --> F[gf.routing.route_bundle executes with S-bend capability]
Loading

File-Level Changes

Change Details Files
Enable S-bend support for route_bundle by default.
  • Update the route_bundle partial to include sbend="bend_s" when calling gf.routing.route_bundle
  • Keep cross_section configuration consistent with existing route_single and route_bundle_rib helpers
ubcpdk/tech.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • Hardcoding sbend="bend_s" into the shared route_bundle partial reduces configurability; consider either exposing sbend as an argument to callers (with bend_s as the default) or defining a separate helper for S-bend routing to avoid surprising behavior changes for existing users of route_bundle.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Hardcoding `sbend="bend_s"` into the shared `route_bundle` partial reduces configurability; consider either exposing `sbend` as an argument to callers (with `bend_s` as the default) or defining a separate helper for S-bend routing to avoid surprising behavior changes for existing users of `route_bundle`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request modifies the route_bundle partial in ubcpdk/tech.py to include sbend="bend_s" by default. Feedback indicates that this global change may lead to cross-section mismatches or DRC errors in derived routing strategies, such as rib or metal routes, where curved S-bends are inappropriate.

Comment thread ubcpdk/tech.py

route_single = partial(gf.routing.route_single, cross_section="strip")
route_bundle = partial(gf.routing.route_bundle, cross_section="strip")
route_bundle = partial(gf.routing.route_bundle, cross_section="strip", sbend="bend_s")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Applying sbend="bend_s" to the base route_bundle partial propagates this parameter to all derived routing strategies, including route_bundle_rib, route_bundle_metal, and route_bundle_metal_corner (defined in lines 345-364).

This introduces two potential issues:

  1. Cross-section Mismatch: If bend_s is a fixed-layer component (common in PDKs using GDS cells like SiEPIC), it will cause layer or width mismatches when used in route_bundle_rib or route_bundle_metal.
  2. Electrical Routing: Electrical strategies like route_bundle_metal typically avoid curved S-bends. Enabling this globally may cause the router to place optical silicon components in metal routes, leading to DRC errors.

Consider enabling sbend only for the specific optical strip strategy or ensuring that the electrical and rib strategies explicitly override it with sbend=None.

@joamatab
joamatab merged commit b253f8d into main May 14, 2026
8 checks passed
@joamatab
joamatab deleted the enable-sbend-in-route-bundle branch May 14, 2026 14:21
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.

2 participants