SPICE on gEDA HOWTO -- appendicies

Appendix

Component attribute summary

Native components and their attributes are given in the table below. Bold faced attributes are required, normal typeface attributes are optional. Note that the "device" attribute is invisible, and is normally attached to the symbol when it is created. The other attributes are attached to the symbol during schematic capture using gschem.

"device" "refdes" "value" "model" "file" "model-name" "type" Comment
RESISTOR R? Numeric comp. value One line of spice model parameters (e.g. TC)   Name of model.   "model" parameters are placed inside parentheses after the component value.
CAPACITOR C? Numeric comp. value One line of spice model parameters (e.g. IC, POLY, etc.)   Name of model.   "model" parameters are placed inside parentheses after the component value.
POLARIZED_CAPACITOR C? Numeric comp. value One line of spice model parameters (e.g. IC, POLY, etc.)   Name of model.   "model" parameters are placed inside parentheses after the component value.
INDUCTOR L? Numeric comp. value One line of spice model parameters (e.g. IC, POLY, etc.)   Name of model.   "model" parameters are placed inside parentheses after the component value.
SPICE-ccvs H? String describing source behavior          
SPICE-cccs F? String describing source behavior          
SPICE-vcvs E? String describing source behavior          
SPICE-vccs G? String describing source behavior          
SPICE-nullor E? String describing source behavior          
DIODE D? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
PMOS_TRANSISTOR M? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
NMOS_TRANSISTOR M? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
PNP_TRANSISTOR Q? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
NPN_TRANSISTOR Q? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
PFET_TRANSISTOR

(JFET)
J? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
NFET_TRANSISTOR

(JFET)
J? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
MESFET_TRANSISTOR B? Part number One line SPICE model. Model file name. Name of model.   For modeling, one must include either "model" or "file".
IC U? Part number One line SPICE model. Model file name. Name of model.   IC with .MODEL file
IC X? Part number   Model file name. Name of model.   IC with .SUBCKT file
model A?   One line spice model Model file name. Name of model pointed to by other components. Corresponding SPICE model type (valid types given below). For modeling, one must include either "model" or "file".
include A?     Include file name.     Places .INCLUDE directive in SPICE netlist.
options A? Line of options to include.         Places .OPTIONS directive in SPICE netlist.
directive A? One line string holding SPICE statements for inclusion in netlist.         For modeling, one must include either "model" or "file".
VOLTAGE_SOURCE V? One line string holding voltage source behavior.         Independent voltage source
CURRENT_SOURCE I? One line string holding current source behavior.         Independent current source

"Native to the netlister" means that there is a corresponding blob of scheme code which knows exactly how to handle these components and is guaranteed (almost) to generate correct spice code. Symbols having "device" attributes not on the above list are handled using the scheme function "spice-sdb:write-default-component", which looks at the refdes of the component to make a decision about how to treat the component. In general, this function will "do the right thing" when generating spice code, but it is not guaranteed. In particular, this function cannot distinguish between N and P type transistors, and will generate an <unknown> type for the .MODEL string in the netlist. This will probably cause your SPICE simulator to barf. Therefore, it is best to make sure that all devices used have the proper "device" attribute.

Back to the table of contents.

Valid "type" values

The "type" attribute is a flag signaling the spice engine the component type, and prepares it to accept model parameters specific to that component type. The following values are valid SPICE "type"s:

Component "type" Comment
RESISTOR RES  
CAPACITOR CAP  
POLARIZED_CAPACITOR CAP  
INDUCTOR IND  
DIODE D  
PMOS_TRANSISTOR PMOS  
NMOS_TRANSISTOR NMOS  
PNP_TRANSISTOR PNP  
NPN_TRANSISTOR NPN  
PFET_TRANSISTOR PJF  
NFET_TRANSISTOR NJF  
MESFET_TRANSISTOR    

Back to the table of contents.

Please send comments or questions about this HOWTO to Stuart Brorson at sdb@cloud9.net.