feat: enable sbend="bend_s" in route_bundle strategies#533
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideConfigures 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_ssequenceDiagram
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
Flow diagram for route_bundle configuration with sbend bend_sflowchart 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]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Hardcoding
sbend="bend_s"into the sharedroute_bundlepartial reduces configurability; consider either exposingsbendas an argument to callers (withbend_sas the default) or defining a separate helper for S-bend routing to avoid surprising behavior changes for existing users ofroute_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`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
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.
|
|
||
| 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") |
There was a problem hiding this comment.
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:
- Cross-section Mismatch: If
bend_sis a fixed-layer component (common in PDKs using GDS cells like SiEPIC), it will cause layer or width mismatches when used inroute_bundle_riborroute_bundle_metal. - Electrical Routing: Electrical strategies like
route_bundle_metaltypically 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.
Summary
sbend="bend_s"in allroute_bundlerouting strategiesTest plan
Summary by Sourcery
Enhancements: