Skip to content

feat(schematic): annotate die_with_pads as a type:die component - #351

Open
pepijndevos wants to merge 1 commit into
mainfrom
feat/die-schematic-annotation
Open

feat(schematic): annotate die_with_pads as a type:die component#351
pepijndevos wants to merge 1 commit into
mainfrom
feat/die-schematic-annotation

Conversation

@pepijndevos

@pepijndevos pepijndevos commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What

die_with_pads in si220/cband and si220/oband now carries a schematic annotation with symbol: "die", so editors render it as a die component (no background box, port labels outside the symbol) instead of a generic circuit box.

  • Ports are derived from the factory kwargsngratings, npads, with_loopback, grating_coupler — through a new callable-ports option on the shared schematic() helper, instead of a static default-parameter snapshot. When GFP resolves schematic metadata per parameterization (dynamic-port support, doplaydo/gdsfactoryplus#3886), this annotation is already parameter-true.
  • Side semantics: the declared side is the die edge the port sits on — the opposite of the port's GDS orientation, which points into the die. Within each side ports are ordered clockwise (left bottom→top, top left→right, right top→bottom, bottom right→left), matching the nyanlib→Mosaic bridge convention (which reverses left/bottom on the way into Mosaic).
  • The edge loopback absorbs the two end gratings, so ngratings-2 ports are exposed per W/E edge when with_loopback is set; npads pads per N/S edge. grating_coupler=None drops the photonic ports entirely.

Dependency

Requires doplaydo/gdsfactoryplus#4402 for type: "die" rendering support in Mosaic/nyanlib.

Verification

Annotation output was compared against built cells in both bands — names, sides, and per-side clockwise order match exactly:

parameters built ports annotated
defaults (worker path, no kwargs) 86 86 ✓
ngratings=10, npads=5 26 26
ngratings=5, npads=3, with_loopback=False 16 16
grating_coupler=None 8 8
oband ngratings=12, npads=7 34 34

Summary by Sourcery

Render parameterized SI220 die_with_pads components as die symbols with ports that accurately reflect their configured pads, gratings, and loopback connections.

New Features:

  • Annotate die_with_pads components in both SI220 bands with die-specific schematic symbols and parameter-dependent photonic and electrical ports.

Enhancements:

  • Add callable port definitions to the shared schematic helper, allowing schematic metadata to reflect component parameterizations and die-edge port ordering.

die_with_pads instances are oversized and unsuitable for schematic
rendering, so editors need to treat them as dies rather than generic
circuit boxes. Annotate the factory with a schematic_function whose
symbol is "die" in both si220 bands.

The port list is derived from the factory kwargs (ngratings, npads,
with_loopback, grating_coupler) rather than a frozen default-parameter
snapshot, so parameterized metadata resolution stays port-true once
dynamic-port support lands. Each declared side is the die edge the port
sits on — the opposite of the port's GDS orientation, which points into
the die — ordered clockwise to match the nyanlib-to-Mosaic bridge.

Verified the annotation against built cells in both bands for default
and non-default parameters.

Depends on doplaydo/gdsfactoryplus#4402 for type:"die" rendering support.
@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

Annotates both C-band and O-band die_with_pads cells with the die schematic symbol and dynamically derives their photonic and electrical ports from factory parameters, including loopback, pad, and grating-coupler options, so schematic rendering matches each built layout.

File-Level Changes

Change Details Files
Add a shared parameter-aware die port generator that reflects optical, electrical, loopback, and coupler configuration.
  • Generate photonic ports only when a grating coupler is configured, accounting for loopback gratings.
  • Generate per-side electrical pad ports and assign clockwise side ordering with die-edge semantics.
  • Allow schematic port definitions to be resolved from component kwargs at schematic-generation time.
cspdk/_schematic.py
Register die-specific schematic metadata for both C-band and O-band components.
  • Use the die symbol and die tag for both band-specific schematic definitions.
  • Attach the schematic function to each die_with_pads factory while preserving existing die tags.
cspdk/si220/cband/_schematic.py
cspdk/si220/cband/cells/die_with_pads.py
cspdk/si220/oband/_schematic.py
cspdk/si220/oband/cells/die_with_pads.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

@pepijndevos
pepijndevos marked this pull request as ready for review September 11, 2026 11:49

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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