Skip to content

Use root relative paths and add verilog models#118

Merged
ThomasPluck merged 2 commits intogdsfactory:feat/schematic-metadatafrom
pepijndevos:feat/schematic-metadata
Mar 27, 2026
Merged

Use root relative paths and add verilog models#118
ThomasPluck merged 2 commits intogdsfactory:feat/schematic-metadatafrom
pepijndevos:feat/schematic-metadata

Conversation

@pepijndevos
Copy link
Copy Markdown
Collaborator

@pepijndevos pepijndevos commented Mar 27, 2026

Summary by Sourcery

Update SPICE model library references to use project-relative paths and vendor model directories, and add Verilog-A device model sources and supporting files for ngspice/XYCE integration.

New Features:

  • Add Verilog-A MOS varactor, PSP103, and R3_CMC model sources and includes for ngspice/XYCE usage.
  • Introduce Verilog-A discipline and nature definitions header for mixed-signal simulations.
  • Provide PSP103 XYCE plugin build and installation instructions.

Enhancements:

  • Standardize all device schematics to reference SPICE model libraries via ihp/models/ngspice/models root-relative paths.

Pepijn de Vos and others added 2 commits March 27, 2026 18:02
Copied from IHP-Open-PDK so the PDK package is self-contained for
ngspice simulation. These can be compiled to OSDI with openvaf.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Mar 27, 2026

Reviewer's Guide

Switches all SPICE device schematics to use root-relative model library paths under ihp/models/ngspice/models and adds Verilog-A model sources, headers, and documentation for MOS varactor, PSP103, and r3_cmc models for ngspice/Xyce integration.

Flow diagram for schematic simulation using root relative ngspice model libraries

flowchart TD
  U[Designer] --> S1[Select device in ihp_cells]

  S1 --> S2[Generate DSchematic with spice_type SUBCKT]
  S2 --> S3[Set library field to ihp/models/ngspice/models/...lib]

  S3 --> C1[Create simulation netlist]
  C1 --> NG[Run ngspice]

  NG --> L1[Resolve library path relative to project root]
  L1 --> L2[Load model file from ihp/models/ngspice/models]
  L2 --> SIM[Execute simulation]

  SIM --> O[Waveforms and results]
Loading

File-Level Changes

Change Details Files
Update all device schematics to use root-relative SPICE model library paths under ihp/models/ngspice/models.
  • Replace bare library filenames (e.g., cornerMOSlv.lib, cornerCAP.lib, cornerHBT.lib, sg13g2_*.lib) with paths prefixed by ihp/models/ngspice/models/ in schematic definitions.
  • Ensure consistency of library path usage across fixed schematics, parameterized device schematics, and ESD/tap/passive cells.
ihp/cells/fixed.py
ihp/cells/bjt_transistors.py
ihp/cells/fet_transistors.py
ihp/cells/passives.py
ihp/cells/rf_transistors.py
ihp/cells/resistors.py
ihp/cells/antennas.py
ihp/cells/capacitors.py
ihp/cells/bondpads.py
Introduce Verilog-A model infrastructure and sources for MOS varactor, PSP103 MOS model, and r3_cmc resistor for ngspice/Xyce.
  • Add standard Verilog-AMS disciplines header used by MOS varactor models.
  • Add MOS varactor Verilog-A sources and related macro/define files under a dedicated mosvar directory.
  • Add PSP103 Verilog-A model sources, macros, JUNCAP200 includes, and a README describing Xyce plugin build and installation steps.
  • Add r3_cmc Verilog-A model, macros, and accompanying license/notice files for compliance.
ihp/models/ngspice/va/mosvar/discipline.h
ihp/models/ngspice/va/mosvar/Changelog
ihp/models/ngspice/va/mosvar/macrosAndDefines_cmc.va
ihp/models/ngspice/va/mosvar/mosvar.va
ihp/models/ngspice/va/mosvar/mosvarpspMacros.va
ihp/models/ngspice/va/psp103/README.md
ihp/models/ngspice/va/psp103/Changelog
ihp/models/ngspice/va/psp103/Common103_macrodefs.include
ihp/models/ngspice/va/psp103/JUNCAP200_InitModel.include
ihp/models/ngspice/va/psp103/JUNCAP200_macrodefs.include
ihp/models/ngspice/va/psp103/JUNCAP200_parlist.include
ihp/models/ngspice/va/psp103/JUNCAP200_varlist1.include
ihp/models/ngspice/va/psp103/JUNCAP200_varlist2.include
ihp/models/ngspice/va/psp103/PSP103_ChargesNQS.include
ihp/models/ngspice/va/psp103/PSP103_InitNQS.include
ihp/models/ngspice/va/psp103/PSP103_SPCalculation.include
ihp/models/ngspice/va/psp103/PSP103_binning.include
ihp/models/ngspice/va/psp103/PSP103_binpars.include
ihp/models/ngspice/va/psp103/PSP103_macrodefs.include
ihp/models/ngspice/va/psp103/PSP103_module.include
ihp/models/ngspice/va/psp103/PSP103_nqs_macrodefs.include
ihp/models/ngspice/va/psp103/juncap200.va
ihp/models/ngspice/va/psp103/psp103.va
ihp/models/ngspice/va/psp103/psp103_nqs.va
ihp/models/ngspice/va/psp103/psp103t.va
ihp/models/ngspice/va/psp103/releasenotesPSP103p6.txt
ihp/models/ngspice/va/r3_cmc/Changelog
ihp/models/ngspice/va/r3_cmc/LICENSE.txt
ihp/models/ngspice/va/r3_cmc/NOTICE.txt
ihp/models/ngspice/va/r3_cmc/r3_cmc.va
ihp/models/ngspice/va/r3_cmc/r3_cmc_macros.include

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

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

We failed to fetch pull request #118.

You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.

@ThomasPluck ThomasPluck merged commit 2b58c35 into gdsfactory:feat/schematic-metadata Mar 27, 2026
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