Skip to content

Conversation

@martinjankoehler
Copy link
Contributor

@martinjankoehler martinjankoehler commented Oct 2, 2025

NOTE: depends on PRs #671 and #670, please review/merge those first

  • PyCell ViaStack supports Cont/Activ/GatPoly
  • Native KLayout PCell added separately, which is necessary for the new KLayout 0.30.4 Path-Via-Feature (place via using shortcut 'O')

@mole99
Copy link
Contributor

mole99 commented Nov 3, 2025

This is a great enhancement to the KLayout setup. I just saw Matthias demonstrate it in the "MICROELECTRONICS 2025: From Technology to Application" webinar.

@martinjankoehler martinjankoehler force-pushed the via-pcell branch 5 times, most recently from a4f01e0 to 76e9603 Compare November 7, 2025 22:35
martinjankoehler and others added 20 commits November 10, 2025 19:17
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
… cell

Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
…nd gap in the middle of the array

Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
…rays

Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
… / pya.ViaType

Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
…enclosure rules

Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
@martinjankoehler
Copy link
Contributor Author

OK, added some changes:

  • Now enclosure rules *.c vs *.c1 are honored
  • Bigger array spacing rules *.b vs *.b1 are honored

Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
@KrzysztofHerman
Copy link
Contributor

@martinjankoehler thank you for these contributions, I am reviewing it.
The issue I have after merging 670,671 and 703 is that I get these errors after hitting 'O' key:

ERROR: /home/herman/github/KrzysztofHerman/IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/python/sg13g2_native_pcell_lib/sg13_klayout_tech_info.py:76: AttributeError: 'ViaInfo' object has no attribute 'klayout_via_type' in PCellDeclaration.via_types
  /home/herman/github/KrzysztofHerman/IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/python/sg13g2_native_pcell_lib/sg13_klayout_tech_info.py:76
  /usr/lib/python3.12/functools.py:995
  /home/herman/github/KrzysztofHerman/IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/python/sg13g2_native_pcell_lib/via_pcell.py:67

Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
Signed-off-by: Martin Jan Köhler <info@martinjankoehler.com>
@martinjankoehler
Copy link
Contributor Author

@KrzysztofHerman

Thanks for the report, I've added 2 commits that should fix this issue.

@KrzysztofHerman
Copy link
Contributor

@martinjankoehler thank you it works, I will continue the review. It looks very good.
Until now I have one question: What was the motivation to introduce a separate native library ?

@martinjankoehler
Copy link
Contributor Author

martinjankoehler commented Dec 1, 2025

@KrzysztofHerman this is required for KLayout's O-keystroke Feature to work.
I have therefore separated:

  1. in regular IHP library
    • via_stack: PyCell based, no KLayout dependency to be compatible with proprietary flow
    • TechInfo: encapsulating DRC rules reusable for both via_stack and via_pcell below
  2. KLayout-native library, currently containing via_pcell
    • after this library is registered/loaded at startup, then KLayout knows what to do if user presses O

@KrzysztofHerman
Copy link
Contributor

@martinjankoehler a time ago we have introduced a "preprocessor like" constructs to
distinguish between different tools, which actually make function calls ie.

#ifdef KLAYOUT
        klayout specific code
#else

#endif

maybe it is a helpful information.

@martinjankoehler
Copy link
Contributor Author

martinjankoehler commented Dec 1, 2025

@martinjankoehler a time ago we have introduced a "preprocessor like" constructs to distinguish between different tools, which actually make function calls ie.

#ifdef KLAYOUT
        klayout specific code
#else

#endif

maybe it is a helpful information.

Thanks for the info, I already saw it. In this case I found it cleaner to keep it separate for multiple reasons:

  • cleaner code with separation of concerns
  • easier to debug in isolation without preprocessing
  • the native library can serve as a template for other Open PDKs to implement the O-Feature

IMO in the IHP context, these native pcell library should be kept to a minimum (to honor the PyCell4KLayout strategy), but is useful exactly in those rare cases of KLayout-specific features (like O), where a real native KLayout PCell is mandatory.

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.

4 participants