Let's use a basic discrete Class A operational amplifier for our subcircuit:
The filename is
sirius-purple-a-mk-2.sch, so the terminal command is:
gnetlist -g spice-sdb sirius-purple-a-mk-2.sch -o sirius-purple-a-mk-2.cir
Then open the
.cir file in a text editor:
Change the last line from "
.end" to "
Then add the
.SUBCKT directive, the subcircuit name (i used
sirius-purple-a for my subcircuit) and the connections (
vpos is pin 1,
vneg is pin 2,
vcc is pin 3,
vee is pin 4 and
output is pin 5):
To include the subcircuit in your schematics, see the Using Subcircuits tutorial.