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?
-
\$\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\$Ste Kulov– Ste Kulov2023年08月30日 00:38:20 +00:00Commented Aug 30, 2023 at 0:38
1 Answer 1
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.