Table of Contents

Language : Spectre

The Spectre language plugin attempts to support the syntax of the Cadence Spectre simulator.

Not all features of Spectre are supported, but those that work will work with Spectre syntax. Wherever possible, Gnucap features will work in Spectre mode, even if they don't work in Spectre.

The Spectre mode is case sensitive, and uses “SI” units.

The “SI” units are case sensitive. 1p is 1e-12. 1P is 1e15. 1m is 1e-3. 1M is 1e6.

Comments are preceded by // and extend to the end of the line.

The format is line oriented. A newline terminates a statement. You can extend a line by ending it with \ .

From startup, you can set Spectre mode with the command line:

simulator lang=spectre

Top-level blocks

Two top level blocks are supported: model and subckt.

model

A “model” statement sets parameters based on an existing compiled model. This will be extended to cover all “masters”. It becomes a “master” that can be instantiated later. It is equivalent to a spice ”.model” or a Verilog “paramset”.

The syntax is: “model” newname itsmaster parameters

model gp-npn npn bf=150

Components

All components have the same syntax:
label (port list) type arguments

subckt amp (out in vcc)
parameters rload=10k
Rb1  (base vcc) resistor r=1M   // 1 megohm
Rb2  (base 0  ) resistor r=100k
Rc   (col  vcc) resistor r=100k
Re   (emit 0  ) resistor r=10k
Ce   (emit 0  ) capacitor c=1m  // 1 millifarad
Cin  (base in ) capacitor c=1u
Q1 (col base emit) gp-npn
Q2 (vcc col e2) gp-npn
Re2  (e2   0  ) resistor r=1k
Cout (e2   out) capacitor c=10u
Rload (out 0  ) resistor r=rload
ends amp
Vcc (vcc 0) vsource dc=15
Vin (in  0) vsource ac=1
Rload (out 0) resistor r=10k

Commands

Commands usually have the same syntax as components, but there is no port list.

The Spectre mode does not introduce any new commands. The only change is the syntax.

In Spectre mode, there is a label before the command, like a component. The label names a file which will contain the results of the command. The filename extension is the command.

As an non-standard extension, using a dash '-' as the label sends the command output to the standard output.

Commands are executed in the order given.

setbias op
response ac start=20 stop=20K dec=10
- ac

This is equivalent to the native mode:

op >setbias.op
ac start=20 stop=20K dec=10 >response.ac
ac

Extras

Status

The current implementation in gnucap differs slightly from the Cadence product.