In some situations it may be desirable to share circuit and analysis across multiple backends. Examples are cross verification, benchmarking, pointing out differences, or demonstrate problems.

Gnucap provides a mechanism that can be used to share batch files with other spice implementations more easily. Consider the following spice input.

spice

I1 1 0 1
R1 1 0 1

*>.print dc v(1)
.dc
*>.end
.print dc v(1)

The key concept here is the “anticomment”: Spice normally ignores all lines starting with “*”. Gnucap in spice mode does not ignore lines starting with *>.

With this, the input above runs with either gnucap, gnucap -b and ngpice -b, performing a similar simulation with similar results.

As you may have noticed, post-punchcard file formats often define preprocessor conditionals. Typical contenders for comparisons such as ngspice do not support any of these.

gnucap/manual/examples/polyglot.txt · Last modified: 2023/04/18 01:31 by felixs
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki