Skip to content

Add custom SPICE subcircuit models via <spicemodel />#2364

Merged
ShiboSoftwareDev merged 4 commits into
tscircuit:mainfrom
ShiboSoftwareDev:main
May 31, 2026
Merged

Add custom SPICE subcircuit models via <spicemodel />#2364
ShiboSoftwareDev merged 4 commits into
tscircuit:mainfrom
ShiboSoftwareDev:main

Conversation

@ShiboSoftwareDev
Copy link
Copy Markdown
Contributor

@ShiboSoftwareDev ShiboSoftwareDev commented May 31, 2026

Adds a Spicemodel component that can be passed through spiceModel={<spicemodel />} on normal
components to emit simulation_spice_subcircuit circuit-json. The implementation uses spicets
to parse .subckt definitions, maps SPICE pins to component ports through spicePinMapping or
matching pin names.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment May 31, 2026 3:46pm

Request Review

Comment thread lib/utils/spice/parse-spice-subckt.ts Outdated
Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

This would be a normal component feature, not just for chips fwiw

you didnt create a new class (all other elements have classes?)

I dont understand why youre parsing the subcircuit to get the name- it doesnt seem necessary?

@ShiboSoftwareDev ShiboSoftwareDev requested a review from seveibar May 31, 2026 14:42
@ShiboSoftwareDev ShiboSoftwareDev changed the title Add chip spiceModel support for custom SPICE subcircuits Add custom SPICE subcircuit models via <spicemodel /> May 31, 2026
Comment thread lib/components/index.ts Outdated
Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

Surprised this works, i think usually children elements need special handling to properly work w the render cycle

Comment thread lib/components/base-components/NormalComponent/NormalComponent.ts Outdated
Comment thread lib/components/primitive-components/Spicemodel.ts Outdated
@ShiboSoftwareDev ShiboSoftwareDev merged commit 69141a5 into tscircuit:main May 31, 2026
9 checks passed
@tscircuitbot
Copy link
Copy Markdown
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

3 participants