3
\$\begingroup\$

Is there an official IEEE or other standard for SPICE netlists? I have tried to find one and not found it.

My friends and I are interested in building parsers of netlist files as input. I understand that there are many different SPICE simulators (LTspice, PSPICE, Ngspice, et cetera). Do they all conform to the same standard, or does each have extensions beyond a common base?

Is there an accepted BNF, extended BNF, LL(1) or other grammar definition for SPICE netlists?

toolic
10.8k11 gold badges31 silver badges35 bronze badges
asked Aug 29, 2023 at 22:40
\$\endgroup\$
1
  • \$\begingroup\$ I would start here. Most SPICE implementations (including LTspice and ngspice) are based on SPICE3, so that would be the common base I would target. Things like LTspice's "A-devices" would be bonus on top of that. Since Pspice was created back in the SPICE2 days, things that were eventually added in SPICE3 (such as switches) have different syntax in Pspice (e.g. VSWITCH & ISWITCH). LTspice and ngspice have extra compatibility built-in to accept proprietary Pspice syntax. \$\endgroup\$ Commented Aug 30, 2023 at 0:38

1 Answer 1

2
\$\begingroup\$

No, there is no IEEE Std for SPICE netlists. Refer to the SPICE page on Wikipedia for more information.

You could focus on the version of SPICE you plan to use. There will be many common features among the different versions, but there will also be plenty of differences. Your parser should be capable of providing the user with diagnostic messages for unsupported features.

Before you completely re-invent a wheel, make sure you search the web for existing parsers, like PySpice. Even if they don't do exactly what you need, you should be able to leverage the code.

answered Aug 30, 2023 at 10:29
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.