Skip to content

feat(Xyce): expand environment variables when using 'include', 'lib' and 'include script' - #1610

Merged
ra3xdh merged 3 commits into
ra3xdh:currentfrom
tskaar:dev/ts/xyce-expand-envvars-include
Mar 29, 2026
Merged

feat(Xyce): expand environment variables when using 'include', 'lib' and 'include script'#1610
ra3xdh merged 3 commits into
ra3xdh:currentfrom
tskaar:dev/ts/xyce-expand-envvars-include

Conversation

@tskaar

@tskaar tskaar commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

What

Expands environment variables when using Xyce as the default simulator and in the case where one uses either '.INCLUDE', '.LIB' and 'include script' blocks in Qucs-S.

Why

This is to make the schematics slightly more portable, by allowing for env. variables rather than using absolute paths.
This also makes it closer to what NGSpice currently supports (natively).

Example

Using the IHP PDK as a reference in this case, when using an include script such as:

image

And when looking at the netlist, I now get:

.LIB /home/torleif/git/OSIC/IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerMOSlv.lib mos_tt
.LIB /home/torleif/git/OSIC/IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerMOShv.lib mos_tt
.LIB /home/torleif/git/OSIC/IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerHBT.lib hbt_typ
.LIB /home/torleif/git/OSIC/IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerRES.lib res_typ
.LIB /home/torleif/git/OSIC/IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerCAP.lib cap_typ
.LIB /home/torleif/git/OSIC/IHP-Open-PDK/ihp-sg13g2/libs.tech/xyce/models/cornerDIO.lib dio_tt

.INCLUDE /home/torleif/git/OSIC/IHP-Open-PDK/ihp-sg13g2/libs.ref/sg13g2_stdcell/spice/sg13g2_stdcell.spice

where:

  • $PDK_ROOT=/home/torleif/git/OSIC/IHP-Open-PDK/
  • $PDK=ihp-sg13g2

In current this wouldn't be able to be simulated in Xyce, since it doesn't expand environment variables natively (unlike NGSpice).

This is also tested on .LIB and .INCLUDE blocks:

image

tskaar added 3 commits March 24, 2026 17:11
Generic helper function to expand environment variables in a given string.
Manually expand environment variables when using Xyce
for '.LIB', '.INCLUDE' and 'include script'.
This allows for easier portability and implements
the same kind of functionality that NGSpice natively supports.
@ra3xdh ra3xdh added the xyce label Mar 28, 2026
@ra3xdh ra3xdh added this to the 26.1.0 milestone Mar 28, 2026
@ra3xdh

ra3xdh commented Mar 29, 2026

Copy link
Copy Markdown
Owner

The CI for Win-arm64 (clang) is failing with strange error in qucs/healer.cpp. I cannot reproduce this error using local build with Clang and Linux.

@tskaar

tskaar commented Mar 29, 2026

Copy link
Copy Markdown
Contributor Author

@ra3xdh

Are you able to trigger a CI build on current (without this PR), to see if it passes/fails?
If it passes I'll see if I can figure out what went wrong in this PR, even though I don't touch healer.cpp here 🤔

@ra3xdh

ra3xdh commented Mar 29, 2026

Copy link
Copy Markdown
Owner

The fail is surely not related to this PR. I am merging this.

@ra3xdh
ra3xdh merged commit ff59ade into ra3xdh:current Mar 29, 2026
21 of 24 checks passed
@tskaar
tskaar deleted the dev/ts/xyce-expand-envvars-include branch April 20, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants