Rules and Conventions

Circuit File Organization

The first statement in a circuit file must be a title statement, and the last statement must be a .END statement. The order of the remaining statements is arbitrary.

Continuation (+) statements must immediately follow the statement being continued.

Electrical Conventions

With respect to branch voltages and currents, DR. SPICE uniformly uses the associated reference convention (current flows in the direction of voltage drop).

The circuit cannot contain a loop of voltage sources and/or inductors and cannot contain a cutset of current sources and/or capacitors.

Each node in the circuit must have a DC path to ground. Every node must have at least two connections except for transmission line nodes (to permit unterminated transmission lines) and MOSFET substrate nodes (which have two internal connections anyway).

Node Naming Conventions

Node names may be arbitrary character strings. The datum (ground) node must be named zero ( 0 ). There is no limit to the number of characters in a node name; use only alphanumeric characters.

When using a node name instead of a node number in .PROBE/CSDF, .IC, and .NODESET statements and in behavioral model equations, always enclose the node name in square brackets, as shown in the following examples:

.NODESET V([VCOIN])=2.5V V([PYOUT])=2.5V V([N4N7])=2.5V .IC V(3)=5 V(2)=0 V([N18])=5 V(1)=12 .PROBE/CSDF V([PYOUT]) V([VCOIN])

Statement Syntax

DR. SPICE circuit file statements may contain the following punctuation:

< > + = , ( )

Blanks, commas, equal (=) signs, or left or right parentheses separate fields in a statement; extra spaces are ignored.

A plus (+) sign in column 1 of a row indicates a continued statement from the previous line.

Data enclosed in angle brackets ( < > ) are optional.

Name Fields

A name field must begin with an alphabetical character and cannot contain any delimiters. Element names can contain any number of characters, but you should use only alphanumeric characters. For example, valid resistor names include: R, R1, RSE, ROUT, and R3AC2ZY are valid resistor names.

The following is an example element statement:

RXXXXXXX N1 N2 VALUE

The first letter of the element name specifies the element type, e.g., R for resistor, C for capacitor, or K for inductor. The string XXXXXXX (or YYYYYYY or ZZZZZZZ) denotes arbitrary alphanumeric strings.

Number Fields

A number field is one of the following:

DR. SPICE Scale Factors                 
                                        
Scale Factor            
S                        
y                        
m                        
b                        
o                        
l                        
                        
T                         1E12                             
                                                           
G                         1E9                              
                                                           
MEG                       1E6                              
                                                           
K                         1E3                              
                                                           
MIL                       25.4E-6                          
                                                           
M                         1E-3                             
                                                           
U                         1E-6                             
                                                           
N                         1E-9                             
                                                           
P                         1E-12                            
                                                           
F                         1E-15                            
                                                         

Letters immediately following a number that are not scale factors are ignored, and letters immediately following a scale factor are ignored. Hence, 10, 10V, 10VOLTS, and 10HZ all represent the same number, and M, MA, MSEC, and MMHOS all represent the same scale factor. Note that 1000, 1000.0, 1000HZ, 1E3, 1.0E3, 1KHZ, and 1K all represent the same number.

Predefined Variables

NameMeaning
TIME time, in transient analysis,0
otherwise
FREQUENCY, FREQ frequency, in AC related
analyses,0 otherwise
TEMP temperature
e 2.71828183
pi 3.14159265

 

Return to main help menu