!!KEYWORD
main
!!TITLE
Help System
!!TEXT 
      This is the jspice3 help system.  To chose a subtopic or
      see-also topic, click a mouse button in the appropriate box
      below,  or type the number of the topic that you want if you
      are using an ASCII terminal.
 
!!SUBTOPICS
analyses
arguments
batchmode
bugs
caveats
commands
convergence
cshstuff
elements
examples
expressions
graphics
hpux
input
models
new
options
pc
proglang
refs
sced
sconvert
spice
variables
vms

*****************************************************************
*
* General
*
*****************************************************************

!!KEYWORD
aliases
!!TITLE
Aliases
!!TEXT 
      After history expansion, if the first word on the command
      line has been defined as an alias, the text for which it is
      an alias for is substituted.  The alias may contain refer-
      ences to the arguments provided on the command line, in
      which case the appropriate arguments are substituted in.  If
      there are no such references, any arguments given are
      appended to the end of the alias text.
 
      In the body if the alias text, any strings of the form
      !:number are replaced with the number'th argument of the
      actual command line.  Note that when the alias is defined
      with the alias command, these strings must be quoted to
      prevent history substitution from replacing the !'s before
      the alias command can get to them.
 
      Thus the command
 
           alias foo echo '!:2' '!:1'
 
      Causes "foo bar baz" to be replaced with "echo baz bar".
      Other !  modifiers as described in the section on history
      substitution may also be used, always refering to the actual
      command line arguments given.
 
      Except under DOS, if a command line starts with a backslash
      (`\') any alias substitution is inhibited.  Under DOS, the
      backslash character has no special significance, and quoting
      must be used to prevent alias substitution.
 
!!SEEALSO
alias
unalias

!!KEYWORD
batchmode
!!TITLE
Batch Mode
!!TEXT 
      If spice is run with the -b flag, it will process the circuit
      in batch mode, similar to that of SPICE2.  The files are input
      on the command line, and if no files are listed, the standard
      input is read.  Most of the control lines recognised by SPICE2
      will be handled, including .plot, .print, and .four.  The
      output will be a margin analysis file if a margin run is input,
      otherwise if the -r option is used (-r rawfilename), a rawfile
      is produced.  Otherwise output is sent to the standard output,
      in the form of ascii plots and print output as directed by
      .plot/.print lines.  The format of this output is somewhat
      different from SPICE2, however, and much less information is
      available from an operating point analysis.  Some SPICE2 options
      are not supported.

      Server mode is similar to batch mode, however input is taken
      only from the standard input, and output is exclusively to
      the standard output.  The output is either in rawfile or
      margin analysis format, and inappropriate command line options
      sucn as -r, -b are ignored.

      In server mode, lines in a control file such as

           .control
           cktfile
           tran 1p 100p
           ...

      will generate raw output (on stdout).  The same lines in batch
      mode will do nothing, unless followed by a "write rawfilename"
      line.  Similarly, a "run rawfilename" will perform the analysis
      in the circuit (NOT the control) file, and create rawfilename
      in batch mode.  In servermode, the output is to stdout,
      rawfilename is ignored. In a control file, "run" will generate
      raw data on stdout in server mode, but will do nothing in batch
      mode unless followed by a "write" command.  This is true
      whether or not the -r option is used in invoking spice.
      However, if the input file is a circuit file, and there are
      .plot/.print commands, if -r is not given, the ascii plots and
      prints will be generated on stdout in batch mode.

      Examples:

        cktfile:

           title
           .tran 1p 100p
           .plot tran v(1)
           ...
           .end

        control_file:

           blank line
           .control
           cktfile
           run
           .endc

      "spice3 -b cktfile" generates a plot on stdout

      "spice3 -b -r raw cktfile" generates a rawfile named "raw".

      "spice3 -s <cktfile" generates a rawfile on stdout.

      "spice3 -s <control_file" generates a rawfile on stdout.

      "spice3 -b control_file" does nothing.

      "spice3 -b -r raw control_file" does nothing.


        control_file:

           blank line
           .control
           cktfile
           run f1
           .endc

      "spice3 -s <control_file" generates a rawfile on stdout
            (tran 2p 50p), ignores file f1.

      "spice3 -b -r xxx control_file" puts tran 1p 100p in rawfile f1,
            ignores xxx.


         control_file:

            blank line
            .control
            cktfile
            tran 2p 50p
            .endc


      "spice3 -s <control_file" generates a rawfile on stdout
            (tran 2p 50p).

      "spice3 -b -r xxx control_file" does nothing.


         control_file:

            blank line
            .control
            cktfile
            tran 2p 50p
            write f1
            .endc

      "spice3 -s <control_file" generates a rawfile on stdout
            (tran 2p 50p), puts constants in file f1.

      "spice3 -b [-r xxx] control_file" puts tran 2p 50p in rawfile f1.
            If -r xxx was specified and f1 not, then file xxx would be
            used.  If neither file was specified, "rawspice.raw" would
            be used.
 
!!SEEALSO
dashb
dashs

!!KEYWORD
bugs
!!TITLE
Bugs
!!TEXT 
      The label entry facilities are very primitive - after all,
      nutmeg isn't a graphics editor (yet).  You must be careful
      to type very slowly when entering labels -- nutmeg checks
      the X event queue once every second, and can get very con-
      fused if characters arrive faster than that.
 
      When defining aliases like
 
           alias pdb plot db( '!:1' - '!:2' )
 
      you must be careful to quote the argument list substitutions
      in this manner. If you quote the whole argument it might not
      work properly.
 
      In a user-defined function, the arguments cannot be part of
      a name that uses the plot.vec syntax.  I.e,
 
           define poke(duck) cos(tran1.duck)
 
      won't do the right thing.
 
      If you type plot all all, or otherwise use a wildcard refer-
      ence for one plot twice in a command, bad things will hap-
      pen.
 
      The asciiplot command doesn't deal with log scales or most
      of the keywords that plot recognises.  Don't expect it to
      ever do smith charts.
 
      When a new vector is created with the [ ] and [[ ]] opera-
      tions, a subset of the old scale should also be created for
      it that includes the same elements, so that it may be plot-
      ted, etc.
 
      When substitutions are done with the ^old^new^ syntax, there
      may be no spaces in either old or new.
 
      If the user erases text in an X plot window by typing spaces
      over it, and then dumps it to a file with the hardcopy com-
      mand, the erased text will re-appear.
 
      If an X plot window is created and then resized to be much
      larger, or the hardcopy command is used to dump it to a file
      and it is then printed on a device with much higher resolu-
      tion than the X display, the "automatic manhattanization"
      feature (i.e, round-off error) will cause the picture to
      look very funny.
 
      SPICE3 will recognise all the notations used in SPICE2 .plot
      cards, and will translate vp(1) into ph(v(1)), and so forth.
      However, if there are spaces in these names it won't work.
      Hence v(1, 2) and (-.5, .5) aren't recognised.
 
      The "nutmeg programming language" should serve as a lesson
      on why a language designer should understand that he is
      creating a language before he has already implemented it.
 
      If a command is implemented as a script, the help command
      won't say anything about it and it won't be available for
      command and argument completion.
 
      If you plot an expression containing the function rnd, and
      then zoom in or out in the window, you will get different
      random numbers in the new window.
 
      Global filename expansion has some problems.  In particular,
      */* may give a result of "No match" when there is a file in
      the current directory.
 
!!SEEALSO
caveats

!!KEYWORD
caveats
!!TITLE
Caveats
!!TEXT 
      Often the names of terminals recognised by MFB are different
      from those in /etc/termcap. Thus you may have to reset your
      terminal type with the command
 
           set term = termname
 
      where termname is the name in the mfbcap file.
 
      Spice input files specified on the command line are read in
      before the .spiceinit file is read. Thus if you define
      aliases there that you call in a spice source file mentioned
      on the command line, they won't be recognised.
 
      If you interrupt a simulation and then load in a new deck,
      or setcirc to a different one, and run a simulation on that,
      it will not be possible to resume the old simulation.
 
      Don't trust command completion too much.
 
!!SEEALSO
bugs

!!KEYWORD
ccom
!!TITLE
Command Completion
!!TEXT 
      Tenex-style command completion is available.  If EOF
      (control-D) is typed after the first character on the
      line, a list of the commands or possible arguments is
      printed. (If a control-D is typed as the first character on
      a line it will exit the program in UNIX.) If an escape is
      typed, then the program will try to complete the word being
      typed based on the choices available, or if there is more
      than one posibility, it will complete as much as it can.
      Command completion knows about commands, most keywords,
      variable and vector names, file names, and several other
      types of arguments.
 
!!SEEALSO
dashq
nocc

!!KEYWORD
convergence
!!TITLE
Convergence
!!TEXT 
           Both dc and transient  solutions  are  obtained  by  an
      iterative  process which is terminated when both of the fol-
      lowing conditions hold:
 
      1)   The nonlinear branch  currents  converge  to  within  a
           tolerance  of  0.1  percent or 1 picoamp (1.0E-12 Amp),
           whichever is larger.
 
      2)   The node voltages converge to within a tolerance of 0.1
           percent  or  1  microvolt  (1.0E-6  Volt), whichever is
           larger.
 
           Although the algorithm used in SPICE has been found  to
      be  very reliable, in some cases it will fail to converge to
      a solution.  When this failure occurs, the program will ter-
      minate the job.
 
           Failure to converge in dc analysis is usually due to an
      error  in specifying circuit connections, element values, or
      model parameter values.  Regenerative switching circuits  or
      circuits  with  positive feedback probably will not converge
      in the dc analysis unless the OFF option is used for some of
      the  devices  in  the feedback path, or the .NODESET line is
      used to force the circuit to converge to the desired state.
 

!!KEYWORD
coupled
!!TITLE
Coupled transmission lines
!!TEXT 
      See multiconductor
 
!!SEEALSO
multiconductor

!!KEYWORD
cshstuff
!!TITLE
C-shell Like Features
!!TEXT 
      Various features are available in the nutmeg parser which
      are derived from the user interface of the C-Shell.  These
      include IO redirection, history substitution, aliases, glo-
      bal substitution, and command completion.
 
!!SUBTOPICS
aliases
ccom
glob
historysub
io
quoting
semi
unixcomcomm
variablesub

!!KEYWORD
examples
!!TITLE
Circuit Examples
!!TEXT 
      The following circuits are examples.
 
 
!!SUBTOPICS
ex1
ex2
ex3
ex4
ex5

!!KEYWORD
ex1
!!TITLE
Example 1
!!TEXT 
           The following circuit determines the dc operating point
      of  a  simple differential pair.  In addition, the ac small-
      signal response is computed over the frequency range 1Hz  to
      100MEGHz.
 
           SIMPLE DIFFERENTIAL PAIR
           VCC 7 0 12
           VEE 8 0 -12
           VIN 1 0 AC 1
           RS1 1 2 1K
           RS2 6 0 1K
           Q1 3 2 4 MOD1
           Q2 5 6 4 MOD1
           RC1 7 3 10K
           RC2 7 5 10K
           RE 4 8 10K
           .MODEL MOD1 NPN BF=50 VAF=50 IS=1.E-12 RB=100
           +CJC=.5PF TF=.6NS
           .AC DEC 10 1 100MEG
           .END
 

!!KEYWORD
ex2
!!TITLE
Example 2
!!TEXT 
           The following file computes the output  characteristics
      of a MOSFET device over the range 0-10V for VDS and 0-5V for
      VGS.
 
           MOS OUTPUT CHARACTERISTICS
           VDS 3 0
           VGS 2 0
           M1 1 2 0 0 MOD1 L=4U W=6U AD=10P AS=10P
           .MODEL MOD1 NMOS VTO=-2 NSUB=1.0E15 UO=550
           * VIDS MEASURES ID, WE COULD HAVE USED VDS,
           * BUT ID WOULD BE NEGATIVE
           VIDS 3 1
           .DC VDS 0 10 .5 VGS 0 5 1
           .END
 

!!KEYWORD
ex3
!!TITLE
Example 3
!!TEXT 
           The following file determines the dc transfer curve and
      the  transient pulse response of a simple RTL inverter.  The
      input is a pulse from 0 to 5 Volts  with  delay,  rise,  and
      fall  times of 2ns and a pulse width of 30ns.  The transient
      interval is 0 to 100ns,  with  printing  to  be  done  every
      nanosecond.
 
           SIMPLE RTL INVERTER
           VCC 4 0 5
           VIN 1 0 PULSE 0 5 2NS 2NS 2NS 30NS
           RB 1 2 10K
           Q1 3 2 0 Q1
           RC 3 4 1K
           .MODEL Q1 NPN BF 20 RB 100 TF .1NS CJC 2PF
           .DC VIN 0 5 0.1
           .TRAN 1NS 100NS
           .END
 

!!KEYWORD
ex4
!!TITLE
Example 4
!!TEXT 
           The following file simulates a four-bit  binary  adder,
      using  several subcircuits to describe various pieces of the
      overall circuit.
 
           ADDER - 4 BIT ALL-NAND-GATE BINARY ADDER
           *** SUBCIRCUIT DEFINITIONS
           .SUBCKT NAND 1 2 3 4
           *   NODES:  INPUT(2), OUTPUT, VCC
           Q1 9 5 1 QMOD
           D1CLAMP 0 1 DMOD
           Q2 9 5 2 QMOD
           D2CLAMP 0 2 DMOD
           RB 4 5 4K
           R1 4 6 1.6K
           Q3 6 9 8 QMOD
           R2 8 0 1K
           RC 4 7 130
           Q4 7 6 10 QMOD
           DVBEDROP 10 3 DMOD
           Q5 3 8 0 QMOD
           .ENDS NAND
           .SUBCKT ONEBIT 1 2 3 4 5 6
           *   NODES:  INPUT(2), CARRY-IN, OUTPUT, CARRY-OUT, VCC
           X1 1 2 7 6 NAND
           X2 1 7 8 6 NAND
           X3 2 7 9 6 NAND
           X4 8 9 10 6 NAND
           X5 3 10 11 6 NAND
           X6 3 11 12 6 NAND
           X7 10 11 13 6 NAND
           X8 12 13 4 6 NAND
           X9 11 7 5 6 NAND
           .ENDS ONEBIT
           .SUBCKT TWOBIT 1 2 3 4 5 6 7 8 9
           *   NODES:  INPUT - BIT0(2) / BIT1(2), OUTPUT - BIT0 / BIT1,
           *           CARRY-IN, CARRY-OUT, VCC
           X1 1 2 7 5 10 9 ONEBIT
           X2 3 4 10 6 8 9 ONEBIT
           .ENDS TWOBIT
           .SUBCKT FOURBIT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
           * NODES: INPUT - BIT0(2) / BIT1(2) / BIT2(2) / BIT3(2),
           *        OUTPUT - BIT0 / BIT1 / BIT2 / BIT3, CARRY-IN,
           *                CARRY-OUT,  VCC
           X1 1 2 3 4 9 10 13 16 15 TWOBIT
           X2 5 6 7 8 11 12 16 14 15 TWOBIT
           .ENDS FOURBIT
           *** DEFINE NOMINAL CIRCUIT
           .MODEL DMOD D
           .MODEL QMOD NPN(BF=75 RB=100 CJE=1PF CJC=3PF)
           VCC 99 0 DC 5V
           VIN1A 1 0 PULSE(0 3 0 10NS 10NS   10NS   50NS)
           VIN1B 2 0 PULSE(0 3 0 10NS 10NS   20NS  100NS)
           VIN2A 3 0 PULSE(0 3 0 10NS 10NS   40NS  200NS)
 
 
           VIN2B 4 0 PULSE(0 3 0 10NS 10NS   80NS  400NS)
           VIN3A 5 0 PULSE(0 3 0 10NS 10NS  160NS  800NS)
           VIN3B 6 0 PULSE(0 3 0 10NS 10NS  320NS 1600NS)
           VIN4A 7 0 PULSE(0 3 0 10NS 10NS  640NS 3200NS)
           VIN4B 8 0 PULSE(0 3 0 10NS 10NS 1280NS 6400NS)
           X1 1 2 3 4 5 6 7 8 9 10 11 12 0 13 99 FOURBIT
           RBIT0 9 0 1K
           RBIT1 10 0 1K
           RBIT2 11 0 1K
           RBIT3 12 0 1K
           RCOUT 13 0 1K
           *** (FOR THOSE WITH MONEY (AND MEMORY) TO BURN)
           .TRAN 1NS 6400NS
           .END
 

!!KEYWORD
ex5
!!TITLE
Example 5
!!TEXT 
           The  following  file  simulates   a   transmission-line
      inverter.  Two transmission-line elements are required since
      two propagation modes are excited.  In the case of a coaxial
      line,  the  first  line (T1) models the inner conductor with
      respect to the shield, and the second line (T2)  models  the
      shield with respect to the outside world.
 
           TRANSMISSION-LINE INVERTER
           V1 1 0 PULSE(0 1 0 0.1N)
           R1 1 2 50
           X1 2 0 0 4 TLINE
           R2 4 0 50
           .SUBCKT TLINE 1 2 3 4
           T1 1 2 3 4 Z0=50 TD=1.5NS
           T2 2 0 4 0 Z0=100 TD=1NS
           .ENDS TLINE
           .TRAN 0.1NS 20NS
           .END
 

!!KEYWORD
expressions
!!TITLE
Expressions
!!TEXT 
      An expression is an algebraic combination of already defined
      vectors, constants, operations, and functions.  The func-
      tions may be pre-defined functions or user-defined macros.
 
      A vector must either be defined in the current plot or be
      defined in the constant plot, a set of constants which are
      described below.  A plot is a group of vectors that come
      from the same simulation or otherwise belong together.  The
      current plot can be changed by the setplot command, and is
      generally the results of the last simulation run or the con-
      tents of the last rawfile loaded in.  If no other plots are
      defined, the current plot is the constant plot.
 
      To reference vectors in a plot that is not the current plot
      (see the setplot command, below), the notation
      plotname.vecname can be used.  Either a plotname or a vector
      name may be the wildcard all.  If the plotname is all,
      matching vectors from all plots are specified, and if the
      vector name is all, all vectors in the specified plots are
      referenced.  (The constant plot is never matched by a plot
      wildcard, however.) Note that you may not use binary opera-
      tions on expressions involving wildcards - it is not obvious
      what all + all should denote, for instance.
 
      In spice, a vector name beginning with the `@' symbol is
      considered a reference to an internal device or model param-
      eter, or a circuit parameter.  If the vector name is of the
      form @name[param], this denotes the parameter param of the
      device or model named name.  Of course, there must be a dev-
      ice or model with that name defined for the current circuit
      and param must be a valid parameter name for that device or
      model type.  See the SPICE3 User's Guide for a listing of
      the parameters available.  If the vector name is of the form
      @param, this refers to a parameter of the circuit with the
      name param.  Currently, the only parameters available are
      the resource variables described under the rusage command.
      These vectors may be used as arguments to trace, save, and
      iplot in addition to print.
 
      A detailed description of the format a number may be written
      in can be found in the SPICE3 User's Guide - examples are
      14.6MEG and -1.231E-4. Note that you can either use scien-
      tific notation or one of the abbreviations like MEG or G,
      but not both.  A number may have trailing alphabetic charac-
      ters after it.
 
      Vector names may be of the form string(something), if the
      string is not the name of a built-in or user-defined func-
      tion.
 
      Some examples of expressions are:
           cos(time) + db(v(3))
           sin(cos(log(10)))
           TIME * rnd(v(9)) - 15 * cos(vin#branch) ^ 7.9e5
           not ((ac3.freq[32] & tran1.time[10]) gt 3)
 
!!SUBTOPICS
constants
functions
operators
!!SEEALSO
plot
graf
print

!!KEYWORD
glob
!!TITLE
Global Substitution
!!TEXT 
      The characters `~', `{', and `}' have the same effects as
      they do in the C-Shell, i.e., home directory and alternative
      expansion.  The string ~user at the beginning of a word is
      replaced by the given user's home directory, or if the first
      component of the pathname is simply ~, the current user's
      directory is used.  The string
      Stuff{String1,String2,...StringN}Morestuff is replaced by
      the list of words StuffString1Morestuff
      StuffString2Morestuff ...  StuffStringNMorestuff.  Curly
      braces may be nested.  It is possible to use the wildcard
      characters `*', `?', `[', and `]' to match filenames, where
      `*' denotes 0 or more characters, `?' denotes one character,
      and [] denotes a range of characters, but only if you unset
      noglob first. This makes them rather useless for typing
      algebraic expressions, so you should set noglob again after
      you are done with wildcard expansion. Note that the pattern
      [^abc] will match all characters except `a', `b', and `c'.
      Ideally the parser should know which commands require
      filename arguments in which positions, and so glob expansion
      for those words only.
 
!!SEEALSO
noglob

!!KEYWORD
graphics
!!TITLE
Graphics
!!TEXT 
      Nutmeg can make use of a number of graphics systems to
      display data for the plot and hardcopy commands.  Currently
      the X graphics system is the best supported and prefered
      interface, and MFB (Model Frame Buffer) is used for graphics
      terminals.  The file format used by the hardcopy command can
      be set to postscript, hp PCL, WordPerfect (TM) graphics
      format, and the UNIX plot(5) format.
 
      If a display is given on the command line with the -d option,
      or if the UNIX environment variable DISPLAY is defined, it is
      assumed that an X workstation is available.  The variable
      "display" is set to the value to be used as the name of the
      display to try to open.  If neither of these is set, or if
      the program was not compiled with X, MFB is used for
      graphics.  PC versions use an internal graphics library,
      which supports many super-VGA cards.  The programs are not
      compatible with Microsoft Windows.
 
!!SUBTOPICS
X
!!SEEALSO
plot

!!KEYWORD
historysub
!!TITLE
History Substitution
!!TEXT 
      History substitutions are prefixed by the character !, or at
      the beginning of a line, the character ^. Briefly, the
      string !! is replaced by the previous command, the string
      !prefix is replaced by the last command with that prefix,
      the string !?pattern is replaced by the last command con-
      taining that pattern, the string !number is replaced by the
      event with that number, and ^oldpattern^newpattern is
      replaced by the previous command with newpattern substituted
      for oldpattern.
 
      Additionally, a !string sequence may be followed by a modif-
      ier prefixed with a :.  This modifier may select one or more
      words from the event - :1 selects the first word, :2-5
      selects the second through the fifth word, :$ selects the
      last word, and :$-0 selects all of the words but reverses
      their order.
 
      Two other : modifiers are supported: :p will cause the com-
      mand to be printed but not executed, and :s^old^new will
      replace the pattern old with the pattern new.  (The sequence
      ^old^new is synonymous with !!:s^old^new.)
 
      All the commands typed by the user are saved on the history
      list.  This may be examined with the history command, and
      its maximum length changed by changing the value of the his-
      tory variable.
 
!!SEEALSO
historycomm
historyvar

!!KEYWORD
hpux
!!TITLE
HP-UX Notes
!!TEXT 
      Jspice3 runs on the HP series 9000 computers, sort of.  This
      operating system has many nonstandard "features" which make
      porting code difficult to HP machines.
 
!!KEYWORD
io
!!TITLE
I/O Redirection
!!TEXT 
      The input to or output from commands may be changed from the
      terminal to a file by including an IO redirection on the
      command line.  The possible redirections are:
 
      > file
           Sends the output of the command into the file.
 
      >> file
           Appends output to the file or creates it if it doesn't
           exist.
 
      >& file
           Sends both the output and the error messages to the
           file.
 
      >>& file
           Appends both the output and the error messages to the
           file.
 
      < file
           Reads input from the file.
 
      Both an input redirection and an output redirection may be
      present on a command line.  More than one of each may not be
      present, however.  IO redirections must be at the end of the
      command line.

!!KEYWORD
pc
!!TITLE
MS-DOS Notes
!!TEXT 
      Jspice3 and nutmeg run on IBM compatible 386/486 machines
      in protected mode, under a DOS extender.
      For information contact:

         Stephen R. Whiteley
         Conductus, Inc.
         969 West Maude Ave.
         Sunnyvale, CA 94086
         (408) 737-6770
         stevew@conductus.com


!!KEYWORD
proglang
!!TITLE
The Command Language
!!TEXT 
      nutmeg commands include constructs for looping, conditional
      execution, etc. Thus simple programs may be written and exe-
      cuted as scripts.  As a programming language it is quite
      simple, however, and line oriented (all blocks must begin
      with some sort of control statement, like if, and end with
      the end statement).  Because of nutmeg's numeric orienta-
      tion, string variables are only minimally supported and are
      quite awkward to deal with.  (See the strcmp command.)
 
      The following control structures are available:
 
 
           while condition
                statement
                ...
           end
 
      While condition, an arbitrary algebraic expression, is true,
      execute the statements.
 
 
           repeat [number]
                statement
                ...
           end
 
      Execute the statements number times, or forever if no argu-
      ment is given.
 
 
           dowhile condition
                statement
                ...
           end
 
      The same as while, except that the condition is tested after
      the statements are executed.
 
 
           foreach var value ...
                statement
                ...
           end
 
      The statements are executed once for each of the values,
      each time with the variable var set to the current one.
      (var can be accessed by the $var notation - see below).
 
 
           if condition
                statement
                ...
           else
                statement
                ...
           end
 
      If the condition is non-zero then the first set of state-
      ments are executed, otherwise the second set.  The else and
      the second set of statements may be omitted.
 
           label word
 
      If a statement of the form goto word is encountered, control
      is transfered to this point, otherwise this is a no-op.
 
           goto word
 
      If a statement of the form label word is present in the
      block or an enclosing block, control is transfered there.
      Note that if the label is at the top level, it must be
      before the goto statement (i.e, a forward goto may occur
      only within a block).
 
           continue [ number ]
 
      If there is a while, dowhile, or foreach block enclosing
      this statement, control passes to the test, or in the case
      of foreach, the next value is taken.  Otherwise an error
      results.  If a number is given, that many surrounding blocks
      are continued.  If there are not that many blocks, an error
      results.
 
           break [ number ]
 
      If there is a while, dowhile, or foreach block enclosing
      this statement, control passes out of the block. Otherwise
      an error results.  If a number is given, that many surround-
      ing blocks are continued.  If there are not that many
      blocks, an error results.
 
      Control structures may be nested.  When a block is entered
      and the input is the terminal, the prompt becomes a number
      of >'s equalling the number of blocks the user has entered.
      The current control structures may be examined with the
      debugging command cdump.
 
      There are predefined aliases endif, endwhile, and so on for
      all the above control statements if you prefer them over
      end.
 
      If a word is typed as a command, and there is no built-in
      command or codeblock with that name, the directories in the
      sourcepath list are searched in order for the file.  If it
      is found, it is read in as a command file (as if it were
      source'd).  Before it is read, however, the variables argc
      and argv are set to the number of words following the
      filename on the command line, and a list of those words
      respectively.  An internal stack is maintained for these
      variables, so that they maintain their values across command
      script calls.  These variables can not be set directly. After
      the top level file is finished, these variables are unset.
      Command files should not be re-entrant since there are no
      local variables.  (Of course, the procedures may explicitly
      manipulate a global stack.) This way one can write scripts
      analogous to shell scripts for nutmeg and spice  Note that
      for the script to work with spice, it must begin with a blank
      line (or what ever you like, since it will be thrown away)
      and then a line with .control on it.  This is an unfortunate
      result of the source command being used for both circuit input
      and command file execution.  Note also that this allows the
      user to merely type the name of a circuit file as a command,
      and it  will be automatically loaded.
 
      For examples of nutmeg "programs", check the scripts pro-
      vided in the scripts directory in the SPICE3 library.  (This
      may be found in ~cad/lib/spice3 on Berkeley machines.)
 
!!SEEALSO
commands
unixcomcomm

!!KEYWORD
quoting
!!TITLE
Quoting
!!TEXT 
      Words may be quoted with the characters " (double quote), '
      (single quote), and ` (back quote).   A word enclosed by any
      of these quotes may contain white space.  A string enclosed
      by double quotes may have further special-character substi-
      tutions done on it, but it will be considered one word by
      the program.  A number so quoted is considered a string.  A
      string enclosed by single quotes also has all its special
      characters protected.  Thus no glob expansion (*, ?, etc),
      variable expansion ($), or history substitution (^, !) will
      be done.  Numbers are still considered numbers though.  A
      string enclosed by backquotes is considered a command to the
      shell and is executed, and the output of the command
      repalaces the text.  Obviously the command should not gen-
      erate too much output.  This only works on UNIX systems.
 

!!KEYWORD
refs
!!TITLE
References
!!TEXT 
      [1] A. Vladimirescu and  S.  Liu,  "The  Simulation  of  MOS
      Integrated  Circuits  Using SPICE2", ERL Memo No. ERL M80/7,
      Electronics Research Laboratory, University  of  California,
      Berkeley, Oct. 1980.
 
      [2] B. J. Sheu, D. L. Scharfetter, and  P.  K.  Ko,  "SPICE2
      Implementation of BSIM" ERL Memo No. ERL M85/42, Electronics
      Research Laboratory, University of California, Berkeley, May
      1985.
 
      [3] J. R. Pierret, "A MOS Parameter Extraction  Program  for
      the  BSIM Model" ERL Memo Nos. ERL M84/99 and M84/100, Elec-
      tronics  Research  Laboratory,  University  of   California,
      Berkeley, Nov. 1984.
 
      [4] H.Statz et al.,"GaAs FET Device and  Circuit  Simulation
      in  SPICE", Internal memorandum, Raytheon Research Division,
      Lexington, Mass. ,1985.
 

!!KEYWORD
sconvert
!!TITLE
Sconvert Program
!!TEXT 
 NAME
      sconvert - convert spice formats
 
 SYNOPSIS
      sconvert fromtype fromfile totype tofile
      sconvert fromtype totype
      sconvert
 
 DESCRIPTION
      Sconvert translates spice output files among three formats:
      the old binary format, a new binary format, and a new ascii
      format.  The formats are specified by the fromtype and
      totype arguments: `o' for the old format, `b' for the new
      binary format, and `a' for the new ascii format.  Fromtype
      specifies the format to be read, and totype specifies the
      format to be written.  If fromfile and tofile are given,
      then they are used as the input and output, otherwise stan-
      dard input and output are used.  (Note that this second
      option is only available on UNIX systems - on VMS and other
      systems you must supply the filenames.) If no arguments are
      given, the parameters are prompted for.
 
      Binary format is the preferred format for general use, as it
      is the most economical in terms of space and speed of
      access, and ascii is provided to make it easy to modify data
      files and transfer them between machines with different
      floating-point formats.  The old format is provided only for
      backward compatibility.
 
      The ascii format consists of lines or sets of lines intro-
      duced by a keyword.  The Title and Date lines should be the
      first in the file and should occus only once.  There may be
      any number of plots in the file, each one beginning with the
      Plotname, Flags, No. Variables, No. Points, Variables, and
      Values lines.  Command and Option lines are optional and may
      occur anywhere between the Plotname and Values lines.  Note
      that after the Variables keyword there must be numvars
      "declarations" of outputs, and after the Values keyword,
      there must be numpoints lines, each consisting of numvars
      values.  (If this is confusing just create an ascii rawfile
      with nutmeg and look at it...)
       Line name       Description
       Title           An arbitrary string describing the circuit
       Date            A free-format date string
       Plotname        A string describing the analysis type -
                       see the description for the deftype
                       nutmeg command
       Flags           Currently, either complex or real
       No. Variables   The number of variables (numvars)
       No. Points      The number of points (numpoints)
       Command         An arbitrary nutmeg command
       Option          nutmeg variables
       Variables       A number of variable lines (see below)
       Values          A number of data lines (see below)
 
      Any text on a Command line is executed when the file is
      loaded as if it were typed as a command.  By default, spice
      puts a version command into every rawfile it creates.
 
      Text on a Option line is parsed as if it were the arguments
      to a nutmeg set command.  The variables set are then avail-
      able normally, except that they are read only and are asso-
      ciated with the plot (see the nutmeg documentation).
 
      A variable line looks like number name typename [ parm=value
      ] ....  The numbers are irrelevant, the name is the name by
      which this quantity will be refered to by nutmeg, the
      typename may either a pre-defined type or one defined with
      the deftype command, and the parm's are listed below.
                          Predefined Types
 
      Name           Description            SPICE2 Numeric Code
 
      notype         Dimensionless value    0
      time           Time                   1
      frequency      Frequency              2
      voltage        Voltage                3
      Current        Current                4
      output-noise   SPICE2 .noise result   5
      input-noise    SPICE2 .noise result   6
      HD2            SPICE2 .disto result   7
      HD3            SPICE2 .disto result   8
      DIM2           SPICE2 .disto result   9
      SIM2           SPICE2 .disto result   10
      DIM3           SPICE2 .disto result   11
      pole           SPICE3 pz result       12
      zero           SPICE3 pz result       13
                                  Parameters
 
      Name    Description
 
      min     Minimum significant value for this output
      max     Maximum significant value for this output
      color   The name of a color to use for this value
      scale   The name of another output to use as the scale
      grid    The type of grid to use - numeric codes are:
                0  Linear grid
                1  Log-log grid
                2  X-log/Y-linear grid
                3  X-linear/Y-log grid
                4  Polar grid
                5  Smith grid
      plot    The plotting style to use - numeric codes are:
                0  Connected points
                1  "Comb" style
                2  Unconnected points
      dims    The dimensions of this vector - not fully supported
 
      If one of the flags is complex, the points look like r,i
      where r and i are floating point (in %e format). Otherwise
      they are in %e format. Only one of real and complex should
      appear.
 
      The lines are guaranteed to be less than 80 columns wide
      (unless the plot title or variable names are very long, or a
      large number of variable options are given), so this format
      is safe to mail between systems that enforce 80 character
      lines.
 
      The binary format is similar to the ascii format in organi-
      zation, except that it is not readable (strings are NULL
      terminated instead of newline terminated) and the values are
      in the machine's double precision floating point format
      instead of in ascii.  This makes it much easier to read and
      write and makes the file smaller.
 
      The circuit title, date, and analysis type name in that
      order are at the start of the plot, each terminated by a
      NULL byte.  Then the flags field (a short, which is 1 for
      real data and 2 for complex data), the number of outputs,
      and the number of points (both integers) are present.  Fol-
      lowing this is a list of NULL-terminated strings which are
      command lines.  This list is terminated by an extra NULL
      byte.  Then come the options, which consist of the name,
      followed by the type and the value in binary.  The output
      "declarations" consist of the name, type code, flags, color,
      grid type, plot type, and dimension information in that
      order.  Next come the values, which are either doubles or
      pairs of doubles in the case of complex data.
 
      The old format (which is used by SPICE2 with the -r option)
      is as follows:
                                  Old
 
              Field(s)          Size in Bytes
 
              title             80
              date              8
              time              8
              numoutputs        2
              the integer 4     2
              output names      8 for each output
              types of output   2 for each output
              node index        2 for each output
              plot title        24
              data              numpoints * numoutputs * 8
 
      The data is in the form of double-precision numbers, or
      pairs of single-precision numbers if the data is complex.
 
      The values recognised for the "types of output" fields are
      described in the Predefined Values table above.
 
 SEE ALSO
      nutmeg(1), spice(1), writedata(3)
 
 AUTHOR
      Wayne Christopher (faustus@cad.berkeley.edu)
 
 BUGS
      If variable names and the title and plotname strings have
      trailing blanks in them they will be stripped off when the
      file is read, if it is in ascii format.
 
      If a plot title begins with "Title:" nutmeg will be fooled
      into thinking that this is an ascii format file. Sconvert
      always requires the type to be specified, however.
 
      The binary format is not well-designed and may be changed in
      the future.
 
 

!!KEYWORD
semi
!!TITLE
Multiple Commands
!!TEXT 
      More than one command may be put on one line, seperated by
      semicolins (;).  The semicolins must be isolated by white
      space, however.  Thus a multi-command alias might be written
      alias word 'command1 ; command2 ; ...'.
 
 

!!KEYWORD
setandlet
!!TITLE
Set and Let
!!TEXT 
      Casual jspice3 users are often confused by the different
      interpretations of shell variables and vectors.  Any variable
      can be defined with the "set" command, and of course undefined
      with "unset".  If defined, the value of the variable is the
      string, if given.  For example, if 

           set a = 10*2

      is entered, the value of a (obtained as $a) is the string "10*2"
      and NOT the integer 20.

      Some internally used variables have boolean values, such as 

           set unixcom

      which if set causes certain modes or functions to be active.

      Vectors, however, always have numeric values.  If one enters

           let a = 10*2, or more simply
           a = 10*2

      The value of the vector a is 20.

      Vectors can be set to shell variables, in which case they take
      on the interpreted numerical values.  For example,

           set a=10*2
           b = $a

      would assign the string "10*2" to the shell variable a, but the
      vector b would contain the value 20.

      The inputs to most commands are vectors, however some commands,
      such as "echo" substitute for shell variables.  For example,

           set a = "foo"
           set b = "bar"
           echo $a$b

      would print "foobar".

      Shell variables are expanded by "echo", and in spice input when
      sourced.  If the value of a vector is needed in shell expansion,
      then the special prefix "$&" should be added.  This tells the
      shell interpreter that the following symbol is a vector, to be
      replaced by its value.  For example,

           let a = 2.0e-2
           echo $&a

      will print "2.00000e-2".  However

           let a = 2.0e-2
           echo $a

      would give an error message (unless a is also a shell variable),
      and

           let a = 2.0e-2
           echo a

      would print "a".


      Double quotes will cause multiple tokens to be taken as one,
      for example

           set a = "a string"

      will set a accordingly, whereas

           set a = a string

      will set shell variable a to "a" and shell variable string to
      boolean true.

      Single quotes do about the same thing, but supress shell variable
      expansion.  For example:

           set a = foo
           set b = bar
           echo $a $b

      and

           set a = foo
           set b = bar
           echo "$a $b"

      would print "foo bar", whereas

           set a = foo
           set b = bar
           echo '$a $b'

      would print "$a $b".


      In the present version, $ can not be nested.  For example,

           set a = foo
           set b = bar
           set c = '$a$b'
           echo $c

      prints "$a$b", not "foobar".  However,

           set a = foo
           set b = bar
           set c = $a$b
           echo $c

      does print "foobar" (the value of c).

      Shell variables that are lists are referenced with zero index,
      for example

           set a = ( aa bb cc )
           echo $a[1]

      prints "bb".

      Actually, what can be in the brackets is [lo-hi], where lo
      defaults to 0 and hi defaults to the length - 1.  If lo > hi,
      the list is reversed.

      If the reference is to a vector, as in

           compose a values .1 .2 .3
           echo $&a[1]

      the index is referneced to 0, so "2.0000e-1" is printed.

      Subtle point:

      The [] subscripting is interpreted a little differently by the
      shell and by the vector parser.  If a variable starts with $, as
      in $&value[], the [] is interpreted by the shell parser.  In
      this case, the stuff inside [] must be interpreted as shell
      variables, with the (optional) low-high notation.  In a vector
      expression, i.e., one using value[], the stuff inside [] will be
      interpreted as vector expressions, with the optional low,high
      notation.

      Thus,

           if (value[index] = 0)

      is perfectly ok for vectors value[], index.  Also, equivalently,

           if ($&value[$&index] = 0)
  
      is also ok, though not as efficient.  However

           if ($&value1[index] = 0)

      is an error, the shell parser does not know that index is a
      vector.

      Shell variables can be used freely in vector expressions, however
      one must keep in mind how the variables are interpreted.  During
      parsing, the shell variables are evaluated, and their values put
      back into the expression as constants.  Then the expression is
      evaluated as a vector expression.  


!!KEYWORD
unixcomcomm
!!TITLE
UNIX Commands
!!TEXT 
      If the variable unixcom is set and the operating system is
      supportive, commands which are not built-ins are considered
      shell commands and executed as if the program were a shell.
      However, using this option increases the start-up time of
      the program a lot.  Probably spice should not be used as a
      login shell.  This feature is currently supported under
      BSD UNIX and DOS.
 
!!SEEALSO
unixcom
commands

!!KEYWORD
variablesub
!!TITLE
Variable Substitution
!!TEXT 
      The values of variables may be used in commands and circuit
      descriptions by writing $varname where the value of the
      variable is to appear.  The special variables $$ and $<
      refer to the process ID of the program and a line of input
      which is read from the terminal when the variable is evaluated,
      respectively.  If a variable has a name of the form $&word,
      then word is considered a vector, and its value is taken to
      be the value of the variable.  If $foo is a valid variable, and
      is of type list, then the expression $foo[low-high] represents
      a range of elements.  Either the upper index or the lower may
      be left out, and the reverse of a list may be obtained with
      $foo[len-0].  Also, the notation $?foo evaluates to 1 if the
      variable foo is defined, 0 otherwise, and $#foo evaluates to
      the number of elements in foo if it is a list, 1 if it is a
      number or string, and 0 if it is a boolean variable.

      The variable substitution in a spice deck allows a concatenation
      character '%'.  This is used between a variable and other text,
      which would otherwise mask the variable.  For example

           set value = 10
           v1 1 0 pulse(0 $value%m 5p 10p)

      expands to

           v1 1 0 pulse(0 10m 5p 10p).

      Without the %, the pattern match would fail.

      The sequences $&?vector and $&#vector are accepted.  The first
      expands to 1 if vector is defined (with the let command or
      otherwise), 0 if not.  The second expands to the vector length
      or 0 if the vector is undefined.  This is analogous to
      $?variable and $#variable for shell variables.

      The range specification can contain shell variables.
      This is true for both vectors ($& prefix) and variables.

      The notation $&(expression) is replaced by the value of the
      vector expression.  A range specification can be added, for
      example

           echo $&(a+1)[2]

      prints the third entry in vector a + 1 (or 0 if out of range).
 
!!SEEALSO
setandlet

!!KEYWORD
vms
!!TITLE
VAX-VMS Notes
!!TEXT 
      Nutmeg can be run under VAX/VMS. Some features like command,
      etc completion, expansion of `*', `?', and [], backquote
      substitution, the shell command, and so forth do not work.
 
      Nutmeg will look for start-up commands in the file spice.rc
      in the current directory.
 
      The standard suffix for rawspice files in VMS is ".raw".
 
      You will have to respond to the -more- prompt during plot
      with a carriage return instead of any key as you can do with
      UNIX.
 

!!KEYWORD
X
!!TITLE
X
!!TEXT 
      When a graphics is requested and X is available, a window
      is opened.  If the variable maxwins is set and there are
      already that many plot windows available, the oldest one is
      re-used.  If the window being opened is the nth window, and
      the variable geometryN is defined, then this string is used
      as the window's geometry (see the X documentation for a
      description of geometry specifications).  Otherwise the user
      is prompted for the window's size and position: as usual,
      the left button will create the window with the default size
      and position, the middle button allows the user to drag the
      window open, and the right button allows the user to create
      a window of the default size at any location.  The defaults
      are such that the window will be 1/3 the height and width of
      the screen, positioned in the center.  This behavior may be
      different according to the window manager in use.
 
      After the window is created and the data are plotted, the
      buttons have various functions according to the type of window
      created.  In plot windows, the left button prints coordinate
      differences along a ruler, which is displayed while the left
      button is held down.  The right button creates a new plot
      window of the data enclosed in the rectangle visible when
      the right button is held down.
 
      If the cursor is positioned in a plot window and characters
      are typed on the keyboard, they will appear as text in the
      window in the same font as the other text.  The cursor will
      move to the right as text is added, but due to the way X
      windows are handled by nutmeg, text must be typed slowly so
      the cursor can keep up with it.  This allows one to add text
      to a window or remove it with spaces before sending it to a
      printer with a window-dump program.
 
      If a hardcopy command with no expressions is given, the user
      will be prompted to select a window which will be dumped
      into the file.
      
      The help system also uses the X window system when available.
 
!!SEEALSO
dasht
help
plot
graf
mplot
resources
sced
setrdb
xeditor

!!KEYWORD
resources
!!TITLE
X resources
!!TEXT 

      Resources used by the various widgets in the graphics display
      can be set as in other X programs (but not from the command
      line, except for the stand-alone help and xeditor programs).
      Most conveniently, one can add lines to the $HOME/.Xdefaults
      file.  Also, the "setrdb" command can be used within Jspice3
      and nutmeg to set and alter resources.  The resources are
      the default resources for the classes listed in the table
      below.  See your X documentation for the full scope of the
      resource databasei and syntax.

      Example:  the following string would paint the background
      of the quit button in a plot window blue.

      jspice3.plot.buttonbox.background: blue

      In the table, the class names are in parentheses.  The
      resource string can intersperse widget names and class
      names arbitrarily, where class names typically increase
      matching scope.  Below, the first quark ("Jspice3") is
      the program class name, which can be replaced by the
      program name (jspice3, nutmeg, help, xeditor).

      plot:  jspice3, nutmeg
      Jspice3.plot(Form).viewport(Viewport)
                        .buttonbox(Box).quit(Command)
                                       .help(Command)
                                       .hardcopy(Command)
                                       .save(Command)
                                       .slopetext(AsciiText)

      graf:  jspice3, nutmeg
      Jspice3.graf(Form).viewport(Viewport)
                        .buttonbox(Box).quit(Command)
                                       .help(Command)
                                       .hardcopy(Command)
                                       .save(Command)
                                       .points(Toggle)
                                       .x-y(Toggle)
                                       .separate(Toggle)
                                       .marker(Toggle)
                                       .onescale(Toggle)
                                       .grpscale(Toggle)

      mplot:  jspice3, nutmeg
      Jspice3.mplot(Form).viewport(Viewport)
                         .buttonbox(Box).quit(Command)
                                        .help(Command)
                                        .hardcopy(Command)
                                        .save(Command)

      sced:  jspice3
      Jspice3.sced(Form).viewport(Viewport)

      help:  jspice3, nutmeg, help
      Jspice3.help(Form).buttonbox(Box).titlelabel(Label)
                                       .quit(Command)
                                       .delete(Command)
                                       .print(Command)
                                       .save(Command)
                        .helptext(AsciiText)
                        .sublabel(Label)
                        .subbox(Box).******(Toggle)
                        .seelabel(Label)
                        .seebox(Box).******(Toggle)

      xeditor:  jspice3, xeditor
      Jspice3.xeditor(Form).buttonbox(Box).quit(Command)
                                          .save(Command)
                                          .save_as(Command)
                                          .source(Command)
                                          .load(Command)
                                          .help(Command)
                           .titlelabel(Label)
                           .main_text(AsciiText)

      popups:
      Jspice3.popup(TransientShell).form(Form).label(Label)
                                              .text(AsciiText)
                                              .action(Command)
                                              .cancel(Command)

      Jspice3.popup_m(TransientShell).form_m(Form).label_m(Label)
                                                  .cancel_m(Command)

      Jspice3.popup_e(TransientShell).form_e(Form).text_e(AsciiText)
                                                  .cancel_e(Command)

      The colors used in the plot, graph, and mplot windows can
      be set with the jspice3.colorN resource, where n = 0 - 20.
      These are overridden by the colorN set variables, if set.
      Color0 is the viewport background.  The colors used in sced
      windows are set from within the program, or the sced.rc
      startup file, and have no corresponding resources.

!!SEEALSO
color

*****************************************************************
*
* Input File Format
*
*****************************************************************

!!KEYWORD
ac_analysis
!!TITLE
AC Small-Signal Analysis
!!TEXT 
           The ac small-signal portion of SPICE  computes  the  ac
      output  variables  as  a function of frequency.  The program
      first computes the dc operating point  of  the  circuit  and
      determines  linearized,  small-signal  models for all of the
      nonlinear devices in the circuit.  The resultant linear cir-
      cuit  is  then  analyzed over a user-specified range of fre-
      quencies.  The desired output of an ac small-signal analysis
      is  usually  a  transfer  function  (voltage  gain, transim-
      pedance, etc).  If the circuit has only one ac input, it  is
      convenient  to  set  that  input to unity and zero phase, so
      that output variables have the same value  as  the  transfer
      function of the output variable with respect to the input.
 
      General form:
 
           .AC DEC ND FSTART FSTOP
           .AC OCT NO FSTART FSTOP
           .AC LIN NP FSTART FSTOP
 
      Examples:
 
           .AC DEC 10 1 10K
           .AC DEC 10 1K 100MEG
           .AC LIN 100 1 100HZ
 
 
           DEC stands for decade variation, and ND is  the  number
      of  points per decade.  OCT stands for octave variation, and
      NO is the number of  points  per  octave.   LIN  stands  for
      linear variation, and NP is the number of points.  FSTART is
      the starting frequency, and FSTOP is  the  final  frequency.
      If  this  line  is  included in the circuit file, SPICE will
      perform an ac analysis of the  circuit  over  the  specified
      frequency range.  Note that in order for this analysis to be
      meaningful, at least one independent source must  have  been
      specified with an ac value.
 
!!SEEALSO
multi_dc

!!KEYWORD
analyses
!!TITLE
Analysis Types
!!TEXT 
      The  following  analyses  are  currently  available  in
      JSPICE3.
 
!!SUBTOPICS
ac_analysis
dc_analysis
disto_analysis
loop
multi_dc
noise_analysis
op_analysis
pz_analysis
sens_analysis
tf_analysis
tran_analysis 
oprng
optimize
run

!!KEYWORD
arbsource
!!TITLE
Arbitrary Source
!!TEXT
      This is a special case of the general source specification
      included for backward compatibility.
 
      General forms:

         AXXXXXXX N+ N- V=function
         AXXXXXXX N+ N- I=function

      Examples:

         A1 2 0 V=2*v(4)
         A1 2 0 I=v(4)/1000


         N+ and N- are the positive and negative nodes,  respec-
      tively.  The source is taken as a voltage/current source if
      the keying character ahead of the = is V/I.
 
!!SEEALSO
function

!!KEYWORD
b 
!!TITLE
Josephson Junctions
!!TEXT
      General form:
      
           BXXXXX N+ N- <Nph> <MNAME> <IC=V1,P1> <VJ=V1> <PHI=P1>
           +                            <AREA=val> <CONTROL=name>
      
      Example:
      
           B1 3 0 100 JJ1 IC=.5m,1.57 AREA=2 CONTROL=L1


      The Josephson junction element call consists of a device
      name keyed by the letter "B", followed by 2 node numbers,
      other parameters are optional.  If a third node number is
      given, the voltage on that node represents the phase (in
      radians) of the junction.  No other circuit elements should
      be connected to the phase node.  The next item is the model
      name, and if omitted a default model is assumed.  Initial
      conditions can be specified as a voltage/phase vector, or
      individually.  The AREA parameter scales the junction area.
      The CONTROL parameter specifies the name of an independent
      voltage source or inductor, found elsewhere in the circuit,
      the current through which acts as control current for the
      junction.

      When Josephson junctions are present in the circuit, only
      transient analysis may be performed.  The time step is
      determined by junction phase change by default.  If the
      variable "nojjtp" is set, the truncation error timestep
      predictor is used as is the case when Josephson junctions
      are not present.

!!SEEALSO
jjmodel
jjdphimax
nojjtp

!!KEYWORD
bjt
!!TITLE
BJT Models
!!TEXT 
           The bipolar junction transistor model in  SPICE  is  an
      adaptation  of  the  integral charge control model of Gummel
      and Poon.  This modified Gummel-Poon model extends the  ori-
      ginal  model to include several effects at high bias levels.
      The model will automatically simplify to the simpler  Ebers-
      Moll  model  when  certain parameters are not specified. The
      parameter names used in the modified Gummel-Poon model  have
      been  chosen  to  be  more  easily understood by the program
      user, and to reflect better both physical and circuit design
      thinking.
 
           The dc model is defined by the parameters IS,  BF,  NF,
      ISE,  IKF,  and  NE which determine the forward current gain
      characteristics, IS, BR, NR, ISC, IKR, and NC  which  deter-
      mine  the  reverse current gain characteristics, and VAF and
      VAR which determine the output conductance for  forward  and
      reverse regions.  Three ohmic resistances RB, RC, and RE are
      included, where RB can  be  high  current  dependent.   Base
      charge  storage  is  modeled  by forward and reverse transit
      times, TF and TR, the forward transit  time  TF  being  bias
      dependent  if desired, and nonlinear depletion layer capaci-
      tances which are determined by CJE, VJE, and MJE for the B-E
      junction  ,  CJC, VJC, and MJC for the B-C junction and CJS,
      VJS, and MJS for  the  C-S  (Collector-Substrate)  junction.
      The temperature dependence of the saturation current, IS, is
      determined by the energy-gap, EG, and the saturation current
      temperature  exponent,  XTI.  Additionally base current tem-
      perature dependence  is  modeled  by  the  beta  temperature
      exponent XTB in the new model.
 
           The  BJT parameters used in  the  modified  Gummel-Poon
      model  are listed below. The parameter names used in earlier
      versions of SPICE2 are still accepted.
 
      Modified Gummel-Poon BJT Parameters.
 
      name  parameter                      units default example area
 
      IS    transport saturation current      A   1.0E-16  1.0E-15 *
      BF    ideal maximum forward beta        -     100    100
      NF    forward current emission coef     -     1.0    1
      VAF   forward Early voltage             V   infinite 200
      IKF   corner for forward beta
            high current roll-off             A   infinite 0.01    *
      ISE   B-E leakage saturation current    A     0      1.0E-13 *
      NE    B-E leakage emission coefficient  -     1.5    2
      BR    ideal maximum reverse beta        -     1      0.1
      NR    reverse current emission coef     -     1      1
      VAR   reverse Early voltage             V   infinite 200
      IKR   corner for reverse beta
            high current roll-off             A   infinite 0.01    *
      ISC   B-C leakage saturation current    A     0      1.0E-13 *
 
 
      NC    B-C leakage emission coefficient  -     2      1.5
      RB    zero bias base resistance         Ohms  0      100     *
      IRB   current where base resistance
            falls halfway to its min value    A   infinite 0.1     *
      RBM   minimum base resistance
            at high currents                  Ohms  RB     10      *
      RE    emitter resistance                Ohms  0      1       *
      RC    collector resistance              Ohms  0      10      *
      CJE   B-E zero-bias depletion cap       F     0      2PF     *
      VJE   B-E built-in potential            V     0.75   0.6
      MJE   B-E junction exponential factor   -     0.33   0.33
      TF    ideal forward transit time        sec   0      0.1Ns
      XTF   coef for bias dependence of TF    -     0
      VTF   voltage describing VBC
            dependence of TF                  V   infinite
      ITF   high-current parameter
            for effect on TF                  A     0                    *
      PTF   excess phase at                   deg   0
            freq=1.0/(TF*2PI) Hz
      CJC   B-C zero-bias depletion cap       F     0      2PF     *
      VJC   B-C built-in potential            V     0.75   0.5
      MJC   B-C junction exponential factor   -     0.33   0.5
      XCJC  fraction of B-C depletion cap     -     1
            connected to internal base node
      TR    ideal reverse transit time        sec   0      10Ns
      CJS   zero-bias collector-substrate
            capacitance                       F     0      2PF     *
      VJS   substrate junc built-in potential V     0.75
      MJS   substrate junc exponential factor -     0      0.5
      XTB   forward and reverse beta
            temperature exponent              -     0
      EG    energy gap for temperature
            effect on IS                      eV    1.11
      XTI   IS temperature exponent           -     3
      KF    flicker-noise coefficient         -     0
      AF    flicker-noise exponent            -     1
      FC    coefficient for forward-bias
            depletion capacitance formula     -     0.5
 
 
!!SEEALSO
q

!!KEYWORD
c
!!TITLE
Capacitors
!!TEXT 
      General form:
 
          CXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH> <IC=VAL>
 
      Examples:
 
          CLOAD 2 10 10P
          CMOD 3 7 CMODEL L=10u W=1u
 
 
           This  is  the  more  general  form  of  the   capacitor
      presented  in section 6.2, and allows for the calculation of
      the actual capacitance value from strictly geometric  infor-
      mation  and  the specifications of the process.  If VALUE is
      specified, it defines the capacitance.  If MNAME  is  speci-
      fied,  then  the  capacitance is calculated from the process
      information in the model MNAME  and  the  given  LENGTH  and
      WIDTH.   If  VALUE  is  not specified, then MNAME and LENGTH
      must be specified.  If WIDTH is not specified, then it  will
      be  taken from the default width given in the model.  Either
      VALUE or MNAME, LENGTH, and WIDTH may be specified, but  not
      both sets.
 
!!SEEALSO
cmodel

!!KEYWORD
cmodel
!!TITLE
Capacitor Models
!!TEXT 
           The capacitor model contains process  information  that
      may  be  used  to  compute  the  capacitance  from  strictly
      geometric information.
 
      name    parameter                      units  default  example
 
      CJ      junction bottom capacitance    F/m2   -        5e-5
      CJSW    junction sidewall capacitance  F/m    -        2e-11
      DEFW    default device width           m      1e-6     2e-6
      NARROW  narrowing due to side etching  m      0.0      1e-7
 
 
           The capacitor has a capacitance computed as
 
      CAP = CJx(LENGTH-NARROW)x(WIDTH-NARROW) +
                2xCJSWx(LENGTH+WIDTH-2*NARROW)
 

!!KEYWORD
comment
!!TITLE
Comment Lines
!!TEXT 
      An asterisk in the first column indicates that this
      line is a comment line.  Comment lines may be placed any-
      where in the circuit description.
 
          General Form:
 
              * arbitrary text
 
          Examples:
 
              * RF=1K      GAIN SHOULD BE 100
              * MAY THE FORCE BE WITH MY CIRCUIT
 

!!KEYWORD
d
!!TITLE
Diode Models
!!TEXT 
           The dc characteristics of the diode are  determined  by
      the  parameters  IS  and  N.   An  ohmic  resistance, RS, is
      included.  Charge storage effects are modeled by  a  transit
      time,  TT, and a nonlinear depletion layer capacitance which
      is determined by the parameters CJO, VJ, and  M.   The  tem-
      perature  dependence of the saturation current is defined by
      the parameters  EG,  the  energy  and  XTI,  the  saturation
      current  temperature exponent.  Reverse breakdown is modeled
      by an exponential increase in the reverse diode current  and
      is  determined  by  the parameters BV and IBV (both of which
      are positive numbers).
 
      name parameter                  units    default  example  area
 
      IS   saturation current             A    1.0E-14  1.0E-14    *
      RS   ohmic resistance               Ohm  0        10         *
      N    emission coefficient           -    1        1.0
      TT   transit-time                   sec  0        0.1Ns
      CJO  zero-bias junction cap         F    0        2PF        *
      VJ   junction potential             V    1        0.6
      M    grading coefficient            -    0.5      0.5
      EG   activation energy              eV   1.11     1.11 Si
                                                        0.69 Sbd
                                                        0.67 Ge
      XTI  saturation-current temp exp    -    3.0      3.0 jn
                                                        2.0 Sbd
      KF   flicker noise coefficient      -    0
      AF   flicker noise exponent         -    1
      FC   coefficient for forward-bias   -    0.5
           depletion capacitance formula
      BV   reverse breakdown voltage      V    infinite 40.0
      IBV  current at breakdown voltage   A    1.0E-3
 
!!SEEALSO
juncd

!!KEYWORD
dc_analysis
!!TITLE
DC Analysis
!!TEXT 
           The dc analysis portion  of  SPICE  determines  the  dc
      operating  point  of  the circuit with inductors shorted and
      capacitors opened.  A dc analysis is automatically performed
      prior  to  a  transient  analysis to determine the transient
      initial conditions, and prior to an ac small-signal analysis
      to  determine  the  linearized, small-signal models for non-
      linear devices.  The dc analysis can also be  used  to  gen-
      erate  dc  transfer curves:  a specified independent voltage
      or current source is stepped over a user-specified range and
      the  dc  output  variables  are  stored  for each sequential
      source value.
 
      General form:
 
           .DC SRCNAM VSTART VSTOP VINCR <SRC2 START2 STOP2 INCR2>
 
      Examples:
 
           .DC VIN 0.25 5.0 0.25
           .DC VDS 0 10 .5 VGS 0 5 1
           .DC VCE 0 10 .25 IB 0 10U 1U
 
 
           This line defines the  dc  transfer  curve  source  and
      sweep  limits.  SRCNAM is the name of an independent voltage
      or current source.  VSTART, VSTOP, and VINCR are the  start-
      ing, final, and incrementing values respectively.  The first
      example will cause the value of the voltage source VIN to be
      swept  from  0.25  Volts  to 5.0 Volts in increments of 0.25
      Volts.  A second source (SRC2) may optionally  be  specified
      with  associated  sweep parameters.  In this case, the first
      source will be swept over its range for each  value  of  the
      second source.  This option can be useful for obtaining sem-
      iconductor device output characteristics.   See  the  second
      example circuit in the Examples section of the guide.
 
!!SEEALSO
multi_dc

!!KEYWORD
depsource
!!TITLE
Dependent Sources
!!TEXT 
           SPICE allows circuits to contain dependent sources
      characterized by any of the four equations
 
             i = g(v)   v = e(v)   i = f(i)   v = h(i)
 
      where  g, e, f, and h are functions representing
      transconductance,voltage gain, current gain, and transresis-
      tance, respectively.
 
!!SUBTOPICS
VCVS
f
g
h
arbsource

!!KEYWORD
disto_analysis
!!TITLE
Small-Signal Distortion Analysis
!!TEXT 
           The  distortion  analysis  portion  of  SPICE  computes
      steady-state harmonic and intermodulation products for small
      input signal magnitudes. If signals of  a  single  frequency
      are  specified  as  the  input  to  the circuit, the complex
      values of the second and third harmonics are  determined  at
      every point in the circuit. If there are signals of two fre-
      quencies input to the circuit, the analysis  finds  out  the
      complex  values  of  the  circuit  variables  at the sum and
      difference of the input frequencies, and at  the  difference
      of  the  smaller  frequency  from the second harmonic of the
      larger frequency.
  
           Distortion analysis is supported for the following non-
      linear  devices: DIO, BJT, JFET, MOSFETs (levels 1, 2, 3 and
      BSIM) and MESFETS. All linear devices are automatically sup-
      ported by distortion analysis. If there are switches present
      in the circuit, the analysis will continue  to  be  accurate
      provided  the  switches  do not change state under the small
      excitations used for distortion calculations.
  
      General form:
  
           .DISTO DEC ND FSTART FSTOP <F2OVERF1>
           .DISTO OCT NO FSTART FSTOP <F2OVERF1>
           .DISTO LIN NP FSTART FSTOP <F2OVERF1>
  
      Examples:
  
           .DISTO DEC 10 1kHz 100Mhz
           .DISTO DEC 10 1kHz 100Mhz 0.9
  
  
           This card does a small-signal  distortion  analysis  of
      the  circuit.   A multi-dimensional Volterra series analysis
      is done using multi-dimensional Taylor series  to  represent
      the  nonlinearites  at  the  operating  point. Terms of upto
      third order are used in the series expansions.
  
           If the optional parameter F2OVERF1  is  not  specified,
      .DISTO  does a harmonic analysis - i.e., it analyses distor-
      tion in the circuit using only a single input frequency  F1,
      which  is swept as specified by arguments of the .DISTO com-
      mand exactly as in the .AC command. Inputs at this frequency
      may be present at more than one input source, and their mag-
      nitudes and phases are specified by  the  arguments  of  the
      DISTOF1  keyword  in  the  input  file  lines  for the input
      sources (see the description for independent sources).  (The
      arguments  of  the  DISTOF2 keyword are not relevant in this
      case.) The analysis  produces  information  about  the  a.c.
      values  of all node voltages and branch currents at the har-
      monic frequencies 2*F1 and 3*F1, vs. the input frequency  F1
      as  it is swept. (A value of 1 (as a complex distortion out-
      put)    signifies    Cos(2*PI*(2*F1)*t)    at    2*F1    and
      Cos(2*PI*(3*F1)*t)  at  3*F1, using the convention that 1 at
      the   input   fundamental   frequency   is   equivalent   to
      Cos(2*PI*F1*t).)
  
      The distortion component  desired  (2*F1  or  3*F1)  can  be
      selected using commands in nutmeg, and then printed or plot-
      ted. (Normally, one is interested primarily in the magnitude
      of  the  harmonic  components,  so the magnitude of the a.c.
      distortion value is looked at.)  It  should  be  noted  that
      these are the a.c. values of the actual harmonic components,
      and are not equal to HD2 and HD3. To obtain HD2 and HD3, one
      must divide by the corresponding a.c. values at F1, obtained
      from an .AC card. This division can  be  done  using  nutmeg
      commands.
  
           If the optional F2OVERF1  parameter  is  specified,  it
      should  be  a real number between (and not equal to) 0.0 and
      1.0; in this case, .DISTO does a spectral analysis. It  con-
      siders  the  circuit with sinusoidal inputs at two different
      frequencies F1 and F2. F1 is swept according to  the  .DISTO
      card options exactly as in the .AC card. F2 is kept fixed at
      a single frequency as F1 sweeps - the value at which  it  is
      kept  fixed  is  equal  to F2OVERF1*FSTART. Each independent
      source in the circuit may  potentially  have  two  (superim-
      posed)  sinusoidal inputs for distortion, at the frequencies
      F1 and F2. The magnitude and phase of the F1  component  are
      specified  by  the  arguments  of the DISTOF1 keyword in the
      source's input line  (see  the  description  of  independent
      sources);  the  magnitude  and phase of the F2 component are
      specified by the  arguments  of  the  DISTOF2  keyword.  The
      analysis produces plots of all node voltages/branch currents
      at the intermodulation product frequencies F1+F2, F1-F2, and
      (2*F1)-F2,  vs  the  swept  frequency  F1. The IM product of
      interest may be selected  using  the  setplot  command,  and
      displayed  with  the  print  and  plot commands. It is to be
      noted as in the harmonic analysis case, the results are  the
      actual  a.c.  voltages  and  currents at the intermodulation
      frequencies, and need to be normalised w.r.t .AC  values  to
      obtain the IM parameters.
  
           If the DISTOF1 or DISTOF2 keywords are missing from the
      description  of  an  independent source, then that source is
      assumed to have no input at the corresponding frequency. The
      default  values  of  the magnitude and phase are 1.0 and 0.0
      respectively. The phase should be specified in degrees.
  
           It should be carefully noted that the  number  F2OVERF1
      should  ideally be an irrational number, and that since this
      is not possible in practice, efforts should be made to  keep
      the denominator in its fractional representation as large as
      possible, certainly above 3, for accurate  results.   (i.e.,
      if  F2OVERF1 is represented as a fraction A/B, where A and B
      are integers with no common factors, B should be as large as
      possible. Note that A < B because F2OVERF1 is constrained to
      be <  1).  To  illustrate  why,  consider  the  cases  where
      F2OVERF1 is 49/100 and 1/2. In a spectral analysis, the out-
      puts produced are at F1+F2, F1-F2 and 2F1-F2. In the  latter
      case,  F1-F2  =  F2, so the result at the F1-F2 component is
      erroneous because there is the strong  fundamental  F2  com-
      ponent  at  the  same frequency. Also, F1+F2 = 2F1-F2 in the
      latter case, and each result is erroneous individually. This
      problem  is  not  there in the case where F2OVERF1 = 49/100,
      because F1-F2 = 51/100 F1 <> 49/100 F1 = F2. In  this  case,
      there  will  be two very closely spaced frequency components
      at F2 and F1-F2. One  of  the  advantages  of  the  Volterra
      series technique is that it computes distortions at mix fre-
      quencies expressed symbolically (i.e. nF1 +- mF2), therefore
      one is able to obtain the strengths of distortion components
      accurately even if  the  separation  between  them  is  very
      small,  as  opposed  to  transient analysis for example. The
      disadvantage is of course that if two of the mix frequencies
      coincide,  the results are not merged together and presented
      (though this could presumably be done  as  a  postprocessing
      step).  Currently,  the interested user should keep track of
      the mix frequencies himself or herself and add  the  distor-
      tions  at  coinciding  mix frequencies together should it be
      necessary.
  

!!KEYWORD
elements
!!TITLE
Circuit Elements
!!TEXT 
      The following circuit elements are available in SPICE.
 
!!SUBTOPICS
c
depsource
iv
b
k
l
r
semicond
sw
t
o

!!KEYWORD
endcard
!!TITLE
End Line
!!TEXT 
      This line must always be the last  line  in  the  input
      file.  Note that the period is an integral part of the name.
 
        Examples:
 
         .END
 
 

!!KEYWORD
exponential
!!TITLE
Exponential
!!TEXT 
      EXP(V1 V2 TD1 TAU1 TD2 TAU2)
 
      Examples:
 
          VIN 3 0 EXP(-4 -1 2NS 30NS 60NS 40NS)
 
 
      parameters                 default values  units
 
      V1   (initial value)                       Volts or Amps
      V2   (pulsed value)                        Volts or Amps
      TD1  (rise delay time)         0.0         seconds
      TAU1 (rise time constant)      TSTEP       seconds
      TD2  (fall delay time)         TD1+TSTEP   seconds
      TAU2 (fall time constant)      TSTEP       seconds
 
 
           The shape of the waveform is described by the following
      table:
 
          time    value
 
          0 to TD1        V1
          TD1 to TD2      V1+(V2-V1)*(1-exp(-(time-TD1)/TAU1))
          TD2 to TSTOP    V1+(V2-V1)*(1-exp(-(time-TD1)/TAU1))
                          +(V1-V2)*(1-exp(-(time-TD2)/TAU2))
 

!!KEYWORD
f
!!TITLE
Current-Controlled Current Sources
!!TEXT 
      This is a special case of the general source specification
      included for backward compatibility.
 
      General forms:
 
          FXXXXXXX N+ N- VNAM <value>
          FXXXXXXX N+ N- VNAM FUNCTION <function_string>
 
      Examples:
 
          F1 13 5 VSENS 5
          F1 13 5 VSENS FUNCTION 1-x*x
 
 
           N+ and N- are the positive and negative nodes,  respec-
      tively.  Current flow is from the positive node, through the
      source, to the negative node.  VNAM is the name of a voltage
      source  through  which  the  controlling current flows.  The
      direction of positive controlling current flow is  from  the
      positive  node,  through the source, to the negative node of
      VNAM.  <value> is the linear current gain.  A nonlinear  re-
      lationship can be  specified  with the  "function"  keyword.
      The variable "x" is taken to be the controlling current.
 
!!SEEALSO
function

!!KEYWORD
fm
!!TITLE
Single-Frequency FM
!!TEXT 
           SFFM(VO VA FC MDI FS)
 
      Examples:
 
          V1 12 0 SFFM(0 1M 20K 5 1K)
 
 
      parameters               default values   units
 
      VO  (offset)                              Volts or Amps
      VA  (amplitude)                           Volts or Amps
      FC  (carrier frequency)  1/TSTOP          Hz
      MDI (modulation index)
      FS  (signal frequency)   1/TSTOP          Hz
 
 
           The shape of the waveform is described by the following
      equation:
 
          value = VO + VA*sine((twopi*FC*time) +
                       MDI*sine(twopi*FS*time))
 

!!KEYWORD
function 
!!TITLE
Function
!!TEXT
      In the source specification, functional dependence is included
      in an expression with syntax described below.    

      The recognized tokens are:

         +/*      (binary operators add, divide, multiply)
         -        (unary negate or binary subtract)
         ()
         ^        (binary power)
         ,        (argument separator)
         x        (independent variable)
         number   (real constant)
         string   (a library function or built-in functional name)
         variable (a circuit variable)

      The math functions, which return the function of a single
      argument, are:
         
         ln()     (natural logarithm)
         log()    (base ten logarithm)
         exp()    (base e exponent)
         cos()    (cosine)
         sin()    (sine)
         tan()    (tangent)
         acos()   (inverse cosine)
         asin()   (inverse sine)
         atan()   (inverse tangent)
         cosh()   (hyperbolic cosine)
         sinh()   (hyperbolic sine)
         tanh()   (hyperbolic tangent)
         acosh()  (inverse hyperbolic cosine)
         asinh()  (inverse hyperbolic sine)
         atanh()  (inverse hyperbolic tangent)
         sqrt()   (square root)

      The built-in functionals, which require multiple space
      separated arguments in a particular order, are:

         pulse()  (pulse specification)
         spulse() (sinusoidal pulse specification)
         exp()    (exponential specification)
         sffm()   (single frequency fm specification)
         pwl()    (piecewise-linear specification)
         sin()    (sinusoidal specification)

      These functionals implicitly use time as an independent
      variable, thus the time zero value is returned in DC
      analysis.  In cases of a name clash between functionals
      and functions (sin, exp), the argument list is examined
      to determine which is correct.

      Examples:

        sqrt(v(1)*v(1) + v(3)*v(3))
        exp(pulse(0 1 1n 10n 10n) + pulse(0 1 31n 10n 10n))
        ln(exp(v(3)^1.5)/3)
        2*x - x*x*x

      The variable "x" is set internally to an appropriate value
      depending upon the context of the function.  In the general
      source specification, x is set to time in transient analysis.

!!SUBTOPICS
exponential
fm
pulse
pwl
sinusoid
spulse

!!KEYWORD
g
!!TITLE
Voltage Controlled Current Sources
!!TEXT
      This is a special case of the general source specification
      included for backward compatibility.
 
      General forms:

         GXXXXXXX N+ N- NC+ NC- <value>
         GXXXXXXX N+ N- NC+ NC- FUNCTION <function_string>

      Examples:

         G1 2 0 5 0 0.1MMHO
         G1 2 0 5 0 FUNCTION log10(x)


         N+ and N- are the positive and negative nodes,  respec-
      tively.  Current flow is from the positive node, through the
      source, to the negative node.  NC+ and NC- are the  positive
      and negative controlling nodes, respectively. <value> is the
      transconductance (in mhos).  A nonlinear relationship can be
      specified with the "function" keyword.  The  variable "x" is
      taken as the controlling voltage.
 
!!SEEALSO
function

!!KEYWORD
h
!!TITLE
Current-Controlled Voltage Sources
!!TEXT
      This is a special case of the general source specification
      included for backward compatibility.
 
      General forms:

         HXXXXXXX N+ N- VNAM <value>
         HXXXXXXX N+ N- VNAM FUNCTION <function_string>

      Examples:

         H1 5 17 VZ 0.5K
         HA 5 17 VZ FUNCTION 2.5*exp(x/2.5)


          N+ and N- are the positive and negative nodes,  respec-
      tively.   VNAM is the name of a voltage source through which
      the controlling current flows.  The  direction  of  positive
      controlling  current flow is from the positive node, through
      the source, to the negative node  of  VNAM.  <value> is  the
      transresistance (in ohms).  A nonlinear  relationship can be
      specified with the "function" keyword.  The variable  "x" is
      taken as the controlling source current.
 
!!SEEALSO
function

!!KEYWORD
ic
!!TITLE
IC Line
!!TEXT 
      General form:
 
           .IC V(NODNUM)=VAL V(NODNUM)=VAL ...
 
      Examples:
 
           .IC V(11)=5 V(4)=-5 V(2)=2.2
 
 
           This line is for setting transient initial  conditions.
      It  has  two different interpretations, depending on whether
      the UIC parameter is specified on the .TRAN line.  Also, one
      should  not  confuse  this line with the .NODESET line.  The
      .NODESET line is only to help dc convergence, and  does  not
      affect  final  bias  solution  (except for multi-stable cir-
      cuits).  The two interpretations of this line  are  as  fol-
      lows:
 
      1.   When the UIC parameter is specified on the .TRAN  line,
           then  the  node  voltages specified on the .IC line are
           used to compute the capacitor, diode,  BJT,  JFET,  and
           MOSFET  initial  conditions.   This  is  equivalent  to
           specifying the IC=... parameter on  each  device  line,
           but  is much more convenient.  The IC=... parameter can
           still be specified and will take  precedence  over  the
           .IC values.  Since no dc bias (initial transient) solu-
           tion is computed before  the  transient  analysis,  one
           should  take  care to specify all dc source voltages on
           the .IC line if they are to be used to  compute  device
           initial conditions.
 
      2.   When the UIC parameter is not specified  on  the  .TRAN
           line,  the dc bias (initial transient) solution will be
           computed before the transient analysis.  In this  case,
           the node voltages specified on the bias solution.  Dur-
           ing transient analysis, the constraint  on  these  node
           voltages is removed.
 

!!KEYWORD
include
!!TITLE
INCLUDE Line
!!TEXT 
      General form:
 
           .INCLUDE FILENAME
 
      Examples:
 
           .INCLUDE MODELS.DEF
 
 
           This line causes the named file to be interpolated into
      the  circuit at the point it appears.  Included files may be
      nested arbitrarily.  Comments are inserted into the  circuit
      at the beginning and end of the included segments.
 

!!KEYWORD
input
!!TITLE
Circuit Input Format
!!TEXT 
      The input format for SPICE is of the free format  type.
      Fields  on  a  line  are  separated by one or more blanks, a
      comma, an equal (=) sign, or a left  or  right  parenthesis;
      extra spaces are ignored.  A line may be continued by enter-
      ing a + (plus) in column 1 of the following line; SPICE con-
      tinues reading beginning with column 2.
 
           A name field must begin with a letter (A through Z) and
      cannot contain any delimiters.  SPICE is not case-sensitive.
 
           A number field may be an integer  field  (12,  -44),  a
      floating  point field (3.14159), either an integer or float-
      ing point number followed by  an  integer  exponent  (1E-14,
      2.65E3),  or  either  an  integer or a floating point number
      followed by one of the following scale factors:
 
      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.   Thus  1000,
      1000.0,  1000HZ,  1E3, 1.0E3, 1KHZ, and 1K all represent the
      same number.
 
           The circuit to be analyzed is described to SPICE  by  a
      set  of element lines, which define the circuit topology and
      element values, and a set of control lines, which define the
      model  parameters  and  the run controls.  The first line in
      the input file must be a title line, and the last line  must
      be  a  .END line.  The order of the remaining lines is arbi-
      trary (except,  of  course,  that  continuation  lines  must
      immediately  follow  the  line  being continued, and element
      lines belonging to a subcircuit must be between the  .SUBCKT
      and .ENDS lines for that subcircuit).
 
           Each element in the circuit is specified by an  element
      line  that  contains  the element name, the circuit nodes to
      which the element is connected, and the values of the param-
      eters  that  determine the electrical characteristics of the
      element.  The first letter of the element name specifies the
      element  type.   The  format  for the SPICE element types is
      given in what follows.  The strings  XXXXXXX,  YYYYYYY,  and
      ZZZZZZZ denote arbitrary alphanumeric strings.  For example,
      a resistor name must begin with the letter `R' and can  con-
      tain  one  or more characters.  Hence, R, R1, RSE, ROUT, and
      R3AC2ZY are valid resistor names.
 
           Data fields that are enclosed in less than and  greater
      than  signs  '<  >' are optional.  All indicated punctuation
      (parentheses, equal signs,  etc.)  is  optional  and  merely
      indicate  the presence of any delimiter.  A consistent style
      such as that shown here will make the input easier to under-
      stand.   With respect to branch voltages and currents, SPICE
      uniformly uses the associated reference convention  (current
      flows in the direction of voltage drop).
 
           Nodes names may be arbitrary  character  strings.   The
      datum  (ground)  node must be named '0'.  The circuit cannot
      contain a loop of voltage sources and/or inductors and  can-
      not  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).

           Text  can contain  references to shell variables, i.e.,
      variable  names that  begin with  "$".  These  variables are
      evaluated  as  the  circuit  is  read in, or  with the reset
      command once the circuit is loaded.  The  variables  must be
      known to the  shell before  the circuit  is read in, and can
      not be  defined in  the same  input file(s)  as the circuit,
      for example  in  .control  blocks,  as  these  commands  are
      evaluated after the circuit is loaded.

 
!!SUBTOPICS
comment
endcard
ic
include
nodeset
option
subckts
titlecard
source

!!KEYWORD
iv
!!TITLE
General I and V Sources
!!TEXT 
      General form:
 
          VXXXXXXX N+ N- <DC DCVALUE> <AC <ACMAG 
            <ACPHASE>>> <DISTOF1 <F1MAG <F1PHASE>>> 
            <DISTOF2 <F2MAG <F2PHASE>>> <function>
          IYYYYYYY N+ N- <DC DCVALUE> <AC <ACMAG 
            <ACPHASE>>> <DISTOF1 <F1MAG <F1PHASE>>> 
            <DISTOF2 <F2MAG <F2PHASE>>> <function>
  
      Examples:
 
          VCC 10 0 DC 6
          VIN 13 2 0.001 AC 1 SIN(0 1 1MEG)
          ISRC 23 21 AC 0.333 45.0 SFFM(0 1 10K 5 1K)
          VMEAS 12 9
          VCARRIER 1 0 DISTOF1 0.1 -90.0
          VMODULATOR 2 0 DISTOF2 0.01
          IIN1 1 5 AC 1 DISTOF1 DISTOF2 0.001
          VIN 1 0 2*V(2)+V(3)
          IXX 2 4 PULSE(0 1 1N 10N 10N) + PULSE(0 1 40N 10N 10N)
  
 
           N+ and N- are the positive and negative nodes,  respec-
      tively.   Note  that  voltage  sources need not be grounded.
      Positive current is assumed to flow from the positive  node,
      through  the source, to the negative node.  A current source
      of positive value, will force current to flow out of the  N+
      node,  through  the  source,  and into the N- node.  Voltage
      sources, in addition to being used for  circuit  excitation,
      are  the  'ammeters' for SPICE, that is, zero valued voltage
      sources may be inserted into the circuit for the purpose  of
      measuring  current.  They will, of course, have no effect on
      circuit operation since they represent short-circuits.

           In transient  and DC analysis, sources  can  in general
      have  complex  definitions  which  involve   the   dependent
      variable  (e.g., time  in transient analysis) and other cir-
      cuit variables.  There are built-in functionals (pulse, pwl,
      exp, sin, sffm, spulse)  which can be included in the  func-
      tion expression.  The  AC analysis  always assumes  constant
      values for magnitude and phase.

           The  constant  values  associated  with  the source are
      specified by the following option keywords:

           DC is the dc analysis value of the source, if different
      from the transient analysis value at time 0.   If the source
      value is zero for both dc and transient analyses, this value
      (and the function specification) may be omitted.
 
           ACMAG is the ac magnitude and ACPHASE is the ac  phase.
      The  source  is  set  to  this value in the ac analysis.  If
      ACMAG is omitted following the keyword AC, a value of  unity
      is  assumed.   If  ACPHASE  is  omitted,  a value of zero is
      assumed.  If the source is not an ac small-signal input, the
      keyword AC and the ac values are omitted.
  
           DISTOF1 and DISTOF2 are the keywords that specify  that
      the independent source has distortion inputs at the frequen-
      cies F1 and F2 respectively  (see  the  description  of  the
      .DISTO  card).  The  keywords may be followed by an optional
      magnitude and phase. The default values of the magnitude and
      phase are 1.0 and 0.0 respectively.
  
!!SEEALSO
function

!!KEYWORD
j
!!TITLE
Junction Field-Effect Transistors
!!TEXT 
      General form:
 
          JXXXXXXX ND NG NS MNAME <AREA> <OFF> <IC=VDS,VGS>
 
      Examples:
 
          J1 7 2 3 JM1 OFF
 
 
           ND, NG, and NS are the drain, gate, and  source  nodes,
      respectively.   MNAME  is  the  model name, AREA is the area
      factor, and OFF indicates an (optional) initial condition on
      the  device for dc analysis.  If the area factor is omitted,
      a value of 1.0 is assumed.  The (optional) initial condition
      specificaion  using  IC=VDS,VGS is intended for use with the
      UIC option on the .TRAN line, when a transient  analysis  is
      desired  starting  from  other  than the quiescent operating
      point.  See the description of the .IC line for a better way
      to set initial conditions.
 
!!SEEALSO
jfet

!!KEYWORD
jfet
!!TITLE
JFET Models
!!TEXT 
           The JFET model is derived from the FET model of  Shich-
      man  and  Hodges.  The DC characteristics are defined by the
      parameters VTO and BETA, which determine  the  variation  of
      drain  current  with  gate voltage, LAMBDA, which determines
      the output conductance, and IS, the  saturation  current  of
      the  two  gate junctions.  Two ohmic resistances, RD and RS,
      are included.  Charge storage is modeled by nonlinear deple-
      tion  layer  capacitances for both gate junctions which vary
      as the -1/2 power of junction voltage and are defined by the
      parameters CGS, CGD, and PB.
 
      name    parameter                 units  default  example area
 
      VTO     threshold voltage            V      -2.0  -2.0
      BETA    transconductance param     A/V**2 1.0E-4  1.0E-3    *
      LAMBDA  channel length modulation
              parameter                    1/V    0     1.0E-4
      RD      drain ohmic resistance       Ohm    0     100       *
      RS      source ohmic resistance      Ohm    0     100       *
      CGS     zero-bias G-S junction cap   F      0     5PF       *
      CGD     zero-bias G-D junction cap   F      0     1PF       *
      PB      gate junction potential      V      1     0.6
      IS      gate junction sat current    A    1.0E-14 1.0E-14   *
      KF      flicker noise coefficient    -      0
      AF      flicker noise exponent       -      1
      FC      coefficient for forward-bias -      0.5
              depletion capacitance formula
 
!!SEEALSO
j

!!KEYWORD
jjmodel 
!!TITLE
Josephson Models
!!TEXT
      General form:

          .MODEL NAME JJ(RTYPE=N1,CCT=N2,ICRIT=IC,CAP=C,VG=V1,
          + DELV=V2,ICON=I1,R0=R1,RN=R2)

      Example:

          .MODEL JJ1 JJ(RTYPE=2,CCT=1,ICRIT=.5M,CAP=2P,VG=2.8M,
          + DELV=.1M,ICON=10M,R0=30,RN=1)

      The parameters have the following meaning and defaults:

      RTYPE    The quasiparticle resistance model employed, one of
          1 - Piecewise linear model.
          2 - Analytic exponentially derived approximation.
          3 - Fifth order polynomial approximation.
          4 - Allow modulation of gap parameter.

           Otherwise the quasiparticle resistance is set to
           infinity.  The default is 1.

      CCT      The supercurrent model employed, one of
          1 - Fixed supercurrent amplitude (equals ICRIT).
          2 - Sin(x)/x modulation, first zero at control
              current = ICON.
          3 - Symmetric linear modulation, zero at control
              current = +/- ICON.
          4 - Asymmetric linear modulation, zero at control
              current = ICON, ICRIT at control current = 
              -ICON.

           Otherwise, the critical current is set to zero.
           the default is 1.

      ICRIT    The maximum critical current per unit area, default
               1 mA.

      CAP      The geometric shunting capacitance per unit area,
               default 1 pF.

      VG       The voltage at the midpoint of the quasiparticle step,
               default 3 mV.

      DELV     The voltage width of the quasiparticle step,
               default .1 mV.

      ICON     The control current scaling parameter, default 10 mA.

      R0       The subgap resistance, default .03/ICRIT.

      RN       The normal state resistance, default .0017/ICRIT.
 
!!SUBTOPICS
jjrtype4
!!SEEALSO
b
 
!!KEYWORD
jjrtype4 
!!TITLE
RTYPE=4
!!TEXT
          Rtype=4  uses  a piecewise-linear  quasiparticle char-
      acteristic  identical to  rtype=1, however the gap voltage
      and critical current are now proportional to the  absolute
      value of the  control current set with a  CONTROL=SRC_NAME
      entry in the  device line.  For control current of 1 (Amp)
      or  greater, the  full gap and  critical current are used,
      otherwise  they  decrease linearly  to zero.  If no device
      control  source  is  specified, the  algorithm  reverts to
      rtype=1.

      The  controlling  current  must be translated from temper-
      ature  with  an external nonlinear source.  The functional
      dependence  is  in general  a complicated  function, but a
      reasonable approximation is 1 - (T/Tc)^4.

      It  is currently not possible to use other than the piece-
      wise linear model with temperature variation.  If rtype=4,
      then  legal  values  are  cct=0  (no critical current) and
      cct=1 (fixed critical current).  If another value is spec-
      ified for cct, cct reverts to 0.  Thus,  magnetic coupling
      and  quasiparticle injection are not simultaneously avail-
      able.


!!KEYWORD
juncd
!!TITLE
Junction Diodes
!!TEXT 
      General form:
 
          DXXXXXXX N+ N- MNAME <AREA> <OFF> <IC=VD>
 
      Examples:
 
          DBRIDGE 2 10 DIODE1
          DCLMP 3 7 DMOD 3.0 IC=0.2
 
 
           N+ and N- are the positive and negative nodes,  respec-
      tively.   MNAME  is the model name, AREA is the area factor,
      and OFF indicates an (optional) starting  condition  on  the
      device  for  dc  analysis.  If the area factor is omitted, a
      value of 1.0 is assumed.  The (optional)  initial  condition
      specification  using  IC=VD is intended for use with the UIC
      option on the other than the quiescent operating point.
 
!!SEEALSO
d

!!KEYWORD
k
!!TITLE
Coupled (Mutual) Inductors
!!TEXT 
      General form:
 
          KXXXXXXX LYYYYYYY LZZZZZZZ VALUE
 
      Examples:
 
          K43 LAA LBB 0.999
          KXFRMR L1 L2 0.87
 
 
           LYYYYYYY and LZZZZZZZ are the names of the two  coupled
      inductors,  and  VALUE  is  the  coefficient of coupling, K,
      which must be greater than 0 and less than or  equal  to  1.
      Using  the 'dot' convention, place a 'dot' on the first node
      of each inductor.
 
 
!!SEEALSO
cl

!!KEYWORD
l
!!TITLE
Inductors
!!TEXT 
      General form:
 
          LYYYYYYY N+ N- VALUE <IC=INCOND>
 
      Examples:
 
          LLINK 42 69 1UH
          LSHUNT 23 51 10U IC=15.7MA
 
 
           N+ and N- are the positive and negative element  nodes,
      respectively.   VALUE  is  the  inductance in Henries.
 
      The (optional) initial  condition is the initial (time-zero)
      value of  inductor current (in Amps)  that  flows  from  N+,
      through the inductor, to N-.  Note  that  the  initial cond-
      itions (if any) apply only if the UIC option is specified on
      the .TRAN line.
 

!!KEYWORD
lossy
!!TITLE
Lossy Transmission Lines
!!TEXT
      See ltra.
 
!!SEEALSO
ltra

!!KEYWORD
ltra
!!TITLE
LTRA (Lossy transmission line) Model
!!TEXT     
           The  uniform  RLC/RC/LC/RG  transmission   line   model
      (referred  to as the LTRA model henceforth) models a uniform
      constant-parameter distributed transmission line. The RC and
      LC  cases may also be modelled using the URC and TRA models;
      however, the LTRA model is usually faster and more  accurate
      than  the  others.  The operation of the LTRA model is based
      on  the  convolution  of  the  transmission  line's  impulse
      responses with its inputs.
 
           The LTRA model takes a number of  parameters,  some  of
      which must be given and some of which are optional.
     
     
      name         parameter                units  default  example
     
      R            resistance per unit len    ohms/u   0.0  0.2
      L            inductance per unit len    henrys/u 0.0  9.13e-9
      G            conductance per unit len   mhos/u   0.0  0.0
      C            capacitance per unit len   farads/u 0.0  3.65e-12
      LEN          length of line             length u none 1.0
      REL          parameter controlling      none     1    0.5
                   breakpoint setting
      ABS          parameter controlling      none     1    5
                   breakpoint setting
      NOSTEPLIMIT  don't limit timestep to    flag     0    1
                   less than line delay
      NOCONTROL    don't do complex           flag     0    1
                   timestep control
      LININTERP    use linear interpolation   flag     0    1
      MIXEDINTERP  use linear when quad.      flag     0    1
      COMPACTREL   special reltol for         none   RELTOL 1.0e-3
                   history compaction
      COMPACTABS   special abstol for         none   ABSTOL 1.0e-9
                   history compaction
      TRUNCNR      use Newton-Raphson         flag     0    1
                   method for timestep control
      TRUNCDONTCUT don't limit timestep to    flag     0    1
                   keep impulse-response errors
                   low
     
           The following types of lines have been  implemented  so
      far:  RLC (uniform transmission line with series loss only),
      RC (uniform RC line), LC (lossless transmission line) ,  and
      RG  (distributed  series resistance and parallel conductance
      only). Any other combination will  yield  erroneous  results
      and  should not be tried. The length LEN of the line must be
      specified.
     
           NOSTEPLIMIT is a flag that will remove the default res-
      triction  of limiting time-steps to less than the line delay
      in the RLC case. NOCONTROL  is  a  flag  that  prevents  the
      default limiting of the time-step based on convolution error
      criteria in the RLC and RC cases. This speeds up  simulation
      but  may  in  some  cases  reduce  the  accuracy of results.
      LININTERP is a flag that, when specified,  will  use  linear
      interpolation instead of the default quadratic interpolation
      for calculating delayed  signals.   MIXEDINTERP  is  a  flag
      that, when specified, uses a metric for judging whether qua-
      dratic interpolation is not applicable and if so uses linear
      interpolation;  otherwise  it  uses  the  default  quadratic
      interpolation. TRUNCDONTCUT  is  a  flag  that  removes  the
      default  cutting  of  the  time-step  to limit errors in the
      actual calculation of impulse-response  related  quantities.
      COMPACTREL  and  COMPACTABS  are quantities that control the
      compaction of the past history of values stored for convolu-
      tion.  Larger  values  of  these  lower accuracy but usually
      increase simulation speed. These are to  be  used  with  the
      TRYTOCOMPACT  option,  described  in  the  .OPTIONS section.
      TRUNCNR is a flag that turns on the  use  of  Newton-Raphson
      iterations  to  determine  an  appropriate  timestep  in the
      timestep control routines. The default is a trial and  error
      procedure  by cutting the previous timestep in half. REL and
      ABS are quantities that control the setting of breakpoints.
     
           The option most worth experimenting with for increasing
      the  speed  of  simulation is REL. The default value of 1 is
      usually safe from the point of view of  accuracy  but  occa-
      sionally increases computation time. A value of greater than
      2 eliminates all breakpoints and may be worth trying depend-
      ing  on  the  nature  of the rest of the circuit, keeping in
      mind that it might not be safe from the viewpoint  of  accu-
      racy.  Breakpoints  may usually be entirely eliminated if it
      is expected the circuit will not display sharp  discontinui-
      ties.   Values  between 0 and 1 are usually not required but
      may be used for setting many breakpoints.
     
           COMPACTREL may  also  be  experimented  with  when  the
      option  TRYTOCOMPACT  is  specified  in a .OPTIONS card. The
      legal range is  between  0  and  1.  Larger  values  usually
      decrease  the  accuracy  of the simulation but in some cases
      improve  speed.  If  TRYTOCOMPACT  is  not  specified  on  a
      .OPTIONS card, history compaction is not attempted and accu-
      racy is high.  NOCONTROL, TRUNCDONTCUT and NOSTEPLIMIT  also
      tend to increase speed at the expense of accuracy.
 
         See "Efficient Transient Simulation of Lossy Interconnect",
      J.S. Roychowdhury and D.O. Pederson, Proc. DAC 91 for details.
 
!!SEEALSO
o
multiconductor
trytocompact

!!KEYWORD
m
!!TITLE
MOSFET's
!!TEXT 
      General form:
 
          MXXXXXXX ND NG NS NB MNAME <L=VAL> <W=VAL> <AD=VAL> <AS=VAL>
          + <PD=VAL> <PS=VAL> <NRD=VAL> <NRS=VAL> <OFF> <IC=VDS,VGS,VBS>
 
      Examples:
 
          M1 24 2 0 20 TYPE1
          M31 2 17 6 10 MODM L=5U W=2U
          M1 2 9 3 0 MOD1 L=10U W=5U AD=100P AS=100P PD=40U PS=40U
 
 
           ND, NG, NS, and NB are the  drain,  gate,  source,  and
      bulk  (substrate)  nodes,  respectively.  MNAME is the model
      name.  L and W are the channel length and width, in  meters.
      AD  and AS are the areas of the drain and source diffusions,
      in sq-meters.  Note that the suffix  `U'  specifies  microns
      (1E-6  m) and P sq-microns (1E-12 sq-m). If any of L, W, AD,
      or AS are not specified, default values are used.   The  use
      of  defaults  simplifies  input file preparation, as well as
      the editing required if device geometries are to be changed.
      PD  and  PS are the perimeters of the drain and source junc-
      tions, in meters.  NRD  and  NRS  designate  the  equivalent
      number  of squares of the drain and source diffusions; these
      values multiply the sheet resistance RSH  specified  on  the
      .MODEL  line for an accurate representation of the parasitic
      series drain and source resistance of each  transistor.   PD
      and  PS  default to 0.0 while NRD and NRS to 1.0.  OFF indi-
      cates an (optional) initial condition on the device  for  dc
      analysis.   The  (optional)  initial condition specification
      using IC=VDS,VGS,VBS is intended for use with the UIC option
      on  the  .TRAN  line,  when  a transient analysis is desired
      starting from other than the quiescent operating point.  See
      the  description  of the .IC line for a better and more con-
      venient way to specify transient initial conditions.
 
!!SEEALSO
mosfet

!!KEYWORD
mesfet
!!TITLE
MESFET Models
!!TEXT 
           The MESFET model is derived from the GaAs FET model  of
      Statz  et  al.  as described in [4].  The dc characteristics
      are defined by the parameters VTO, B, and BETA, which deter-
      mine  the  variation  of  drain  current  with gate voltage,
      ALPHA, which  determines  saturation  voltage,  and  LAMBDA,
      which  determines  the  output  conductance.
 
      Two ohmic resistances, RD  and  RS,  are  included.   Charge
      storage  is  modeled  by  total gate charge as a function of
      gate-drain and gate-source voltages and is  defined  by  the
      parameters CGS, CGD, and PB.
 
      name    parameter                  units  default  example area
 
      VTO     pinch-off voltage            V     -2.0    -2.0
      BETA    transconductance parameter  A/V**2 1.0E-4  1.0E-3  *
      B       doping tail extending param  1/V   0.3     0.3     *
      ALPHA   saturation voltage param     1/V   2       2       *
      LAMBDA  channel length modulation
              parameter                    1/V   0       1.0E-4
      RD      drain ohmic resistance       Ohm   0       100     *
      RS      source ohmic resistance      Ohm   0       100     *
      CGS     zero-bias G-S junction cap   F     0       5PF     *
      CGD     zero-bias G-D junction cap   F     0       1PF     *
      PB      gate junction potential      V     1       0.6
      KF      flicker noise coefficient    -     0
      AF      flicker noise exponent       -     1
      FC      coef for forward-bias        -     0.5
              depletion capacitance formula
 
 
!!SEEALSO
z

!!KEYWORD
models
!!TITLE
Device Models
!!TEXT 
      General form:
 
           .MODEL MNAME TYPE(PNAME1=PVAL1 PNAME2=PVAL2 ... )
 
      Examples:
 
           .MODEL MOD1 NPN (BF=50 IS=1E-13 VBF=50)
           .MODEL INTERCONNECT LTRA (R=0.2 L=9.13nH C=3.65pF
                      LEN=5 NOCONTROL REL=2 COMPACTREL=1.0e-4)
 
 
           The .MODEL line specifies a  set  of  model  parameters
      that  will  be  used  by  one or more devices.  MNAME is the
      model name, and type is one of the following ten types:
 
            R      resistor model
            C      capacitor model
            URC    Uniform Distributed RC model
            D      diode model
            NPN    NPN BJT model
            PNP    PNP BJT model
            NJF    N-channel JFET model
            PJF    P-channel JFET model
            NMOS   N-channel MOSFET model
            PMOS   P-channel MOSFET model
            NMF    N-channel MESFET model
            PMF    P-channel MESFET model
            SW     voltage controlled switch
            CSW    current controlled switch
            LTRA   Uniform RLC/RC/LC/RG transmission line model
 
 
           Parameter values are defined by appending the parameter
      name,  as  given  below  for each model type, followed by an
      equal sign and the parameter value.  Model  parameters  that
      are  not given a value are assigned the default values given
      below for each model type.
 
!!SUBTOPICS
bjt
c
d
jfet
jjmodel
mesfet
mosfet
rmodel
swmodel
urc
ltra

!!KEYWORD
mosfet
!!TITLE
MOSFET Models
!!TEXT 
           SPICE provides four MOSFET device models, which  differ
      in  the formulation of the I-V characteristic.  The variable
      LEVEL specifies the model to be used:
 
         LEVEL = 1 ->    Shichman-Hodges
         LEVEL = 2 ->    MOS2 (as described in [1])
         LEVEL = 3 ->    MOS3, a semi-empirical model (see [1])
         LEVEL = 4 ->    BSIM (as described in [2])
 
 
           The dc characteristics of the level 1 through  level  3
      MOSFETs  are  defined  by  the  device  parameters  VTO, KP,
      LAMBDA, PHI and GAMMA.  These  parameters  are  computed  by
      SPICE  if process parameters (NSUB, TOX, ...) are given, but
      user-specified values  always  override.   VTO  is  positive
      (negative)  for enhancement mode and negative (positive) for
      depletion mode N-channel (P-channel) devices. Charge storage
      is  modeled  by  three  constant capacitors, CGSO, CGDO, and
      CGBO which represent overlap capacitances, by the  nonlinear
      thin-oxide  capacitance which is distributed among the gate,
      source, drain,  and  bulk  regions,  and  by  the  nonlinear
      depletion-layer  capacitances  for  both substrate junctions
      divided into bottom and periphery, which vary as the MJ  and
      MJSW  power of junction voltage respectively, and are deter-
      mined by the parameters CBD, CBS, CJ, CJSW, MJ, MJSW and PB.
      Charge  storage  effects are modeled by the piecewise linear
      voltags-dependent capacitance model proposed by Meyer.   The
      thin-oxide  charge storage effects are treated slightly dif-
      ferent for the LEVEL =  1  model.   These  voltage-dependent
      capacitances  are  included  only if TOX is specified in the
      input description and they  are  represented  using  Meyer's
      formulation.
 
           There is some overlap among the  parameters  describing
      the  junctions, e.g. the reverse current can be input either
      as IS (in A) or as JS (in A/m**2). Whereas the first  is  an
      absolute value the second is multiplied by AD and AS to give
      the reverse  current  of  the  drain  and  source  junctions
      respectively.  This  methodology has been chosen since there
      is no sense in relating always junction characteristics with
      AD  and  AS  entered  on  the  device line; the areas can be
      defaulted.  The same idea  applies  also  to  the  zero-bias
      junction capacitances CBD and CBS (in F) on one hand, and CJ
      (in F/m**2) on the other.  The parasitic  drain  and  source
      series  resistance  can be expressed as either RD and RS (in
      ohms) or RSH (in ohms/sq.), the latter being  multiplied  by
      the number of squares NRD and NRS input on the device line.
 
      SPICE level 1 to level 3 parameters.
 
      name    parameter                     units  default  example
 
      LEVEL   model index                       -    1
      VTO     zero-bias threshold voltage       V    0.0    1.0
      KP      transconductance parameter      A/V**2 2.0E-5 3.1E-5
      GAMMA   bulk threshold parameter        V**0.5 0.0    0.37
      PHI     surface potential                 V    0.6    0.65
      LAMBDA  channel-length modulation
              (MOS1 and MOS2 only)              1/V  0.0    0.02
      RD      drain ohmic resistance            Ohm  0.0    1.0
      RS      source ohmic resistance           Ohm  0.0    1.0
      CBD     zero-bias B-D junction cap        F    0.0    20FF
      CBS     zero-bias B-S junction cap        F    0.0    20FF
      IS      bulk junction sat current         A  1.0E-14  1.0E-15
      PB      bulk junction potential           V    0.8    0.87
      CGSO    gate-source overlap cap
              per meter channel width           F/m  0.0    4.0E-11
      CGDO    gate-drain overlap cap
              per meter channel width           F/m  0.0    4.0E-11
      CGBO    gate-bulk overlap cap
              per meter channel length          F/m  0.0    2.0E-10
      RSH     drain and source diffusion
              sheet resistance               Ohm/sq  0.0    10.0
      CJ      zero-bias bulk junc bottom cap 
              per sq-meter of junction area  F/m**2  0.0    2.0E-4
      MJ      bulk junc bottom grading coef     -    0.5    0.5
      CJSW    zero-bias bulk junc sidewall cap 
              per meter of junction perimeter   F/m  0.0    1.0E-9
      MJSW    bulk junc sidewall grading coef   -    0.50(1)
                                                     0.33(2,3)
      JS      bulk junction sat current
              per sq-meter of junc area      A/m**2         1.0E-8
      TOX     oxide thickness                   m    1.0E-7 1.0E-7
      NSUB    substrate doping              1/cm**3  0.0    4.0E15
      NSS     surface state density         1/cm**2  0.0    1.0E10
      NFS     fast surface state density    1/cm**2  0.0    1.0E10
      TPG     type of gate material:            -    1.0
                  +1 opp. to substrate
                  -1 same as substrate
                   0  Al gate
      XJ      metallurgical junction depth      m    0.0    1U
      LD      lateral diffusion                 m    0.0    0.8U
      UO      surface mobility             cm**2/V-s 600    700
      UCRIT   critical field for mobility
              degradation (MOS2 only)           V/cm 1.0E4  1.0E4
      UEXP    critical field exponent in
              mobility degradation (MOS2)       -    0.0    0.1
      UTRA    transverse field coef (mobility)
              (deleted for MOS2)                -    0.0    0.3
      VMAX    maximum carrier drift velocity    m/s  0.0    5.0E4
      NEFF    total channel charge (fixed and
              mobile) coefficient (MOS2 only)   -    1.0    5.0
      KF      flicker noise coefficient         -    0.0    1.0E-26
      AF      flicker noise exponent            -    1.0    1.2
      FC      coefficient for forward-bias
              depletion capacitance formula     -    0.5
      DELTA   width effect on thresh voltage
              (MOS2 and MOS3)                   -    0.0    1.0
      THETA   mobility modulation (MOS3 only)   1/V  0.0    0.1
      ETA     static feedback (MOS3 only)       -    0.0    1.0
      KAPPA   saturation field factor (MOS3)    -    0.2    0.5
 
 
           The level 4 parameters are  all  values  obtained  from
      process  characterization,  and  can  be generated automati-
      cally.  J. Pierret [3] describes a  means  of  generating  a
      'process'  file,  and  the  program  Proc2Mod  provided with
      SPICE3 will convert this file  into  a  sequence  of  .MODEL
      lines  suitable  for  inclusion  in  a  SPICE  circuit file.
      Parameters marked below with an * in  the  l/w  column  also
      have corresponding parameters with a length and width depen-
      dency.  For example, VFB is the basic parameter  with  units
      of  Volts,  and  LVFB  and WVFB also exist and have units of
      Volt-umeter The formula
 
              P=P0 + Pl/Leffective + Pw/Weffective
 
      is used to evaluate the  parameter  for  the  actual  device
      specified with
 
              Leffective=Linput-DL
 
      and
 
              Weffective=Winput-DW
 
 
           Note that unlike the other models in  SPICE,  the  BSIM
      model  is  designed  for use with a process characterization
      system that provides all the parameters, thus there  are  no
      defaults  for  the  parameters,  and leaving one out is con-
      sidered an error.  For an example set of parameters and  the
      format  of  a  process  file,  see the SPICE2 implementation
      notes[2].
 
      SPICE BSIM (level 4) parameters.
 
      name  parameter                           units      l/w
 
      VFB   flat-band voltage                   V          *
      PHI   surface inversion potential         V          *
      K1    body effect coefficient             V1/2       *
      K2    drain/source depletion              -          *
            charge sharing coefficient
      ETA   zero-bias drain-induced             -          *
            barrier lowering coefficient
      MUZ   zero-bias mobility                  cm2/V-s
      DL    shortening of channel               um
      DW    narrowing of channel                um
 
 
      U0    zero-bias transverse-field          V-1        *
            mobility degradation coefficient
      U1    zero-bias velocity saturation       um/V       *
            coefficient
      X2MZ  sens. of mobility to substrate      cm2/V2-s   *
            bias at vds=0
      X2E   sens. of drain-induced barrier      V-1        *
            lowering effect to substrate bias
      X3E   sens. of drain-induced barrier      V-1        *
            lowering effect to drain bias
            at Vds=Vdd
      X2U0  sens. of transverse field mobility  V-2        *
            degradation effect to substrate
            bias
      X2U1  sens. of velocity saturation        umV-2      *
            effect to substrate bias
      MUS   mobility at zero substrate bias     cm2/V2-s
            and at Vds=Vdd
      X2MS  sens. of mobility to substrate      cm2/V2-s   *
            bias at Vds=Vdd
      X3MS  sens. of mobility to drain bias     cm2/V2-s   *
            at Vds=Vdd
      X3U1  sens. of velocity saturation        umV-2      *
            effect on drain bias at Vds=Vdd
      TOX   gate oxide thickness                um
      TEMP  temperature at which parameters     C
            were measured
      VDD   measurement bias range              V
      CGDO  gate-drain overlap capacitance      F/m
            were measured
      CGSO  gate-source overlap capacitance     F/m
            per meter channel width
      CGBO  gate-bulk overlap capacitance       F/m
            per meter channel length
      XPART gate-oxide capacitance charge       -
            model flag
      N0    zero-bias subthreshold slope        -          *
            coefficient
      NB    sens. of subthreshold slope to      -          *
            substrate bias
      ND    sens. of subthreshold slope to      -          *
            drain bias
      RSH   drain and source diffusion sheet    Ohm/[]
            resistance
      JS    source drain junction current       A/m2
            density
      PB    built in potential of source        V
            drain junction
      MJ    Grading coefficient of source       -
            drain junction
      PBSW  built in potential of source        V
            drain juntion sidewall
      MJSW  grading coefficient of source       -
            drain junction sidewall
      CJ    Source drain junction capacitance   F/m2
            per unit area
      CJSW  source drain junction sidewall      F/m
            capacitance per unit length
      WDF   source drain junction default       m
            width
      DELL  Source drain junction length        m
            reduction
 
           XPART = 0 selects a 40/60 drain/source charge partition
      in  saturation, while XPART = 1 selects a 0/100 drain/source
      charge partition.
 
!!SEEALSO
m

!!KEYWORD
multi_decomp
!!TITLE
Standalone program multi_decomp
!!TEXT 
      See multiconductor
 
!!SEEALSO
multiconductor

!!KEYWORD
multiconductor
!!TITLE
Multiconductor (coupled) lossy transmission lines
!!TEXT     
          The standalone program multi_decomp produces a sub-circuit
      for multiconductor lossy transmission lines in terms of un-
      coupled (single) simple lossy lines. This decomposition is
      valid only if the following hold: 1. the electrical parameters
      (R, G, Cs, Cm, Ls, Lm) of all wires are identical and constant
      (i.e., independent of frequency), and 2. each line is coupled
      only to its (max. of 2) nearest neighbours.  The subckt is
      sent to the standard output and should be included in your
      input file.
 
          The syntax for multi_decomp is as follows:
 
            multi_decomp
               -l<self-inductance Ls>
               -c<self-capacitance Cs>
               -r<series-resistance R>
               -g<parallel-conductance G>
               -k<coeff.-of-inductive-coupling K> 
               -x<mutual-capacitance Cm>
               -o<subckt-name>
               -n<number-of-conductors>
               -L<length>
 
          The inductive coupling coeff. K is the ratio of Lm
      to Ls. -l, -c, -o, -n and -L must be specified.
 
      Example:
 
         multi_decomp -n4 -l9e-9 -c20e-12 -r5.3 -x5e-12 -k0.7
                -otest -L5.4
 
      See "Efficient Transient Simulation of Lossy Interconnect",
      J.S. Roychowdhury and D.O. Pederson, Proc. DAC 91 for details.
 
!!SEEALSO
ltra
o

!!KEYWORD
multi_dc
!!TITLE
Multi-DC Analysis
!!TEXT
      The analysis routines have been rewritten and modularized.
      This enables a new jspice3 feature: nested dc analysis.
      This allows most analyses to have an additional dc transfer
      specification, resulting in the analysis being performed at
      each dc operating point, producing a multi-dimensional
      output plot.  The new analysis specifications are as
      follows:

      .dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]]  (same as before)

      .ac {DEC OCT LIN} NP FSTART FSTOP [ dc SRC1NAME Vstart1
         [Vstop1 [Vinc1]] [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]

      .noise V(OUTPUT) SRC {DEC OCT LIN} NP FSTART FSTOP [PTSPRSUM]
         [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]

      .tf {vsrc v(node1[,node2])} src [ac {dec oct lin} pts fstart
         fstop] [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]

      .sens output [ac {dec lin oct} NP FSTART FSTOP]
         [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]

      .tran Tstep Tstop [Tstart] [Tmax] [UIC]
         [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]

      For the basic dc specification, vstop and vstep ane now
      optional.  If vstop is not given, only vstart is analyzed.
      If vstep is not given, analysis takes place at vstart and
      vstop.

      Note that ac capability has been added to tf (transfer
      function) analysis.

      For example:

      .ac dec 10 1Hz 1Mhz 1 dc v1 0 2 .1 v2 4.5 5.5 .25

      will perform an ac analysis with the dc sources v1 and v2
      stepped through the respective ranges.  The resulting output
      vectors will have dimensions [21,5,61].  Typing "plot v(1)"
      (for example) would plot all 21*5 analyses on the same scale
      (you probably don't want to do this).  You can also
      type "plot v(1)[1]" to plot the results for v1 = .1, or
      "plot v(1)[1][0]" for v1 = .1, v2 = 4.5, etc.  Range
      specifications also work, for example
      "plot v(1)[2][0,2]" plots the values for v1 = .2,
      v2 = 4.5,4.75,5.0.

      Warning: The memory space required to hold the plot data
      can grow quite large, so be reasonable.


!!KEYWORD
nodeset
!!TITLE
Nodeset Line
!!TEXT 
      General form:
 
           .NODESET V(NODNUM)=VAL V(NODNUM)=VAL ...
 
      Examples:
 
           .NODESET V(12)=4.5 V(4)=2.23
 
 
           This line helps the program  find  the  dc  or  initial
      transient  solution  by  making  a preliminary pass with the
      specified nodes held to the given voltages.  The restriction
      is  then  released  and  the iteration continues to the true
      solution.  A .NODESET line may be necessary for  convergence
      on  bistable  or  astable  circuits.   In general, this line
      should not be necessary.
 

!!KEYWORD
noise_analysis
!!TITLE
Small-Signal Noise Analysis
!!TEXT 
           The noise  analysis  portion  of SPICE does analysis of
      device-generated  noise for the given circuit. When provided
      with an input source and an output node, the analysis calcu-
      lates the noise contributions of each device (and each noise
      generator within the device) to the output node voltage.  It
      also  calculates the level of input noise from the specified
      input source to  generate the equivalent output noise.  This
      is done for every frequency point in a specified range - the
      calculated value  of the noise  corresponds to the  spectral
      density  of the  circuit  variable  viewed  as a  stationary
      gaussian stochastic process.
  
           After  calculating  the   spectral   densities,   noise
      analysis  integrates  these  values  over the specified fre-
      quency range to arrive at the  total  noise  voltage/current
      (over   this   frequency   range).   This  calculated  value
      corresponds to the variance of the circuit  variable  viewed
      as a stationary gaussian process.
  
  
      General form:
  
          .NOISE V(OUTPUT <,REF>) SRC {DEC/LIN/OCT} PTS FSTART FSTOP
                <PTS_PER_SUMMARY>
  
      Examples:
  
          .NOISE V(5) VIN DEC 10 1kHZ 100Mhz
          .NOISE V(5,3) V1 OCT 8 1.0 1.0e6 1
  
  
           This card does a noise analysis of the circuit.  OUTPUT
      is  the  node at which the total output noise is desired; if
      REF is specified, then the noise voltage V(OUTPUT)  -
      V(REF)  is  calculated.  By  default,  REF  is assumed to be
      ground. SRC is the name  of  an  independent  source  to
      which  input  noise  is referred.  PTS, FSTART and FSTOP are
      .AC type parameters that specify the  frequency  range  over
      which  plots  are  desired.  PTS_PER_SUMMARY  is an optional
      integer; if specified, the noise contributions of each noise
      generator   is   produced  every  PTS_PER_SUMMARY  frequency
      points.
 
           The .NOISE card produces two plots - one for the  Noise
      Spectral Density  curves  and  one for the total  Integrated
      Noise   over  the specified  frequency  range.   All   noise
      voltages/currents  are in  squared units (V^2/Hz and  A^2/Hz
      for spectral density, V^2 and A^2 for  integrated noise)  to
      maintain consistency and prevent confusion.
 
!!SEEALSO
multi_dc

!!KEYWORD
o
!!TITLE
Lossy Transmission Lines
!!TEXT     
      General form:
     
          OXXXXXXX N1 N2 N3 N4 MNAME
     
      Examples:
     
          O23 1 0 2 0 LOSSYMOD
          OCONNECT 10 5 20 5 INTERCONNECT
     
     
           This  is  a  two-port  convolution  model  for  single-
      conductor  lossy transmission lines. N1 and N2 are the nodes
      at port 1;  N3 and N4 are the nodes at port 2.  For  further
      details,  see the description of the LTRA type of the .MODEL
      card.
 
!!SEEALSO
ltra
multiconductor

!!KEYWORD
op_analysis
!!TITLE
Operating Point
!!TEXT 
      General form:
 
           .OP
 
 
           The inclusion of this line in an input file will  force
      SPICE  to  determine  the  dc operating point of the circuit
      with inductors shorted and capacitors opened.  Note:   a  dc
      analysis  is  automatically  performed  prior to a transient
      analysis to determine the transient initial conditions,  and
      prior  to  an  ac  small-signal  analysis  to  determine the
      linearized, small-signal models for nonlinear devices.
 
           SPICE performs a dc  operating  point  analysis  if  no
      other analyses are requested.
 

!!KEYWORD
oprng
!!TITLE
Operating Range Analysis
!!TEXT 
      JSPICE3 has an automated operating range analysis capability.
      The operating range analysis mode is used in conjunction with
      the other analysis types, such as tran or ac.  A suitably
      configured source file and circuit description is evaluated
      over a one or two dimensional area of parameter space,
      producing (optionally) an output file describing the results
      at each evaluated point, or vectors giving the min and max
      values of the varying parameters for operation.
      Results can be viewed graphically during or after simulation.

      As with conventional circuit and command files, operating range
      analysis files can be sourced by simply typing in the file
      name.  If the file name happens to conflict with a command,
      then the file can be input with the source command.  If not
      in batch mode, the analysis is initiated with the "check"
      command, otherwise the analysis is performed immediately.

!!SEEALSO
source
check

!!KEYWORD
oprngfile 
!!TITLE
Operating Range Input File Format
!!TEXT  
      The simplest way to specify an operating range job is to
      input a file in the format given below.  Alternatively,
      the various variables and vectors can be defined and
      initialized by other means, and a codeblock, which
      provides pass/fail analysis, bound.

      The input file which specifies operating range analysis
      consists of three sections:

        1. an initializing header
        2. a body of control statements
        3. the circuit description

      The first line of the initializing header (and the file)
      consists of the characters

        .check

      This really is the first line of this type of file, no
      blank lines or comments should preceed it.  The lines which
      follow ".check" initialize internally defined vectors which
      are used in the analysis.  The vectors which have special
      meaning to JSPICE3 are listed in the table below.
      These vectors should be added to the constants plot.

        checkFAIL   (global fail flag - optional)
        checkPNTS   (vector of scale test points - manditory)
        checkVAL1   (initial central value1 - manditory)
        checkDEL1   (delta1 - optional)
        checkSTP1   (number of steps above and below - optional)
        checkVAL2   (initial central value2 - optional)
        checkDEL2   (delta2 - optional)
        checkSTP2   (number of steps above and below - optional)

      Other user defined vectors can be defined here as well.
      The shell variable "checkiterate" can also be set at this
      point, which determines the binary search depth for range
      determination.  In order to perform analysis, checkPNTS,
      a real vector, must be specified, as must be checkVAL1.
      The variable checkPNTS is a vector of points on the running
      variable (e.g., time in transient analysis) where the
      pass/fail conditionals are applied. It is initialized with
      the compose command.  The other vectors can be omitted if not
      used.  Note that checkPNTS must have length > 1, the others
      have length 1.  The global fail flag vector is defined
      internally if not declared.  It is set to 1 if the circuit
      fails, otherwise it is 0.

      Example:

         .check
         let checkFAIL = 0
         compose checkPNTS values 50p 100p 150p 200p
         let checkVAL1 = 12
         let checkDEL1 = .5
         let checkSTP1 = 5
         let checkVAL2 = .5
         let checkDEL2 = .1
         let checkSTP2 = 2

      The variables checkFAIL, checkSTP1, and checkSTP2 are
      integers.  The other variables are real, except for
      checkPNTS which is a real vector.

      This control statements follow the header, and the section
      begins with a line containing the characters

         .control

      The lines following are syntactically identical to the nutmeg
      script language.  They perform a logical comparison of
      circuit variables and set the checkFAIL variable accordingly.
      The final line of this section must be

         .endc

      These statements are taken as a codeblock and bound to the
      circuit file.  The name of the codeblock is the circuit
      file name preceded with "#_".

      The circuit description, which immediately follows the
      control block consists of conventional spice format circuit
      description lines.  The special shell variables value1 and
      value2 take on the values of the varying parameters
      during analysis.  The concatenation character "%" can be
      used to concatenate a suffix to the variables.  For
      example:

        in header:  checkVAL1 = 12

        in circuit description:  v1 1 0 pulse(0 $value1%m 10p 10p)

      This is equivalent to

        in header:  checkVAL1 = 1.2e-2

        in circuit description:  v1 1 0 pulse(0 $value1 10p 10p).

      In the first example, the token containing value1 
      evaluates to "12m" (on the first pass).

      Alternatively, a vector can be used to specify varying
      parameters.  See the description of the "check" command
      for more information.

!!SEEALSO
expressions
proglang

!!KEYWORD
optimize
!!TITLE
Circuit Margin Optimization
!!TEXT 
          There are three scripts which implement a margin
      optimization algorithm used by Clark Hamilton at NIST.  These
      files (kept in the scripts directory) are optimize, margins,
      and merit.  Optimize is the main script, and is invoked with
      the name of the files to be optimized as an argument.  An
      example file is shown below:


      .check
      set checkiterate = 3
      let checkN1 = 0
      compose checkPNTS values 1n 2n
      let value[19] = 0
      let flags[19] = 0
      let flags[0] = 1
      let value[0] = .8
      .control
      if (TIME >= checkPNTS[0])
          checkFAIL = 0
          if ((abs(v(1)) > 1.5) or (abs(v(1)) < .5))
              checkFAIL = 1
          endif
      endif
      .endc
      optimization test
      i1 0 1 pulse(0 1 0 1n)
      r1 1 0 $&value[0]
      .tran .01n 1.1n
      .end


      This is the simplest way to input the file, alternatively
      one could set the shell variables and vectors externally
      and/or use a bound codeblock for pass/fail evaluation.

      The variable checkiterate must be set to a nonzero value up
      to 10.  This is the binary search depth for finding the
      operating range.

      The vectors checkN1 and value[] must be defined, checkN1 is
      the index into the value array of the variable being adjusted.
      It is altered by the scripts, but it and value[] must be
      defined before the script is input or in the header as shown.

      The vector checkPNTS is the array of points where analysis
      is performed.  Note that due to some strangeness, at least
      two entries must exist.

      The value array is initialized to the starting values.  The
      flags vector contains 1 for each entry in the array which is
      to be varied, the others are treated as constants.

      The lengths of the vectors value[] and flags[] is 20, which
      is assumed in the optimization script.

      After the analysis is complete, the value array will contain
      the optimized values.  Two other arrays, lower and upper, are
      created, and contain the lower and upper limit for each value
      index.

      The scripts provided can be customized by the user for more
      specific applications, or used as templates for different
      types of analysis.  It is recommended that such scripts be
      defined as codeblocks to speed execution.

!!SEEALSO
check
codeblock

!!KEYWORD
option
!!TITLE
Option Line
!!TEXT 
      General form:
 
           .OPTIONS OPT1 OPT2 ... (or OPT=OPTVAL ...)
 
      Examples:
 
           .OPTIONS RELTOL=.005 TRTOL=8
 
 
           This line allows the user to reset program control  and
      user options for specific simulation purposes.
 
!!SEEALSO
set

!!KEYWORD
pulse
!!TITLE
Pulse
!!TEXT 
      PULSE(V1 V2 TD TR TF PW PER)
 
      Examples:
 
          VIN 3 0 PULSE(-1 1 2NS 2NS 2NS 50NS 100NS)
 
 
          parameters           default values   units
 
          V1 (initial value)                    Volts or Amps
          V2 (pulsed value)                     Volts or Amps
          TD (delay time)      0.0              seconds
          TR (rise time)       TSTEP            seconds
          TF (fall time)       TSTEP            seconds
          PW (pulse width)     TSTOP            seconds
          PER(period)          TSTOP            seconds
 
 
           A single pulse so specified is described by the follow-
      ing table:
 
          time            value
 
          0               V1
          TD              V1
          TD+TR           V2
          TD+TR+PW        V2
          TD+TR+PW+TF     V1
          TSTOP           V1
 
 
      Intermediate points are determined by linear interpolation.
 

!!KEYWORD
pwl
!!TITLE
Piece-Wise Linear
!!TEXT 
           PWL(T1 V1 <T2 V2 T3 V3 T4 V4 ...>)
 
      Examples:
 
          VCLOCK 7 5 PWL(0 -7 10NS -7 11NS -3 17NS -3 18NS -7 50NS -7)
 
 
           Each pair of values (Ti, Vi) specifies that  the  value
      of  the  source  is Vi (in Volts or Amps) at time = Ti.  The
      value of the source at intermediate values of time is deter-
      mined by using linear interpolation on the input values.
 

!!KEYWORD
pz_analysis
!!TITLE
Pole-Zero Analysis
!!TEXT 
           The pole-zero analysis portion of  SPICE  computes  the
      poles and/or zeros in the small-signal ac transfer function.
      The program first computes the dc operating point  and  then
      determines  the  linearized, small-signal models for all the
      nonlinear devices in the circuit. This circuit is then  used
      to find the poles and zeros.
 
           Two types of transfer functions are allowed: one of the
      form  (output  voltage)/(input voltage) and the other of the
      form (output voltage)/(input current).  These two  types  of
      transfer  functions cover all the cases and one can find the
      poles/zeros of functions  like  input/output  impedance  and
      voltage  gain.   The input and output ports are specified as
      two pairs of nodes.
 
           The pole-zero analysis works  with  resistors,  capaci-
      tors,   inductors,  linear-controlled  sources,  independent
      sources, BJTs,  MOSFETs,  JFETs  and  diodes.   Transmission
      lines are not supported.
 
      General forms:
 
            .PZ NODE1 NODE2 NODE3 NODE4 CUR POL
            .PZ NODE1 NODE2 NODE3 NODE4 CUR ZER
            .PZ NODE1 NODE2 NODE3 NODE4 CUR PZ
            .PZ NODE1 NODE2 NODE3 NODE4 VOL POL
            .PZ NODE1 NODE2 NODE3 NODE4 VOL ZER
            .PZ NODE1 NODE2 NODE3 NODE4 VOL PZ
 
      Examples:
 
            .PZ 1 0 3 0 CUR POL
            .PZ 2 3 5 0 VOL ZER
            .PZ 4 1 4 1 CUR PZ
 
 
           CUR stands for a transfer function of the type  (output
      voltage)/(input  current)  while  VOL  stands for a transfer
      function of the type (output voltage)/(input voltage).   POL
      stands  for  pole  analysis only, ZER for zero analysis only
      and PZ for both.  This feature is provided mainly because if
      there  is  a nonconvergence in finding poles or zeros, then,
      at least the other can be found.  Finally, NODE1  and  NODE2
      are the two input nodes and NODE3 and NODE4 are the two out-
      put nodes.  Thus, there is complete  freedom  regarding  the
      output and input ports and the type of transfer function.
 
           In interactive mode, the command  syntax  is  the  same
      except  that the first field is PZ instead of .PZ.  To print
      the results, one should use the command 'print all'.
 

!!KEYWORD
q
!!TITLE
Bipolar Junction Transistors
!!TEXT 
      General form:
 
          QXXXXXXX NC NB NE <NS> MNAME <AREA> <OFF> <IC=VBE,VCE>
 
      Examples:
 
          Q23 10 24 13 QMOD IC=0.6,5.0
          Q50A 11 26 4 20 MOD1
 
 
           NC, NB, and NE are the  collector,  base,  and  emitter
      nodes,  respectively.   NS is the (optional) substrate node.
      If unspecified, ground is used.  MNAME is  the  model  name,
      AREA  is  the  area  factor, and OFF indicates an (optional)
      initial condition on the device for the dc analysis.  If the
      area  factor  is  omitted,  a  value of 1.0 is assumed.  The
      (optional) initial condition specification using  IC=VBE,VCE
      is  intended  for use with the UIC option on the .TRAN line,
      when a transient analysis is  desired  starting  from  other
      than  the  quiescent  operating  point.   See  the  .IC line
      description for a better way to set transient initial condi-
      tions.
 
!!SEEALSO
bjt

!!KEYWORD
r
!!TITLE
Resistors
!!TEXT 
      General form:
 
          RXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH>
 
      Examples:
 
          RLOAD 2 10 10K
          RMOD 3 7 RMODEL L=10u W=1u
 
 
           This is general form allows the modeling of temperature
      effects and for the calculation  of  the  actual  resistance
      value from strictly geometric information and the specifica-
      tions of the process.  If VALUE is specified,  it  overrides
      the  geometric  information  and defines the resistance.  If
      MNAME is specified, then the resistance  may  be  calculated
      from  the  process  information  in  the model MNAME and the
      given LENGTH and WIDTH.  If VALUE  is  not  specified,  then
      MNAME  and LENGTH must be specified.  If WIDTH is not speci-
      fied, then it will be taken from the default width given  in
      the model.
 
!!SEEALSO
rmodel

!!KEYWORD
rmodel
!!TITLE
Resistor Models
!!TEXT 
           The resistor model consists of  process-related  device
      data  that  allow  the  resistance  to  be  calculated  from
      geometric information and to be corrected  for  temperature.
      The parameters available are:
 
      name    parameter                       units default  example
 
      TC1     first order temperature coeff   Ohm/C   0.0      -
      TC2     second order temperature coeff  Ohm/C2  0.0      -
      RSH     sheet resistance                Ohm/[]   -       50
      DEFW    default width                   meters  1e-6     2e-6
      NARROW  narrowing due to side etching   meters  0.0      1e-7
 
 
           The sheet resistance is used with the narrowing parame-
      ter and L and W from the resistor line to determine the nom-
      inal resistance by the formula
 
            R = RSHxL / (W-NARROW)
 
      DEFW is used to supply a default value for W if one  is  not
      specified  on  the  device  line.  If either RSH or L is not
      specified, then the standard default resistance value of  1k
      ohm is used.  After the nominal resistance is calculated, it
      is adjusted for temperature by the formula:
 
        RES(temp)=RES(tnom)x(1+TC1x(temp-tnom)+TC2*(temp-tnom)2)
 
 

!!KEYWORD
semicond
!!TITLE
Semiconductor Devices
!!TEXT 
           The elements described to this point typically  require
      only  a  few  parameter values.  However, the models for the
      semiconductor devices that are included in the SPICE program
      require  many  parameter  values.   Often, many devices in a
      circuit are defined by the same set of device model  parame-
      ters.   For  these reasons, a set of device model parameters
      is defined on a separate .MODEL line and assigned  a  unique
      model name.  The device element lines in SPICE then refer to
      the model name.  This scheme alleviates the need to  specify
      all of the model parameters on each device element line.
 
           Each device element line contains the device name,  the
      nodes to which the device is connected, and the device model
      name.  In addition, other optional parameters may be  speci-
      fied  for  some  devices:   geometric factors and an initial
      condition.
 
           The area factor used on the diode, BJT, JFET, and  MES-
      FET  device lines determines the number of equivalent paral-
      lel devices of a specified model.  The  affected  parameters
      are  marked with an asterisk under the heading 'area' in the
      model descriptions below.  Several geometric factors associ-
      ated  with  the  channel and the drain and source diffusions
      can be specified on the MOSFET device line.
 
           Two different forms of initial conditions may be speci-
      fied  for  some  devices.   The  first  form  is included to
      improve the dc convergence for circuits  that  contain  more
      than one stable state.  If a device is specified OFF, the dc
      operating point is determined with the terminal voltages for
      that device set to zero.  After convergence is obtained, the
      program continues to iterate to obtain the exact  value  for
      the  terminal  voltages.   If a circuit has more than one dc
      stable state, the OFF option can be used to force the  solu-
      tion  to  correspond  to  a  desired  state.  If a device is
      specified OFF when in reality the device is conducting,  the
      program will still obtain the correct solution (assuming the
      solutions converge) but more  iterations  will  be  required
      since   the  program  must  independently  converge  to  two
      separate solutions.  The .NODESET line serves a similar pur-
      pose  as  the  OFF option.  The .NODESET option is easier to
      apply and is the preferred means to aid convergence.
 
           The second form of initial conditions are specified for
      use  with  the  transient analysis.  These are true 'initial
      conditions' as opposed to the convergence aids  above.   See
      the  description  of  the  .IC line and the .TRAN line for a
      detailed explanation of initial conditions.
 
!!SUBTOPICS
c
juncd
j
m
q
r
u
z

!!KEYWORD
sens_analysis
!!TITLE
DC or Small-Signal AC Sensitivity Analysis
!!TEXT 
      General form:
 
           .SENS OUTVAR
           .SENS OUTVAR AC DEC ND FSTART FSTOP
           .SENS OUTVAR AC OCT NO FSTART FSTOP
           .SENS OUTVAR AC LIN NP FSTART FSTOP
 
      Examples:
 
           .SENS V(1,OUT)
           .SENS V(OUT) AC DEC 10 100 100k
           .SENS I(VTEST)
 
 
           The sensitivity of OUTVAR to all non-zero device param-
      eters  is  calculated  when  the SENS analysis is specified.
      OUTVAR is a circuit variable (node voltage or voltage-source
      branch  current).   The first form calculates sensitivity of
      the DC operating-point value of  OUTVAR.   The  second  form
      calculates  sensitivity  of  the  AC  values of OUTVAR.  The
      parameters listed for AC sensitivity are the same as  in  an
      AC  analysis  (see  ".AC"  above).  The output values are in
      dimensions of change in output per unit change of input  (as
      opposed to percent change in output or per percent change of
      input).
 
!!SEEALSO
multi_dc

!!KEYWORD
sinusoid
!!TITLE
Sinusoidal
!!TEXT 
           SIN(VO VA FREQ TD THETA)
 
      Examples:
 
          VIN 3 0 SIN(0 1 100MEG 1NS 1E10)
 
 
          parameters          default value   units
 
          VO     (offset)                     Volts or Amps
          VA     (amplitude)                  Volts or Amps
          FREQ   (frequency)      1/TSTOP     Hz
          TD     (delay)          0.0         seconds
          THETA  (damping factor) 0.0         1/seconds
 
 
           The shape of the waveform is described by the following
      table:
 
      time            value
 
      0 to TD         VO
      TD to TSTOP     VO + VA*exp(-(time-TD)*THETA)*
                         sine(twopi*FREQ*(time+TD))
 

!!KEYWORD
sll
!!TITLE
Simple Lossy Line
!!TEXT
      See ltra.
 
!!SEEALSO
ltra

!!KEYWORD
spice
!!TITLE
SPICE3 Summary
!!TEXT 
           SPICE is a general-purpose circuit  simulation  program
      for  nonlinear  dc,  nonlinear transient, and linear ac ana-
      lyses.  Circuits may contain resistors,  capacitors,  induc-
      tors,  mutual  inductors,  independent  voltage  and current
      sources,  four  types  of  dependent  sources,  transmission
      lines, switches, and the five most common semiconductor dev-
      ices:  diodes, BJTs, JFETs, MESFETs, and MOSFETs.
 
           The SPICE3 version is based  directly  on  SPICE  2G.6.
      While  SPICE3 is being developed to include new features, it
      will continue to support those capabilities and models which
      remain in extensive use in the SPICE2 program.
 
           SPICE has built-in models for  the  semiconductor  dev-
      ices,  and  the  user  need specify only the pertinent model
      parameter values.  The model for the BJT  is  based  on  the
      integral  charge  model of Gummel and Poon;  however, if the
      Gummel- Poon parameters are not specified, the model reduces
      to  the  simpler  Ebers-Moll  model.  In either case, charge
      storage effects, ohmic resistances, and a  current-dependent
      output  conductance may be included.  The diode model can be
      used for either junction diodes or Schottky barrier  diodes.
      The  JFET  model  is  based on the FET model of Shichman and
      Hodges.   Four  MOSFET  models  are  implemented:  MOS1   is
      described  by a square-law I-V characteristic, MOS2[1] is an
      analytical model, while MOS3[1] is a  semi-empirical  model,
      and  MOS4[2,3] is the new BSIM (Berkeley Short-channel IGFET
      Model).  MOS2, MOS3, and MOS4 include  second-order  effects
      such  as channel length modulation, subthreshold conduction,
      scattering limited velocity saturation, small-size  effects,
      and charge-controlled capacitances.
 

!!KEYWORD
spulse 
!!TITLE
Sinusoidal Pulse
!!TEXT 
      SPULSE(VO VP PER TD DECAY)

          Example:  VIN 1 0 SPULSE(0 1 25NS 40NS 1e8)

      parameters                default value    units
     
      VO      (offset)                           Volts or Amps
      VP      (peak amplitude)                   Volts or Amps
      PER     (period)          TSTOP            Seconds
      TD      (delay)           0                Seconds
      DECAY   (decay const)     0                1/seconds

      The waveform is described by the following table:

          time          value

          0  to TD      VO
          TD to TSTOP   VO + .5*(VO+VP)*(1-cos(2*PI*(time-DELAY)/PER))
                               *exp(-(time-delay)*DECAY)       
 

!!KEYWORD
subckts
!!TITLE
Subcircuits
!!TEXT 
           A subcircuit that consists of  SPICE  elements  can  be
      defined  and  referenced  in  a  fashion  similar  to device
      models.  The subcircuit is defined in the input  file  by  a
      grouping  of  element lines;  the program then automatically
      inserts the group of elements  wherever  the  subcircuit  is
      referenced.   There is no limit on the size or complexity of
      subcircuits, and subcircuits may contain other  subcircuits.
      An example of subcircuit usage is given in Appendix A.
 
      1.1.  .SUBCKT Card
 
      General form:
 
           .SUBCKT subnam N1 <N2 N3 ...>
 
      Examples:
 
           .SUBCKT OPAMP 1 2 3 4
 
 
           A circuit definition is  begun  with  a  .SUBCKT  line.
      SUBNAM  is  the  subcircuit  name,  and  N1, N2, ... are the
      external nodes, which cannot be zero.  The group of  element
      lines  which  immediately follow the .SUBCKT line define the
      subcircuit.  The last line in a subcircuit definition is the
      .ENDS line (see below).  Control lines may not appear within
      a subcircuit definition;   however,  subcircuit  definitions
      may contain anything else, including other subcircuit defin-
      itions, device models, and  subcircuit  calls  (see  below).
      Note  that  any  device  models  or  subcircuit  definitions
      included as part of a  subcircuit  definition  are  strictly
      local  (i.e., such models and definitions are not known out-
      side the subcircuit definition).  Also,  any  element  nodes
      not  included  on  the .SUBCKT line are strictly local, with
      the exception of 0 (ground) which is always global.
 
      1.2.  .ENDS Card
 
      General form:
 
           .ENDS <SUBNAM>
 
      Examples:
 
           .ENDS OPAMP
 
 
           This line must be  the  last  one  for  any  subcircuit
      definition.   The  subcircuit  name,  if included, indicates
      which subcircuit definition is being terminated;   if  omit-
      ted, all subcircuits being defined are terminated.  The name
      is needed only when nested subcircuit definitions are  being
      made.
 
 
      1.3.  Subcircuit Calls
 
      General form:
 
          XXYYYYYYY N1 <N2 N3 ...> SUBNAM
 
      Examples:
 
          X1 2 4 17 3 1 MULTI
 
 
           Subcircuits are used in  SPICE  by  specifying  pseudo-
      elements beginning with the letter `X', followed by the cir-
      cuit nodes to be used in expanding the subcircuit.
 
           Note that when a circuit is  parsed,  all  devices  and
      local     nodes    in    subcircuits    are    renamed    as
      devicetype:subcktname:devicename.      Nested     subcircuit
      instances  will  have  multiple  colon-seperated qualifiers.
      Nutmeg will also accept  subcircuit  names  with  components
      seperated by periods, so long as the names do not clash with
      names specifiable as plotname.value.
 

!!KEYWORD
sw
!!TITLE
Switches
!!TEXT 
      General form:
 
          SXXXXXXX N+ N- NC+ NC- MODEL <ON><OFF>
          WYYYYYYY N+ N- VNAM MODEL <ON><OFF>
 
      Examples:
 
          S1 1 2 3 4 SWITCH1 ON
          S2 5 6 3 0 SM2 OFF
          SWITCH1 1 2 10 0 SMODEL1
          W1 1 2 VCLOCK SWITCHMOD1
          W2 3 0 VRAMP SM1 ON
          WRESET 5 6 VCLCK LOSSYSWITCH OFF
 
 
           Nodes N+ and N- are the nodes between which the  switch
      terminals  are connected.  The model name is mandatory while
      the initial conditions are optional.  For the  voltage  con-
      trolled switch, nodes NC+ and NC- are the positive and nega-
      tive controlling nodes respectively.  For the  current  con-
      trolled  switch, the controlling current is that through the
      specified voltage source.  The direction  of  positive  con-
      trolling current flow is from the positive node, through the
      source, to the negative node.
 
 
!!SEEALSO
swmodel

!!KEYWORD
swmodel
!!TITLE
Switch Models
!!TEXT 
           The switch model allows an almost ideal  switch  to  be
      described  in SPICE.  The switch is not quite ideal, in that
      the resistance can not change from 0 to infinity,  but  must
      always have a finite positive value.  By proper selection of
      the on and off resistances, they can be effectively zero and
      infinity  in  comparison  to  other  circuit  elements.  The
      parameters available are:
 
          name   parameter            units   default   switch
 
          VT     threshold voltage    Volts   0.0       S
          IT     threshold current    Amps    0.0       W
          VH     hysteresis voltage   Volts   0.0       S
          IH     hysteresis current   Amps    0.0       W
          RON    on resistance        Ohms    1.0       both
          ROFF   off resistance       Ohms    1/GMIN*   both
 
 
           *(See the  description  of  the  .OPTIONS  line  for  a
      description  of  GMIN,  its  default  value results is a off
      resistance of 1.0e+12 ohms.)
 
           The use of an ideal element that is  highly  non-linear
      such as a switch can cause large discontinuities to occur in
      the circuit node voltages.  A  rapid  change  such  as  that
      associated  with a switch changing state can cause numerical
      roundoff or tolerance problems leading to erroneous  results
      or  timestep difficulties.  The user of switches can improve
      the situation by taking the following steps:
 
           First of all it is wise to set ideal switch  impedences
      only  high  and  low enough to be negligible with respect to
      other circuit elements.  Using switch  impedences  that  are
      close  to "ideal" in all cases will aggravate the problem of
      discontinuities mentioned above.  Of course,  when  modeling
      real  devices  such  as MOSFETS, the on resistance should be
      adjusted to a realistic level depending on the size  of  the
      device being modelled.
 
           If a wide range of ON to OFF resistance must be used in
      the switches (ROFF/RON >1e+12), then the tolerance on errors
      allowed during transient analysis  should  be  decreased  by
      using the .OPTIONS line and specifying TRTOL to be less than
      the default value of 7.0.  When switches are  placed  around
      capacitors,  then  the option CHGTOL should also be reduced.
      Suggested values for these two options  are  1.0  and  1e-16
      respectively.   These changes inform SPICE3 to be more care-
      ful around the switch points so that no errors are made  due
      to the rapid change in the circuit.
 
!!SEEALSO
sw

!!KEYWORD
t
!!TITLE
Transmission Lines (Lossless)
!!TEXT 
      General form:
 
          TXXXXXXX N1 N2 N3 N4 Z0=VALUE <TD=VALUE>
          +               <F=FREQ <NL=NRMLEN>> <IC=V1,I1,V2,I2>
 
      Examples:
 
          T1 1 0 2 0 Z0=50 TD=10NS
 
 
           N1 and N2 are the nodes at port 1;  N3 and N4  are  the
      nodes  at  port 2.  Z0 is the characteristic impedance.  The
      length of the line may be expressed in either of two  forms.
      The  transmission  delay,  TD, may be specified directly (as
      TD=10ns, for example).  Alternatively, a frequency F may  be
      given, together with NL, the normalized electrical length of
      the transmission line with respect to the wavelength in  the
      line at the frequency F.  If a frequency is specified but NL
      is omitted, 0.25 is  assumed  (that  is,  the  frequency  is
      assumed  to  be  the  quarter-wave  frequency).   Note  that
      although both forms for expressing the line length are indi-
      cated as optional, one of the two must be specified.
 
           Note that this  element  models  only  one  propagating
      mode.  If all four nodes are distinct in the actual circuit,
      then two modes may be excited.  To simulate  such  a  situa-
      tion, two transmission-line elements are required.  (see the
      example in Appendix A for further clarification.)
 
           The (optional) initial condition specification consists
      of  the voltage and current at each of the transmission line
      ports.  Note that the initial conditions (if any) apply only
      if the UIC option is specified on the .TRAN line.
 
!!SEEALSO
o
ltra
multiconductor

!!KEYWORD
table 
!!TITLE
Table Reference
!!TEXT 
      General form:

          TABLE <table_name>

      Example:

          TABLE TAB1

           The table referenced must be specified in the input deck
      with a .TABLE line.
 
!!SEEALSO
tableline

!!KEYWORD
tableline 
!!TITLE
Table Line
!!TEXT 
      General form:

          .table table_name [x0] <stuff0> x1 <stuff1> ... xN [<stuffN>]

      Example:
    
          .table tab1 0 1 .2 function sin(x) .4 table txx .8 .5e-2
        
           A .table line specifies a data structure which is used for
      the specification of nonlinear relationships.  The <stuffi> can
      be a number, a function, or another table reference.  The xi are
      numbers used for comparison.  If <stuff1> is a table or function,
      x0 can be omitted, in which case it reverts to zero.  If x is
      the independent variable associated with the device which
      references the table, the computed value is as follows:

      x < x0       :  val = <stuff0>(x0)
      x0 <= x < x1 :  val = <stuff0>(x) (<stuff0> function or table)
                      val = interpolation of <stuff0>, <stuff1>(x1) if
                            <stuff0> is a number.
      ...

      x > xN       :  val = <stuffN>(x) (<stuffN> function or table)
                      val = <stuffN>  (<stuffN> is a number
                      val = <stuffN-1>(xN) (if omitted)
 
!!SEEALSO
function

!!KEYWORD
tf_analysis
!!TITLE
DC Transfer Function Analysis
!!TEXT 
      General form:
 
           .TF {OUTSRC | V(N1[,N2])} INSRC [ AC {DEC|OCT|LIN}
               PTS FSTART FSTOP ]
 
      Examples:
 
           .TF V(5,3) VIN
           .TF I(VLOAD) VIN AC DEC 10 1 1E12
 
 
           The TF line defines the small-signal output and input
      for the ac small-signal analysis.  OUTVAR is the small-
      signal output variable and INSRC is the small-signal input
      source.  If this line is included, SPICE computes the ac
      small-signal value of the transfer function (output/input),
      input impedance, and output impedance.  For the first
      example, SPICE would compute the ratio of V(5,3)  to  VIN,
      the small-signal input impedance at VIN, and the small-
      signal output impedance measured across nodes 5 and 3.  If
      the AC parameters are omitted, DC values will be computed.
 
!!SEEALSO
multi_dc

!!KEYWORD
titlecard
!!TITLE
Title Line
!!TEXT 
           This line must be the first line in the input file.  It
      is printed at the top of each page of output.
 
      Examples:
 
          POWER AMPLIFIER CIRCUIT
          TEST OF CAM CELL
 

!!KEYWORD
tra
!!TITLE
Lossless Transmission Lines
!!TEXT
      See t.
 
!!SEEALSO
t

!!KEYWORD
tran_analysis
!!TITLE
Transient Analysis
!!TEXT 
           The transient analysis portion of  SPICE  computes  the
      transient  output  variables  as  a  function of time over a
      user-specified time interval.  The  initial  conditions  are
      automatically  determined  by  a  dc  analysis.  All sources
      which are not time dependent (for example,  power  supplies)
      are  set  to their dc value.  The transient time interval is
      specified on a .TRAN control line.
 
      General form:
 
           .TRAN TSTEP TSTOP <TSTART <TMAX>> <UIC>
 
      Examples:
 
           .TRAN 1NS 100NS
           .TRAN 1NS 1000NS 500NS
           .TRAN 10NS 1US UIC
 
 
           TSTEP is the printing or plotting increment  for  line-
      printer  output.   For use with the post-processor, TSTEP is
      the suggested computing increment.  TSTOP is the final time,
      and TSTART is the initial time.  If TSTART is omitted, it is
      assumed to be zero.  The transient analysis always begins at
      time  zero.   In the interval <zero, TSTART>, the circuit is
      analyzed (to reach a  steady  state),  but  no  outputs  are
      stored.   In  the  interval  <TSTART, TSTOP>, the circuit is
      analyzed and outputs are stored.  TMAX is the maximum  step-
      size  that  SPICE  will  use (by default the program chooses
      either TSTEP or (TSTOP-TSTART)/50.0, whichever  is  smaller.
      TMAX  is  useful  when  one  wishes to guarantee a computing
      interval which is smaller than the printer increment, TSTEP.
 
           UIC (use initial conditions)  is  an  optional  keyword
      which  indicates  that the user does not want SPICE to solve
      for the quiescent operating point before beginning the tran-
      sient  analysis.   If  this keyword is specified, SPICE uses
      the values specified using IC=... on the various elements as
      the  initial  transient  condition  and  proceeds  with  the
      analysis.  If an .IC line has been given, then the node vol-
      tages  on the .IC line are used to compute the intitial con-
      ditions for the devices.  Look at the description on the
      IC line for its interpretation when UIC is not specified.
 
!!SEEALSO
multi_dc

!!KEYWORD
u
!!TITLE
URC's (Lossy)
!!TEXT 
      General form:
 
          UXXXXXXX N1 N2 N3 MNAME L=LEN <N=LUMPS>
 
      Examples:
 
          U1 1 2 0 URCMOD L=50U
          URC2 1 12 2 UMODL l=1MIL N=6
 
 
           N1 and N2 are the two element nodes the  RC  line  con-
      nects,  while  N3  is the node to which the capacitances are
      connected.  MNAME is the model name, LEN is  the  length  of
      the  RC  line in meters.  LUMPS, if specified, is the number
      of lumped segments to use in modeling the RC line  (see  the
      model  description for the action taken if this parameter is
      omitted).
 
!!SEEALSO
t

!!KEYWORD
urc
!!TITLE
URC Models
!!TEXT 
           The URC model is derived from a model  proposed  by  L.
      Gertzberrg  in 1974.  The model is accomplished by a subcir-
      cuit type expansion of the URC line into a network of lumped
      RC  segments  with  internally generated nodes.  The RC seg-
      ments are in a geometric progression, increasing toward  the
      middle  of  the  URC  line, with K as a proportionality con-
      stant.
 
           The URC line will be made up strictly of  resistor  and
      capacitor  segments  unless  the ISPERL parameter is given a
      non-zero value, in which case the  capacitors  are  replaced
      with reverse biased diodes with a zero-bias junction capaci-
      tance equivalent to the capacitance  replaced,  and  with  a
      saturation  current of ISPERL amps per meter of transmission
      line and an optional series resistance equivalent to  RSPERL
      ohms per meter.
 
      name    parameter                      units  default  example
 
      K       Propagation Constant           -      2.0      1.2     
      FMAX    Maximum Frequency              Hz     1.0G     6.5MEG  
      RPERL   Resistance per length          Ohm/m  1000     10      
      CPERL   Capacitance per length         F/m    1.0E-15  1PF     
      ISPERL  Saturation Current per length  Amp/m  0        -       
      RSPERL  Diode Resistance per length    Ohm/m  0        -       
 
!!SEEALSO
u

!!KEYWORD
VCVS
!!TITLE
Voltage-Controlled Voltage Sources
!!TEXT 
      This is a special case of the general source specification
      included for backward compatibility.
 
      General forms:
 
          EXXXXXXX N+ N- NC+ NC- <value>
          EXXXXXXX N+ N- NC+ NC- FUNCTION <function_string>
 
      Examples:
 
          E1 2 3 14 1 2.0
          E1 2 3 14 1 FUNCTION x+.015*x*x
 
 
           N+ is the positive node, and N- is the  negative  node.
      NC+ and NC- are the positive and negative controlling nodes,
      respectively.  <value> is the voltage gain.  A nonlinear re-
      lationship  can be  specified  with the  "function" keyword.
      The variable "x" is taken to be the controlling voltage.
 
!!SEEALSO
function

!!KEYWORD
z
!!TITLE
MESFET's
!!TEXT 
      General form:
 
          ZXXXXXXX ND NG NS MNAME <AREA> <OFF> <IC=VDS,VGS>
 
      Examples:
 
          Z1 7 2 3 ZM1 OFF
 
 
           ND, NG, and NS are the drain, gate, and  source  nodes,
      respectively.   MNAME  is  the  model name, AREA is the area
      factor, and OFF indicates an (optional) initial condition on
      the  device for dc analysis.  If the area factor is omitted,
      a value of 1.0 is assumed.  The (optional) initial condition
      specification, using IC=VDS,VGS is intended for use with the
      UIC option on the .TRAN line, when a transient  analysis  is
      desired  starting  from  other  than the quiescent operating
      point.  See the description of the .IC line for a better way
      to set initial conditions.
 
 
!!SEEALSO
mesfet


*****************************************************************
*
* Variables
*
*****************************************************************

!!KEYWORD
booleans
!!TITLE
Booleans
!!TEXT 
      The following variables take boolean values (either are set
      or aren't).
 
!!SUBTOPICS
appendwrite
cpdebug
debug
dontplot
hitusertp
ignoreeof
noasciiplotvalue
noaskquit
nobjthack
nobreak
nocc
noclobber
noglob
nogridvar
noiter
nojjtp
nomoremode
nonomatch
nopage
noparse
noprintscale
nosort
nosubckt
nousertp
renumber
slowplot
strictnumparse
ticmarks
unixcom
xgmarkers

!!KEYWORD
lists
!!TITLE
Lists
!!TEXT 
      The following variables take on lists as values.  A list is
      surrounded by parentheses, and may contain any variable
      types as elements.
 
 
!!SUBTOPICS
debug
plots
sourcepath

!!KEYWORD
numerics
!!TITLE
Numerics
!!TEXT 
      The following variables take numeric values.  No distinction
      is made at the user level between floating point numbers and
      integers.
 
!!SUBTOPICS
abstol
checkiterate
cptime
fourgridsize
gridsize
height
helpxpos
helpypos
historyvar
jjdphimax
maxwins
nfreqs
numdgt
polydegree
polysteps
rawfileprec
reltol
ticmarks
vntol
width
wpboxh
wpboxw
xglinewidth

!!KEYWORD
options
!!TITLE
Spice Options
!!TEXT 
      The spice options are normally read from spice input in
      the .option lines.  They are in effect when the circuit
      is the current circuit, and are indicated with a "+" in
      the listing provided from the set command with no args.
      These variables can also be set with the set command.
      In this case, they will be ignored if a simulation is
      launched with the run command, however they will be used
      (overriding the variable set in the .option line) if the
      simulation is launched with an analysis command such as
      tran, ac, etc.
      
!!SUBTOPICS
abstol
acct
bypass
chgtol
defad
defas
defl
defw
gmin
itl1
itl2
itl5
list
node
opts
pivrel
pivtol
reltol
tnom
trtol
trytocompact
vntol
set
option

!!KEYWORD
plotvars
!!TITLE
Plot-specific Variables
!!TEXT 
      The following variables are specific to each plot.  When the
      current plot changes, these variables take on new values,
      and they cannot be altered by the user.  In addition to
      these variables, any variables defined in the rawfile on a
      Option: line are associated with the plot and are read-only,
      but variables defined by a Command: set ... line are not.
 
 
!!SUBTOPICS
curplot
curplotdate
curplotname
curplottitle

!!KEYWORD
strings
!!TITLE
Strings
!!TEXT 
      These variables take on strings as values.
 
 
!!SUBTOPICS
color
debug
device
xdisplay
editor
filetype
geometry
gridstyle
hcopydev
hcopydevtype
modelcard
mplotcur
plotstyle
pointchars
program
prompt
rawfile
rhost
rprogram
scedfont
spicepath
subend
subinvoke
substart
term
units
xfont

!!KEYWORD
variables
!!TITLE
Variables
!!TEXT 
      There are many variables that have special meaning to the
      program.  (Note the difference between a variable and a vec-
      tor - a variable is manipulated with the commands set and
      unset, and may be substituted in a command line with the $
      notation.  A vector is a datum which can be plotted, manipu-
      lated algebraicly, and so forth.)
 
      A variable may also be set with the .option line in the
      input file.  A variable set in this manner is not specific
      to the circuit it appears in, however.
 
      While any variable may be set, only the following ones will
      have any significance to nutmeg or the simulator.  In addi-
      tion to those described here, all circuit variables
      described in the Options section of the SPICE3 User's Guide
      may be set in this manner.
 
 
!!SUBTOPICS
booleans
lists
numerics
options
plotvars
strings
!!SEEALSO
set
unset
variablesub

!!KEYWORD
abstol
!!TITLE
abstol variable
!!TEXT 
      internal real variable: abstol
      spice real option: ABSTOL = x

      The absolute tolerance used by the diff command.  As a
      SPICE option, resets the absolute current error toler-
      ance of the program.  The default value is 1 picoamp.
 
!!SEEALSO
diff

!!KEYWORD
acct
!!TITLE
acct variable
!!TEXT
      spice boolean option: acct
 
      When spice is run in batch mode, print out accounting
      information at the end of the run.
 
!!SEEALSO
rusage

!!KEYWORD
appendwrite
!!TITLE
appendwrite variable
!!TEXT 
      internal boolean variable: appendwrite
 
      Append to the file when a write command is issued, if
      the file already exists.
 
!!SEEALSO
write

!!KEYWORD
bypass
!!TITLE
bypass variable
!!TEXT 
      spice boolean option: BYPASS
 
      Bypass computation of unchanging elements.
 

!!KEYWORD
checkiterate
!!TITLE
checkiterate variable
!!TEXT 
      internal integer variable: checkiterate

      This variable controls the depth of the binary search
      performed in the margin analysis.

!!SEEALSO
check

!!KEYWORD
chgtol
!!TITLE
chgtol variable
!!TEXT 
      spice real option: CHGTOL = x
 
      Resets  the  charge  tolerance  of  the  program.   The
      default value is 1.0E-14.

!!KEYWORD
color
!!TITLE
colorN variable
!!TEXT 
      internal string variable: colorN  (N integer)

      If a variable with the name colorN is set to the
      name of a color recognised by X (see the file
      /usr/lib/rgb.txt for a list of such colors), the
      N'th value plotted in a window will have this
      color.  color0 denotes the background color and color1
      denotes the grid and text color.
 
!!SEEALSO
X
plot
graf
mplot

!!KEYWORD
cpdebug
!!TITLE
cpdebug variable
!!TEXT 
      internal boolean variable: cpdebug

      Turn on debugging in the C-shell parser.
 

!!KEYWORD
cptime
!!TITLE
cptime variable
!!TEXT 
      internal real variable: cptime

      The total amount of CPU time to allow for a simulation.
      (Not implemented)
 

!!KEYWORD
curplot
!!TITLE
curplot variable
!!TEXT 
      internal string variable: curplot

      The name of the currently active plot.
 
!!SEEALSO
plots
setplot

!!KEYWORD
curplotdate
!!TITLE
curplotdate variable
!!TEXT 
      internal string variable: curplotdate (read only)

      The date associated with the currently active plot.
      This is generally the date of the simulation.
 

!!KEYWORD
curplotname
!!TITLE
curplotname variable
!!TEXT 
      internal string variable: curplotname (read only)

      The type name of the currently active plot.  Note that
      this is not the name used by setplot, but rather an
      English description of the type of simulation done.
 

!!KEYWORD
curplottitle
!!TITLE
curplottitle variable
!!TEXT 
      internal string variable: curplottitle (read only)

      The title of the circuit associated with the currently
      active plot.
 
 

!!KEYWORD
debug
!!TITLE
debug variable
!!TEXT 
      internal variable: debug

      This variable may be a boolean, in which case all
      debugging is turned on, a string, in which case the
      string specifies which part of the program for which to
      turn on debugging, or a list of these strings, which
      turns on any combination of debuggings.  The possible
      values are:
 
         siminterface   The interface to the simulator.
         cshpar         The C-shell pre-processor and parser.
         parser         The parser for expressions.
         eval           The expression evaluation routines.
         vecdb          The vector database.
         graf           The plotting routines.
         ginterface     Graphics package interface routines.
         control        The control structure code.
         async          The aspice and rspice code.
 

!!KEYWORD
defad
!!TITLE
defad variable
!!TEXT 
      spice real option: DEFAD = x
 
      Resets the value for  MOS  drain  diffusion  area;  the
      default is 0.0.
 
!!SEEALSO
m

!!KEYWORD
defas
!!TITLE
defas variable
!!TEXT 
      spice real option: DEFAS = x
 
      Resets the value for MOS  source  diffusion  area;  the
      default is 0.0.
 
!!SEEALSO
m

!!KEYWORD
defl
!!TITLE
defl variable
!!TEXT 
      spice real option: DEFL = x
 
      Resets the value for MOS channel length; the default is
      100.0 micrometer.
 
!!SEEALSO
m

!!KEYWORD
defw
!!TITLE
defw variable
!!TEXT 
      spice real option: DEFW = x
 
      Resets the value for MOS channel width; the default  is
      100.0 micrometer.
 
!!SEEALSO
m

!!KEYWORD
device
!!TITLE
device variable
!!TEXT 
      internal string variable: device

      (recognized in the initialization file only)

      The path name of the graphics device for MFB to use for
      plotting.
 
 
!!SEEALSO
plot

!!KEYWORD
dontplot
!!TITLE
dontplot variable
!!TEXT 
      internal boolean variable: dontplot

      When a plot command is given, don't actually do any
      graphics operations.  This is useful for debugging plot
      routines with a MFB device.
 
!!SEEALSO
plot

!!KEYWORD
editor
!!TITLE
editor variable
!!TEXT 
      internal string variable: editor
 
      The name for the editor to use for the edit command.
      The default is vi, except under X when the internal
      xeditor is the default.
 
!!SEEALSO
edit

!!KEYWORD
filetype
!!TITLE
filetype variable
!!TEXT 
      internal string variable: filetype

      The type of rawfile that the write command should
      create.  Currently the only types supported are ascii
      and binary.
 
!!SEEALSO
write

!!KEYWORD
fourgridsize
!!TITLE
fourgridsize variable
!!TEXT 
      internal integer variable: fourgridsize

      When a fourier command is given, the data is first
      interpolated onto a linear grid.  The size of the grid
      is given by this variable.  The default is 200.
 
!!SEEALSO
fourier

!!KEYWORD
geometry
!!TITLE
geometry variable
!!TEXT 
      internal string variable: geometry

      The X geometry specification to use for creating win-
      dows.  This is of the form
      =heightxwidth+xoffset+yoffset.  Note that the = must be
      included in the string.  Also, variables of the form
      geometrynumber may be set, which determine the geometry
      to use for the numberth window created.
 
!!SEEALSO
X
plot

!!KEYWORD
gmin
!!TITLE
gmin variable
!!TEXT 
      spice real option: GMIN = x

      Resets the  value  of  GMIN,  the  minimum  conductance
      allowed by the program.  The default value is 1.0E-12.
 

!!KEYWORD
gridsize
!!TITLE
gridsize variable
!!TEXT 
      internal integer variable: gridsize

      If this variable is set, it causes all data plotted to
      be interpolated onto a grid of this size.  The degree
      of the interpolation is given by the variable polyde-
      gree.
 
!!SEEALSO
plot
polydegree

!!KEYWORD
gridstyle
!!TITLE
gridstyle variable
!!TEXT
      internal string variable: gridstyle

      This variable is used to determine the style of grid
      used by the commands plot, hardcopy, and asciiplot, if
      no grid style keywords are given on the command line.
      Possible values are:

        lingrid   Use a linear grid
        loglog    Use a log scales for both axes
        xlog      Use a log scale for the X axis
        ylog      Use a log scale for the Y axis
        nogrid    Don't draw any grid
                  (but draw the data on a linear scale)
 
!!SEEALSO
plot

!!KEYWORD
hcopydev
!!TITLE
hcopydev variable
!!TEXT 
      internal string variable: hcopydev

      If this variable is set to the name of a printer (the
      name used in the -P option to lpr), it directs the
      hardcopy command to immediately send the raster file to
      this printer.  This works only on UNIX.

      Under DOS, this variable can take the name of the device
      or file for output, the default is "prn".
 
!!SEEALSO
hardcopy

!!KEYWORD
hcopydevtype
!!TITLE
hcopydevtype variable
!!TEXT
      internal string variable: hcopydevtype

      This variable can be set to one of the following:

        plot5       UNIX plot(5) format (UNIX default)
        postscript  Adobe PostScript
        laser       Hewlett-Packard PCL (DOS default)
        wp          WordPerfect graphics
T$XT:
      In these cases, the file produced by the hardcopy
      command, and from the hardcopy buttons in the plot
      windows, and from the sced editor will be in the
      indicated formats.

!!SEEALSO
wpboxh
wpboxw

!!KEYWORD
height
!!TITLE
height variable
!!TEXT 
      internal integer variable: height

      The height of a page to use when printing the output of
      asciiplot or print col.  The default is 60.
 
!!SEEALSO
asciiplot
print

!!KEYWORD
helpxpos
!!TITLE
helpxpos variable
!!TEXT
      internal integer variable: helpxpos

      The starting X-position of the top-level help window.
      The default is with the upper left corner at (100,100).
 
!!SEEALSO
help
helpypos

!!KEYWORD
helpypos
!!TITLE
helpypos variable
!!TEXT
      internal integer variable: helpxpos

      The starting Y-position of the top-level help window.
      The default is with the upper left corner at (100,100).
 
!!SEEALSO
help
helpxpos

!!KEYWORD
historyvar
!!TITLE
history variable
!!TEXT 
      internal integer variable: history

      The number of events to save on the history list.  The
      default is 1000.
 
!!SEEALSO
historycomm
historysub

!!KEYWORD
hitusertp 
!!TITLE
hitusertp variable
!!TEXT
      internal boolean variable: hitusertp

      If this option is set, then during transient analysis the
      time step will be cut so as to land on the user time points.
      This requires more simulation time, but provides the greatest
      accuracy.  If unset, the outputs are interpolated, with degree
      1 (default) to 3, set by the polydegree variable.

!!SEEALSO
nousertp
polydegree

!!KEYWORD
ignoreeof
!!TITLE
ignoreeof variable
!!TEXT 
      internal boolean variable: ignoreeof
 
      Don't exit the program when an EOF (control-D) is typed
      at the beginning of a line.
 

!!KEYWORD
itl1
!!TITLE
itl1 variable
!!TEXT 
      spice integer option: ITL1 = x
 
      Resets the dc iteration limit.  The default is 100.
 
!!SEEALSO
dc_analysis

!!KEYWORD
itl2
!!TITLE
itl2 variable
!!TEXT 
      spice integer option: ITL2 = x
 
      Resets the dc transfer curve iteration limit.  The
      default is 50.
 
!!SEEALSO
dc_analysis

!!KEYWORD
itl5
!!TITLE
itl5 variable
!!TEXT 
      spice integer option: ITL5 = x
 
      Resets the transient analysis total iteration  limit.
      The default is 5000.  Set ITL5=0 to omit this test.
      This option is ignored.
 
!!SEEALSO
tran_analysis

!!KEYWORD
list
!!TITLE
list variable
!!TEXT 
      spice boolean option: list
 
      When spice is run in batch mode, list the circuit
      before running the simulation.  This may be set with
      .option list in the input file.
 
!!SEEALSO
listing

!!KEYWORD
jjdphimax 
!!TITLE
jjdphimax variable
!!TEXT 
      internal real variable: jjdphimax

      This variable sets the maximum time step in transient
      analysis when Josephson junctions are present.  The value
      specified is the maximum phase change in radians between
      internal timepoints, and is in the range PI/50 - PI/2.  The 
      default is PI/5 (.628).
 
!!SEEALSO
b
tran_analysis
 
!!KEYWORD
maxwins
!!TITLE
maxwins variable
!!TEXT 
      internal integer variable: maxwins
 
      The maximum number of X windows to create.  If this
      many windows are already on the screen and another is
      requested, the oldest one is re-used.
 
!!SEEALSO
X
plot

!!KEYWORD
modelcard
!!TITLE
modelcard variable
!!TEXT 
      internal string variable: modelcard
 
      The name of the line used to introduce a model, gen-
      erally .model.
 

!!KEYWORD
mplotcur
!!TITLE
mplot_cur variable
!!TEXT 
      internal string variable: mplot_cur
 
      This variable is set to the name of the output file for
      operating range analysis.
 
!!SEEALSO
check

!!KEYWORD
nfreqs
!!TITLE
nfreqs variable
!!TEXT 
      internal integer variable: nfreqs
 
      How many multiples of the fundamental frequency to
      print in the fourier command.  The default is 10.
 
!!SEEALSO
fourier

!!KEYWORD
noasciiplotvalue
!!TITLE
noasciiplotvalue variable
!!TEXT 
      internal boolean variable: noasciiplotvalue
 
      Don't print the value of the first variable plotted
      with asciiplot on the left side of the graph.
 
!!SEEALSO
asciiplot

!!KEYWORD
noaskquit
!!TITLE
noaskquit variable
!!TEXT 
      internal boolean variable: noaskquit
 
      Don't ask the user if he really wants to quit when he
      has simulations in progress or unsaved data.
 
 
!!SEEALSO
quit

!!KEYWORD
nobjthack
!!TITLE
nobjthack variable
!!TEXT 
      internal boolean variable: nobjthack
 
      Don't allow BJT's with only 3 nodes.  (This only
      affects subcircuit expansion.)
 

!!KEYWORD
nobreak
!!TITLE
nobreak variable
!!TEXT 
      internal boolean variable: nobreak
 
      Don't add page breaks when doing an asciiplot or a
      print col.
 
!!SEEALSO
asciiplot
print

!!KEYWORD
nocc 
!!TITLE
nocc variable
!!TEXT 
      internal boolean variable: nocc
 
      This variable disables command completion when set.
 
!!SEEALSO
ccom
 
!!KEYWORD
noclobber
!!TITLE
noclobber variable
!!TEXT 
      internal boolean variable: noclobber
 
      When output is redirected with >, etc, don't overwrite
      an existing file.
 
!!SEEALSO
io

!!KEYWORD
node
!!TITLE
node variable
!!TEXT 
      spice boolean option: node
 
      Causes the node table to be printed when spice is run
      in batch mode.  This is currently unimplemented.
 

!!KEYWORD
noglob
!!TITLE
noglob variable
!!TEXT 
      internal boolean variable: noglob
 
      Don't expand the characters *, ?, [, and ] in an input
      line to match filenames.  This is generally a good idea
      if you want to use * for arithmetic expressions.
 
!!SEEALSO
glob

!!KEYWORD
nogridvar
!!TITLE
nogrid variable
!!TEXT 
      internal boolean variable: nogrid
 
      Don't display a grid when plotting data in the plot
      or asciiplot commands.
 
!!SEEALSO
plot

!!KEYWORD
noiter 
!!TITLE
noiter variable
!!TEXT 
      internal boolean variable: niiter
 
      (No longer supported.)
      During transient analysis, at each new time step, Newton
      iterations are used to solve the nonlinear circuit
      equations.  The first iteration, the prediction step,
      uses extrapolation from past values to obtain a best guess
      at the solution for use as input.  Additional iterations
      use the previous output values as input.

      In cases where the nonlinearity is weak, or where the
      internal time step is forced to be small (as when Josephson
      junctions are present) iterations beyond the predictor
      sometimes lead to unneeded accuracy.  Setting the variable
      noiter causes skipping of iterations beyond the prediction
      step, and also skipping of certain other code.  This 
      maximizes the simulation rate, but can lead to errors if
      not used carefully.  Much the same effect can be obtained
      by setting reltol to a large value, however noiter is
      more efficient as convergence testing and matrix loading
      are skipped, as there is a-priori knowledge that no
      iterations are to take place.  The iteration count and
      total internal timepoint count are available from the
      rusage command.

!!SEEALSO
rusage

!!KEYWORD
nojjtp 
!!TITLE
nojjtp variable
!!TEXT 
      internal boolean variable: nojjtp
 
      During transient analysis with Josephson junctions present,
      the default time step is given by t = 3.3e-16/vmax, where
      vmax = max(Vj, sqrt(3.3e-16*Jc/C)).  If the variable nojjtp
      is set, the timestep is determined from a truncation error
      calculation, as is the case when Josephson junctions are not
      present in the circuit.  The user should experiment to
      determine which timestep leads to faster execution.
 

!!KEYWORD
nomoremode
!!TITLE
nomoremode variable
!!TEXT
      internal boolean variable: nomoremode
 
      When more output is generated by a single command than
      will fit on the screen, pause and wait for the user to
      type a carriage return.  The following commands are
      also recognised:
 
         q   Discard the rest of the output.
         c   Print the rest of the output without pausing.
         ?   Print a help message.
 
      Note that setting this variable will turn off more
      mode, and all output will be printed without any
      pauses.
 

!!KEYWORD
nonomatch
!!TITLE
nonomatch variable
!!TEXT 
      internal boolean variable: nonomatch
 
      Don't complain when a glob expression (one containing
      *, ?, [, or ]) doesn't match anything.  The unexpanded
      expression is left unchanged.
 
!!SEEALSO
glob

!!KEYWORD
nopage
!!TITLE
nopage variable
!!TEXT 
      internal boolean variable: nopage
 
      This is the same as the nobreak option.
 
!!SEEALSO
nobreak

!!KEYWORD
noparse
!!TITLE
noparse variable
!!TEXT 
      internal boolean variable: noparse
 
      Don't parse a circuit when loading it.  The circuit
      cannot be simulated if it isn't parsed.
 
!!SEEALSO
source

!!KEYWORD
noprintscale
!!TITLE
noprintscale variable
!!TEXT 
      internal boolean variable: noprintscale
 
      When doing a print col, don't print the scale in the
      leftmost column of each page.
 
!!SEEALSO
print

!!KEYWORD
nosort
!!TITLE
nosort variable
!!TEXT 
      internal boolean variable: nosort
 
      Don't sort alphabetically when doing a display command.
 
!!SEEALSO
display

!!KEYWORD
nosubckt
!!TITLE
nosubckt variable
!!TEXT 
      internal boolean variable: nosubckt
 
      Don't expand subcircuits.  A circuit with subcircuits
      cannot be parsed if this is set.
 

!!KEYWORD
nousertp 
!!TITLE
nousertp variable
!!TEXT 
      internal boolean variable: nousertp
 
      During transient analysis, JSPICE3 saves data at user
      specified timepoints, unlike other versions of spice
      which save internal timepoint data.  Setting nousertp
      will cause internal timepoint data to be saved, either
      in internal data structures in interactive mode or in the
      rawfile in batch mode.  The amount of data can grow quite
      large.
 
!!SEEALSO
tran_analyses

!!KEYWORD
numdgt
!!TITLE
numdgt variable
!!TEXT 
      internal integer variable: numdgt
 
      How many significant digits to print for fourier, print
      col, etc output.  The default is 6.
 
!!SEEALSO
print
fourier

!!KEYWORD
opts
!!TITLE
opts variable
!!TEXT 
      spice boolean option: node

      When spice is run in batch mode, print out all the
      variables set and their values.
 
!!SEEALSO
set
variables
batchmode

!!KEYWORD
pivrel
!!TITLE
pivrel variable
!!TEXT 
      spice real option: PIVREL = x
 
      Resets the relative ratio between  the  largest  column
      entry  and an acceptable pivot value. The default value
      is 1.0E-3.  In the  numerical  pivoting  algorithm  the
      allowed   minimum   pivot   value   is   determined  by
      EPSREL=AMAX1(PIVREL*MAXVAL,PIVTOL) where MAXVAL is  the
      maximum  element  in the column where a pivot is sought
      (partial pivoting).
 

!!KEYWORD
pivtol
!!TITLE
pivtol variable
!!TEXT 
      spice real option: PIVTOL = x
 
      Resets the absolute minimum value for a matrix entry to
      be accepted as a pivot.  The default value is 1.0E-13.
 

!!KEYWORD
plots
!!TITLE
plots variable
!!TEXT 
      internal list variable: plots (read only)
 
      This variable is read-only, and contains the names of
      the plots available.  The variable curplot may be set
      to any of these, or the word new, in which case it
      creates a new, empty plot.
 
!!SEEALSO
curplot

!!KEYWORD
plotstyle
!!TITLE
plotstyle variable
!!TEXT 
      internal string variable: plotstyle
 
      This variable is used to determine the plot style if no
      plotstyle keyword is given on the command line for the
      commands plot, hardcopy, and asciiplot.  Its value may
      be one of:
 
        linplot     Connect points with line segments
        combplot    Connect each point to the X-axis
        pointplot   Plot each point as a discrete character
 
!!SEEALSO
plot

!!KEYWORD
pointchars
!!TITLE
pointchars variable
!!TEXT 
      internal string variable: pointchars
 
      The characters in this string are used to plot suces-
      sive data values if the pointplot keyword is given in a
      plot command.  The default is
      "oxabcdefhgijklmnpqrstuvwyz".
 
!!SEEALSO
plot

!!KEYWORD
polydegree
!!TITLE
polydegree variable
!!TEXT 
      internal integer variable: polydegree
 
      This variable determines the degree of the polynomial
      that is fit to points when a plot is done.  If it is
      not set or set to 1, then the points are connected by
      lines.  If it is greater than 1, then a polynomial
      curve is fit to the points.  If the value of polydegree
      is n, then for each n + 1 adjacent points, a nth degree
      curve is fit.  If this is not possible (due to the fact
      that the points aren't monotonic), the curve is rotated
      90 degrees and another attempt is made.  If is is still
      unsucessful, n is decreased by 1 and the process is
      repeated.  Thus four points in the shape of a diamond
      may be fit with quadratics to approximate a circle.
      (Although it's not clear that this situation comes up
      often in circuit simulation.)  The variable gridsize
      determines the size of the grid on which the curve is
      fit (if the data is monotonic).
 
      In addition, during transient analysis, this variable
      sets the degree of interpolation used to map the internal
      time points to the user time points.  The defalut is 1,
      a simple linear interpolation.  The maximum is 3.
 
!!SEEALSO
plot
nousertp
hitusertp

!!KEYWORD
polysteps
!!TITLE
polysteps variable
!!TEXT 
      internal integer variable: polysteps
 
      The number of intermediate points to plot between each
      actual point used for interpolation.  The default is
      10.  Note that if interpolation is used for plotting,
      the ticmarks feature is disabled.
 
!!SEEALSO
plot

!!KEYWORD
program
!!TITLE
program variable
!!TEXT 
      internal string variable: program
 
      The full path name of the current program.
 

!!KEYWORD
prompt
!!TITLE
prompt variable
!!TEXT 
      internal string variable: prompt
 
      The prompt that the command interpreter should use.  In
      this string, the character `!' is replaced by the
      current command number, and '-p' is replaced with the
      current working directory path.  If the program is reading
      lines which form a part of a control block, the prompt
      becomes a set of `>' characters, one for each level of
      control structure.  The default prompt is "$program !
      -> ".
 

!!KEYWORD
rawfile
!!TITLE
rawfile variable
!!TEXT 
      internal string variable: rawfile
 
      The name of the rawfile to use as a default for the
      write command, or for batch mode.
 
!!SEEALSO
write
load

!!KEYWORD
rawfileprec
!!TITLE
rawfileprec variable
!!TEXT 
      internal integer variable: rawfileprec
 
      The number of digits to use in the ascii rawfile for-
      mat.  The default is 15, which should be enough.
 
!!SEEALSO
write

!!KEYWORD
reltol
!!TITLE
reltol variable
!!TEXT 
      internal real variable: reltol
      spice real option: RELTOL = x
 
      The relative tolerance used by the diff command.  As a
      SPICE option, resets the relative error tolerance of the
      program.  The default value is 0.001 (0.1 percent).
 
!!SEEALSO
diff
reltol

!!KEYWORD
renumber
!!TITLE
renumber variable
!!TEXT 
      internal boolean variable: renumber
 
      After expanding subcircuits, renumber all the lines
      sequentially.
 
!!SEEALSO
listing

!!KEYWORD
rhost
!!TITLE
rhost variable
!!TEXT 
      internal string variable: rhost
 
      The name of the machine to run remote simulations on.
      This machine must have a spice daemon running.
 
!!SEEALSO
rspice

!!KEYWORD
rprogram
!!TITLE
rprogram variable
!!TEXT 
      internal string variable: rprogram
 
      The name of the program to run when an rspice command
      is given.
 
 
!!SEEALSO
rspice

!!KEYWORD
scedfont
!!TITLE
scedfont variable
!!TEXT 
      internal string variable: scedfont
 
      Name of the X font used in SCED schematic editor.
 

!!KEYWORD
slowplot
!!TITLE
slowplot variable
!!TEXT 
      internal boolean variable: slowplot
 
      Pause after plotting each value and wait for the user
      to type a carriage return.
 
!!SEEALSO
plot

!!KEYWORD
sourcepath
!!TITLE
sourcepath variable
!!TEXT 
      internal list variable: sourcepath
 
      The set of directories that will be searched when a
      source command or a command that may be the invocation
      of a script is given.
 
!!SEEALSO
source

!!KEYWORD
spicepath
!!TITLE
spicepath variable
!!TEXT 
      internal string variable: spicepath
 
      The filename to execute when an aspice command is
      given.
 
!!SEEALSO
aspice

!!KEYWORD
strictnumparse
!!TITLE
strictnumparse variable
!!TEXT 
      internal boolean variable: strictnumparse
 
      Don't allow trailing characters after a number, unless
      they are seperated from the number with an underscore
      (`_').  This may prevent some errors like writing
      1meter and expecting it to have a value of 1.
 
!!SEEALSO
expressions

!!KEYWORD
subend
!!TITLE
subend variable
!!TEXT 
      internal string variable: subend
 
      The name of the subcircuit-ending line, generally
      .ends.
 

!!KEYWORD
subinvoke
!!TITLE
subinvoke variable
!!TEXT 
      internal string variable: subinvoke
 
      The prefix used to call up an instance of a subcircuit,
      generally "x".
 

!!KEYWORD
substart
!!TITLE
substart variable
!!TEXT 
      internal string variable: substart
 
      The name of the line used to start a subcircuit defini-
      tion, generally ".subckt".
 

!!KEYWORD
term
!!TITLE
term variable
!!TEXT 
      internal string variable: term
 
      (recognized in the initialization file only)

      The name of the terminal type for MFB.  Note that these
      names are often not the same as the ones that termcap
      recognises, so the value of the environment variable
      TERM may not work (but it will be used if this variable
      is not set).  See the beginning of the file
      "spice3/lib/mfbcap" for descriptions of the terminals
      supported.
 
      Under extended DOS, the term variable (or the TERM
      environment variable if term is not set) can be used to
      specify alternate VGA graphics modes.  These modes are:

      vga0 640  X 350 16 colors     vga1 640  X 480 16 colors
      vga2 320  X 200 256 colors    vga3 800  X 600 16 colors
      vga4 1024 X 768 16 colors     vga5 640  X 480 256 colors
      vga6 800  X 600 256 colors    vga7 1024 X 768 256 colors

      The default mode is 640 X 480 16 colors (vga1).  High
      resolution modes require a Tseng Labs compatible VGA card
      and multisync monitor.
 
!!SEEALSO
dasht
plot
graf
sced
mplot

!!KEYWORD
ticmarks
!!TITLE
ticmarks variable
!!TEXT 
      internal integer or boolean variable: ticmarks
 
      Print an 'x' every ten points for each curve plotted.
      This variable may also be set to a number, which is the
      number of points between each tic mark.
 
!!SEEALSO
plot

!!KEYWORD
tnom
!!TITLE
tnom variable
!!TEXT 
      spice real option: TNOM = x
 
      Resets the nominal temperature.  The default  value  is
      27 deg C (300 deg K).
 
 

!!KEYWORD
trtol
!!TITLE
trtol variable
!!TEXT 
      spice real option: TRTOL = x
 
      Resets the  transient  error  tolerance.   The  default
      value  is  7.0.   This  parameter is an estimate of the
      factor by which SPICE overestimates the actual  trunca-
      tion error.
 

!!KEYWORD
trytocompact
!!TITLE
trytocompact variable
!!TEXT 
      spice boolean option: TRYTOCOMPACT    
 
      Applicable only to the LTRA model. When specified, the
      simulator tries to condense LTRA transmission
      lines' past history of input voltages and currents.
     
!!SEEALSO
models
ltra
o

!!KEYWORD
units
!!TITLE
units variable
!!TEXT 
      internal string variable: units
 
      If this variable is set to degrees, all trig functions
      will use degrees instead of radians for the units of
      their arguments.
 
!!SEEALSO
sin
cos
tan

!!KEYWORD
unixcom
!!TITLE
unixcom variable
!!TEXT 
      internal boolean variable: unixcom
 
      If a command is given which is not a built-in command,
      try to execute it as a UNIX command.  Setting this
      option increases the start-up time of the program a
      great deal, since all commands in the user's path are
      added to the command completion data structures, which
      are rather slow to update.
 
!!SEEALSO
unixcomcomm

!!KEYWORD
vntol
!!TITLE
vntol variable
!!TEXT 
      internal real variable: vntol
      spice real option: VNTOL = x
 
      The absolute voltage tolerance used for the diff com-
      mand.  As a SPICE option, resets the absolute voltage
      error tolerance of the program.  The default value is
      1 microvolt.
 
!!SEEALSO
diff
vntol

!!KEYWORD
width
!!TITLE
width variable
!!TEXT 
      internal integer variable: width
 
      The width of a page to use when printing the output of
      asciiplot or print col.  The default is 130.
 
!!SEEALSO
print
asciiplot

!!KEYWORD
wpboxh
!!TITLE
wpboxh variable
!!TEXT 
      internal real variable: wpboxh
 
      The height of the graphics box in inches produced by the
      WordPerfect graphics driver.

!!SEEALSO
hardcopy

!!KEYWORD
wpboxw
!!TITLE
wpboxw variable
!!TEXT 
      internal real variable: wpboxw
 
      The width of the graphics box in inches produced by the
      WordPerfect graphics driver.

!!SEEALSO
hardcopy

!!KEYWORD
xdisplay
!!TITLE
display variable
!!TEXT 
      internal string variable: display
 
      The display name for X used for plotting, generally
      of the form host:number (read only).
 
!!SEEALSO
X
plot
dashd

!!KEYWORD
xglinewidth
!!TITLE
xglinewidth variable
!!TEXT 
      internal integer variable: xglinewidth
 
      Pixel linewidth to use in xgraph plots.

!!SEEALSO
xgraph

!!KEYWORD
xgmarkers
!!TITLE
xgmarkers variable
!!TEXT 
      internal boolean variable: xgmarkers
 
      If set, use markers in xgraph plots, otherwise use
      big pixels.

!!SEEALSO
xgraph

!!KEYWORD
xfont
!!TITLE
xfont variable
!!TEXT 
      internal string variable: xfont
 
      The name of the font to use in an X window.  This may
      be a proportional font.
 
!!SEEALSO
X
plot


*****************************************************************
*
* Commands
*
*****************************************************************

!!KEYWORD
commands
!!TITLE
Built-in Commands
!!TEXT 
      When a command is typed, it is interpreted as one of several
      things.  First, it may be an alias, in which case the line
      is replaced with the result after alias substitution, and
      the line is re-parsed.  Second, it may be a pre-defined com-
      mand, in which case it is executed (see below for a list of
      available commands).  Third, it may be the name of a circuit
      file, in which case it is loaded (if the program is spice)
      as if with a source command.  Fourth, it may be the name of
      a command script - nutmeg searches the current sourcepath
      for the file and executes it when it is found.  The effect
      of this is identical to the effect of souce file, except
      that the variables argc and argv are set.  Fifth, it may be
      an assignment statement, which consists of a vector name, an
      = symbol, and an expression (see the syntax for the let com-
      mand), in which case it is executed as if it were preceeded
      by the word let.  Finally, it may be a UNIX command, in
      which case if the variable unixcom is set, it is executed as
      though it were typed to the shell.
 
      The following is a list of the built-in commands available.
      Some may be command scripts - the only difference between a
      built-in and a script that is visible to the user is that a
      script will not be mentioned in the quick help summary, and
      will not be visible to command completion.
 
!!SUBTOPICS
ac
alias
alter
asciiplot
aspice
begin
break
bug
cd
cdump
check
codeblock
compose
continue
cross
dc
define
deftype
delete
destroy
diff
display
disto
dowhile
dump
echo
edit
else
end
foreach
fourier
free
goto
graf
hardcopy
help
historycomm
if
iplot
jobs
label
let
linearize
listing
load
loop
mplot
noise
oldhelp
op
plot
print
pz
quit
rehash
repeat
reset
resume
rspice
run
rusage
save
sced
sens
set
setcirc
setplot
setrdb
settype
shell
shift
show
source
state
status
step
stop
strcmp
tf
trace
tran
unalias
undefine
unlet
unset
usrset
version
while
write
xeditor
xgraph
proglang

!!KEYWORD
ac
!!TITLE
ac command
!!TEXT 
      command: ac {dec oct lin} pts fstart fstop
 
      Do an ac analysis of the current circuit.
      Only available in spice.
 
!!SEEALSO
ac_analysis

!!KEYWORD
alias
!!TITLE
alias command
!!TEXT 
      command: alias [ word ] [ text ]

      Cause word to be aliased to text.  Whenever a command
      line beginning with word is typed, text is substituted.
      Arguments are either appended to the end, or substi-
      tuted in if history characters are present in the text.
      See the description of "C-shell like features".
 
!!SEEALSO
unalias
aliases

!!KEYWORD
alter
!!TITLE
alter command
!!TEXT 
      command: alter devicelist : parmname value ...

      Change the device(s) parameter(s).  This command in its
      present form can be issued before a simulation is started,
      after the circuit has been loaded.  It can be used to
      alter device and model parameters.  The syntax is similar
      to that of the show command, however the parameter list
      contains (name value) pairs.  The parameter names are
      expected to be recognized for each device in the list.

      Example:

           alter r* : resistance 50

      changes all resistors in the circuit to 50 ohms.

      Currently, this command has no (or undefined) effect if
      a run is currently in progress.
 
!!SEEALSO
show

!!KEYWORD
asciiplot
!!TITLE
asciiplot command
!!TEXT 
      command: asciiplot plotargs

      Produce a line printer plot of the vectors.  See the
      description of the plot command for the syntax of plo-
      targs.  The plot is sent to the standard output, so you
      can put it into a file with asciiplot args > file.  The
      variables width, height, and nobreak determine the
      width and height of the plot, and whether there are
      page breaks, respectively. Note that you will have
      problems if you try to asciiplot something with an X-
      scale that isn't monotonic (i.e, something like
      sin(TIME) ), because asciiplot uses a simple-minded
      sort of linear interpolation.  Also, most of the key-
      words that plot recognises aren't used by asciiplot.
 
!!SEEALSO
plot
hardcopy
width
height
noasciiplotvalue
nobreak
expressions

!!KEYWORD
aspice
!!TITLE
aspice command
!!TEXT 
      command: aspice infile [ outfile ]
 
      Run SPICE3 asynchronously with infile as an input cir-
      cuit.  If outfile is given, the output is saved in this
      file.  After this command is issued, the job is started
      in the background, and you may continue using the
      invoking program interactively.  When the job is fin-
      ished, the rawfile is loaded and becomes the current
      plot, and the output generated is printed.  You may
      specify the pathname of the program to be run with the
      spicepath variable.
 
!!SEEALSO
jobs
rspice

!!KEYWORD
begin
!!TITLE
begin command
!!TEXT 
      command: begin

      Internally aliased to "if (1)".


!!KEYWORD
break
!!TITLE
break command
!!TEXT 
      command: break [ number ]

      If there is a while, dowhile, or foreach block enclos-
      ing this statement, control passes out of the block.
      Otherwise an error results.  If a number is given, that
      number of enclosing blocks are exited.
 
!!SEEALSO
proglang

!!KEYWORD
bug
!!TITLE
bug command
!!TEXT 
      command: bug
 
      This sends a bug report to the maintainer of SPICE3, if
      it has been compiled with the BUGADDR option.
 

!!KEYWORD
cd
!!TITLE
cd command
!!TEXT 
      command: cd [ directory ]

      Change the current working directory to directory, or
      the user's home directory (\ in DOS) if none is given.
 

!!KEYWORD
cdump
!!TITLE
cdump command
!!TEXT 
      command: cdump
 
      This is a debugging command for printing out the con-
      tents of the currently active control structures.
 
!!SEEALSO
proglang

!!KEYWORD
check
!!TITLE
check command
!!TEXT 
      command: check [ -v ] [ analysis spec ]

      This command initiates operating range analysis of the
      current circuit.
      If -v is given, results are printed on-screen as the
      analysis is performed, otherwise the analysis is silent.
      The analysis to be performed is given, otherwise it is
      found in the circuit deck.  The current circuit must be
      from a margin analysis file, or have a bound codeblock.

      There are a number ov vectors with names that are hard-
      coded which control operating range analysis.  In addition,
      there are relevant shell variables.  The vectors (which
      are assigned to the "constants" plot) are as follows:

      checkPNTS (real, length > 1)

        These are the points of the scale variable (e.g., time
        in transient analysis) at which the pass/fail test is
        applied.  If a fail is encountered, the simulation is
        stopped and the next trial started.

      checkVAL1 (real, length 1)

        This is the initial central value of the first parameter
        to be varied during analysis.

      checkDEL1 (real, length 1)

        The first central value will be incremented or decremented
        by this value between trials.

      checkSTP1 (integer, length 1)

        This is the number of trials above and below the central
        value.

      checkVAL2
      checkDEL2
      checkSTP2

        These are as above, but relate to the second parameter to
        be varied in the circuit.

      checkFAIL  (integer, length 1, 0 or 1)

        This is the global pass/fail flag, which is set after each
        trial, 1 indicates failure.

      ophi, oplo (real, length = 1)

        The analysis can be directed to find the operating range
        extrema of the first parameter.  These vectors contain
        the values found.

      value (real, length variable)

        This vector can be used to pass trial values to the circuit,
        otherwise shell variables are used.

      checkN1, checkN2 (integer, length 1)

        These are the indices into the value array of the two
        parameters being varied.  The other entries are fixed.
        These vectors are not used if shell variables pass the
        trial values to the circuit.


      The shell variables are:

      checkiterate (0-10)

        This is the binary search depth used in finding operating
        range extrema.  This is not used if a fixed search area
        is used.

      value1, value2

        These variables are set to the current trial values to
        be used in the circuit (parameters 1 and 2).  The spice
        deck should reference these variables (as $value1 and
        $value2) as the parameters to vary.  Alternatively, the
        value array can be used for this purpose.


      The checkVAL1, checkDEL1, etc. vectors must be defined
      and properly initialized, either in the deck or directly
      from the shell.

      One can keep track of the progress of the analysis in two
      ways.  Spice will print the analysis point on the screen,
      plus indicate whether the circuit failed or passed at the
      point, if the -v option is given.  Echo commands can be
      used in the codeblock to provide more information on
      screen, and are printed whether or not -v is given.  The
      second method uses the mplot command, which graphically
      records the pass/fail points.

      The operating range analysis sets the shell variables
      value1 and value2 to the variables being varied.  In
      addition, vector variables can be set.  This is needed for
      scripts such as optimization where the parameter to be
      varied is required to be under program control.

      If a vector called "value" is defined, and a vector called
      checkN1 is defined, and checkN1 > 0 and checkN1 < the length
      of value, then value[checkN1] is set to value1.

      If a vector called "value" is defined, and a vector called
      checkN2 is defined, and checkN2 > 0 and checkN2 < the length
      of value, then value[checkN2] is set to value2.

      Thus, instead of invoking $value1 and $value2 in the spice
      text, one can instead invoke $&value[$&checkN1],
      $&value[$&checkN2], where we have previously defined the
      vectors value, checkN1, checkN2.

      Alternatively, the file could have a number of parameters
      set to $&value[0], $&value[1], ... .  If checkN1 is set to 2,
      for example, $&value[2] would be varied.  The other values
      would be fixed at predefined entries.
       
      During operating range analysis, a file named xxxxxxxx.Dnn is
      created in the current directory, where xxxxxxxx is the base
      name of the input file, and nn is 00-99, set automatically to
      avoid clobbering existing files.  If for some reason the input
      file name is unknown, the file "check.dat" will be produced.
      This file should be renamed before another operating range
      analysis is performed, otherwise it may be overwritten.

      The range is constructed by row, where rows represent
      different values for value1.  A second pass fills in concave
      contours in column order, thus the same pattern should be
      obtained independent of the ordering of parameters.  Really
      weird patterns, such as islands or reenterantcy, are not
      displayed correctly.  The only way to make the algorithm
      completely foolproof is to check every point, but this takes
      too long.

      The analysis can search for the actual edge of the operating
      region for a single row.  These data are stored in vectors
      defined in the constants plot named "oplo" and "ophi".
      The binary search depth is controlled by a shell variable
      "checkiterate".  If both checkSTP1 and checkSTP2 are zero,
      and checkiterate is greater than zero, the range of value1
      will be calculated, and the results stored in oplo/ophi.
      If checkiterate is not set, no search is performed.  Numbers
      between 0 and 10 are recognized.  Thus for example one could
      input "set checkiterate=6" before performing the analysis.
      This could appear in the file header.  If no search was done,
      zero is stored.  The circuit must pass at the central value
      or no search is performed.  Set checkiterate to zero to just
      find whether or not the circuit works.  Once a working point
      is found, set checkiterate to some positive number (higher
      is more accurate but time consuming) to get the range.  The
      range is not limited as in the case where the number of
      steps is nonzero, but ridiculous cases will fail.

      When only one point is checked (checkSTP1 = checkSTP2 = 0),
      no output file is generated.

      The vector "checkFAIL" is retained in the constants plot
      after the analysis, and has the status of the last analysis
      point.
 
!!SEEALSO
oprngfile
codeblock
mplot

!!KEYWORD
codeblock
!!TITLE
codeblock command
!!TEXT 
      command: codeblock [ -pfa ] [ filename ]

      A codeblock is a stored executable structure derived from
      a script file.  Being internal representations, codeblocks
      execute more efficiently than script files.  The codeblocks
      have the same name as the file from which the command text
      was obtained.  The options are as follows:

      p:  print the text of the block (synonym t).
      f:  remove the block (synonym d).
      a:  add a block.

      The options can be lumped or given as separate tokens.
      If no filename is given, all of the blocks in the internal
      list are listed by name, commands are printed if p is given,
      and the blocks are deleted if f is given (a is ignored).

      Otherwise, the named file/block is acted on.  Added blocks
      overwrite existing blocks of the same name.

      When a command is entered in response to a prompt or in a
      script (or another codeblock), the blocks are checked first,
      then the spice/nutmeg internal commands, then scripts, then
      vectors (for the implicit "let" in vector = something) and
      finally operating system commands if unixcom is set.

      The operating range analysis produces codeblocks with names
      like #_filename, where filename is an operating range deck.


!!KEYWORD
compose
!!TITLE
compose command
!!TEXT 
      command: compose vecname [ param = value ] ...
               or
               compose vecname values value ...

      Both forms of this command create a new vector called
      vecname.  In the first form, the values in the vector
      are determined by the parameters given.  In the second
      form, the given values are used to form the vector.
 
      The possible parms are:
        start   The value at which the vector should start.
        stop    The value at which the vector should end.
        step    The difference between sucessive elements.
        lin     The number of points, linearly spaced.
        log     The number of points, logarithmically spaced.
        dec     The number of points per decade, log spaced.
        center  Where to center the range of points.
        span    The size of the range of points.
        gauss   The number of points in the gaussian distribution.
        mean    The mean value for the gaussian disttribution.
        sd      The standard deviation for the gauss. dist.
        random  The number of randomly selected points.
        pool    The name of a vector (must be already defined) to
                get random values -- default is 'unitvec(npoints)'

      In the first form of the command, at least one of lin, log,
      dec, gauss, or random should be specified, or each of start,
      stop, and step.  For random, span defaults to 2.0, and center
      defaults to 0.  For gauss, sd defaults to 1.0, and mean
      defaults to 0.  Start defaults to zero, unless implicitly set
      by other parms.  If start > stop, the order is reversed.
      Start, stop, step apply to lin (the default), log, and dec.
      Center and span apply to random, and sd and mean apply to
      gauss.  Pool and the log functions are unimplemented.
 
!!SEEALSO
let

!!KEYWORD
continue
!!TITLE
continue command
!!TEXT 
      command: continue [ number ]

      If there is a while, dowhile, or foreach block enclos-
      ing this statement, control returns to the beginning of
      that block.  If there is no such enclosing block, an
      error results.  If a number is given, control is passed
      to the beginning of the number'th enclosing block.
 
!!SEEALSO
proglang

!!KEYWORD
cross
!!TITLE
cross command
!!TEXT 
      command: cross vecname number [ source ] ...

      A new vector is constructed, with name vecname and
      values consisting of the number'th element of each of
      the source vectors.  This is a rather awkward way to
      deal with multi-dimensional data - a more general
      method is being developed.
 

!!KEYWORD
dc
!!TITLE
dc command
!!TEXT 
      command: dc src1 vstart1 vstop1 vincr1 [src2 vstart2
                  vstop2 vincr2]
 
      Calculate the dc transfer curve of the current circuit.
      Only available in spice.
 
!!SEEALSO
dc_analysis

!!KEYWORD
define
!!TITLE
define command
!!TEXT 
      command: define function(arg, ...) expression

      Define the macro with the name function and arguments
      arg, ... to be expression, which may involve the argu-
      ments. When the function is later used, the arguments
      it is given are substituted for the formal arguments
      when it is parsed.  If expression is not present, any
      definitions for function are printed, and if there are
      no arguments to define then all currently active defin-
      itions are printed. Note that you may have different
      functions defined with the same name but different ari-
      ties.  Some useful definitions (which are part of the
      default environment) are:
 
      define max(x,y) (x > y) * x + (x <= y) * y
      define min(x,y) (x < y) * x + (x >= y) * y
 
!!SEEALSO
undefine
expressions

!!KEYWORD
deftype
!!TITLE
deftype command
!!TEXT 
      command: deftype v typename [ abbrev ]
           or
      deftype p plottype [ pattern ] ...

      This command is intended to make nutmeg easier to use
      with simulators other than SPICE3.  It is only a tem-
      porary facility, however.  The first form defines a new
      type for vectors.  The typename may then be used as a
      vector type specification in a rawfile, and will be
      used for the display command to indicate the type.  If
      an abbrev is given, values of that type can be named
      abbrev(something) where something is the name given in
      the rawfile (and something doesn't contain
      parentheses).  The second form defines a plot type.
      The (one word) name for a plot with any of the patterns
      present in its plot type name as given in the raw file
      will be plottype<num>, where <num> is a positive
      integer incremented every time a rawfile is read or a
      new plot is defined.
 

!!KEYWORD
delete
!!TITLE
delete command
!!TEXT 
      command: delete [ number ] ...
 
      Remove the traces or breakpoints with the specified
      numbers.  The status command may be used to obtain
      these numbers. (spice only)
 
!!SEEALSO
status
stop
iplot
step

!!KEYWORD
destroy
!!TITLE
destroy command
!!TEXT
      command: destroy [ plotname ... ] [ all ]

      Throw away the data in the named plot and reclaim the
      storage space.  This can be necessary if a lot of large
      simulations are being done.  spice should warn the user
      if the size of the program is approaching the maximum
      allowable size (within about 90%), but it is advisable
      to run the rusage command occasionally if running out
      of space is a possibility.  If the argument to destroy
      is all, all plots except the constant plot will be
      thrown away.  It is not possible to destroy the con-
      stant plot.  If no argument is given the current plot
      is destroyed.
 
!!SEEALSO
setplot
rusage
free

!!KEYWORD
diff
!!TITLE
diff command
!!TEXT 
      command: diff plot1 plot2 [ vecname ] ...

      Compare the vectors in the named plots and print out
      any values which differ significantly in corresponding
      vectors in the two plots.  If no vecnames are men-
      tioned, all vectors in the plots are compared, and if
      one or more names are given only those vectors are com-
      pared.  The variables abstol, reltol, and vntol are
      used to determine if two values are "significantly"
      different.  (See the SPICE3 User's Guide for details of
      these variables.)
 
!!SEEALSO
abstol
vntol
reltol

!!KEYWORD
display
!!TITLE
display command
!!TEXT 
      command: display [ vecname ] ...

      List the names, types and lengths of the vectors
      defined in the current plot, and whether the vector is
      real or complex.  If one or more vecames are given the
      list is restricted to those vectors.  Additional infor-
      mation is also given:  if there is a minimum or maximum
      value for the vector defined, this is listed (see the
      manual page for sconvert for a definition of the
      rawfile format and the manner in which this and the
      rest of the per-vector parameters are defined), if
      there is a default grid type or a default plot type,
      they are mentioned, and if there is a default color or
      a default scale for the vector it is noted.  Addition-
      ally, one vector in the plot will have the notation
      [default scale] appended - this vector will be used as
      the x-scale for the plot command if none is given or is
      the vectors named have no default scales of their own.
      A better description of these parameters is given with
      the description of the plot command.
 

!!KEYWORD
disto
!!TITLE
disto command
!!TEXT 
      command: disto {dec oct lin} pts fstop [f2overf1]
 
      Do an small-signal distortion analyis.
      Only available in spice.
 
!!SEEALSO
disto_analysis

!!KEYWORD
dowhile
!!TITLE
dowhile command
!!TEXT 
      command: dowhile condition

      This line, together with a matching end statement,
      defines a block of commands that are executed while the
      condition remains true.  (The condition is an expres-
      sion which is considered true if it evaluates to a
      non-0 value.)  Unlike the while statement, the test is
      done at the bottom of the loop.
 
!!SEEALSO
proglang

!!KEYWORD
dump
!!TITLE
dump command
!!TEXT 
      command: dump

      This command sends a print of the internal matrix data
      structure last used by the simulator for the current
      circuit to the standard output. (spice only)
 

!!KEYWORD
echo
!!TITLE
echo command
!!TEXT 
      command: echo [ -n ] [ stuff ] ...

      Print the stuff on the standard output.  If the -n flag
      is given, don't append a newline.
 
 

!!KEYWORD
edit
!!TITLE
edit command
!!TEXT 
      command: edit [-nr][ filename ]

      Edit the named file.  If no file name is given, the file
      associated with the current circuit will be edited.  If no
      file is associated with the current circuit, the current
      circuit will be printed into a temporary file for editing.
      After editing, the edited file is sourced, unless the -n
      (no source) option is given, and becomes the current circuit.
      Previous versions of the circuit are retained (but are not
      associated with the source file name), unless the -r option
      is given.  The -r (reuse) option causes replacement of the
      current circuit with the newly sourced circuit from the file,
      the current circuit is deleted.
      
      If a filename is given, the file is opened for editing, and
      sourced if the -n option is not given.  If any previously
      existing circuits are associated with the modified file, the
      file reference in these circuits is deleted.  The updated
      circuit becomes the current circuit.

      If no circuits are present, an empty file is opened for
      editing.  The -n option is useful for browsing text files
      of any type.

      The editor used is named by the "editor" set variable.  An
      internal editor "xeditor" is available under the X window
      system.  This is the default editor under X.  The -n and
      -r options are ignored with xeditor.  Xeditor has the
      advantage of asynchronous deck sources with the edit window
      displayed at all times.
 
!!SEEALSO
setcirc
xeditor
editor

!!KEYWORD
else
!!TITLE
else command
!!TEXT 
      command: else

      Part of an if-else block.  See the description of the
      if statement.
 
!!SEEALSO
proglang

!!KEYWORD
end
!!TITLE
end command
!!TEXT 
      command: end

      This statement terminates a block.  It is an error for
      an end to appear without a matching begin, if, while,
      repeat, foreach, or dowhile statement.  The keywords
      "enddowhile", "endforeach", "endif", "endrepeat", ane
      "endwhile" are internally aliased to "end".
 
!!SEEALSO
proglang

!!KEYWORD
foreach
!!TITLE
foreach command
!!TEXT 
      command: foreach var  [ value ] ...

      This statement opens a block which will be executed
      once for each value given.  Each time through, the var
      will be set to sucessive values.  After the loop is
      exited it will have the last value that was assigned to
      it.
 
!!SEEALSO
proglang

!!KEYWORD
fourier
!!TITLE
fourier command
!!TEXT 
      command: fourier fundamental_frequency [ value ] ...

      Does a fourier analysis of each of the given values,
      using the first 10 multiples of the fundamental fre-
      quency (or the first nfreqs, if that variable is set).
      The values may be any valid expression.  They are
      interpolated onto a fixed-spaced grid with the number
      of points given by the fourgridsize variable, or 200 if
      it is not set.  The interpolation will be of degree
      polydegree if that variable is set, or 1.  If polyde-
      gree is 0, then no interpolation will be done.  This
      command is executed when a .four line is present in the
      input file and spice is being run in batch mode.
 
!!SEEALSO
fourgridsize
nfreqs

!!KEYWORD
free 
!!TITLE
free command
!!TEXT
      command: free [circuit] [plot] [all] [yes]

      The free command releases the memory used to store plot and
      circuit structures for reuse by JSPICE3.  On most systems,
      the memory space allocated to JSPICE3 will be unchanged,
      i.e., once JSPICE3 allocates memory from the operating
      system, this memory is not available to other applications.
      Use of the free command will keep the memory used by JSPICE3
      from growing indefinitely, which otherwise could cause 
      problems after many simulation runs.  Performance may also
      improve due to minimizing paging activity.  If free is given
      without an argument, the user is queried as to whether to
      delete the current plot and circuit structures (independently).
      If the argument "all" is given, the user is queried as to
      whether to delete all plot and circuit structures.  If the
      argument "circuit" is given, only circuits will be acted on.
      Similarly, if the argument "plot" is given, only plots will
      be acted on.  If neither "circuit" or "plot" is given, both
      circuits and plots will be acted on.  If the argument "yes"
      is given, the user prompting is skipped, and the action
      performed.  Only the first letter of the keywords is needed.

!!SEEALSO
destroy

!!KEYWORD
goto
!!TITLE
goto command
!!TEXT 
      command: goto label

      If there is a label statement in an enclosing block
      defining the label, transfer execution to the statement
      following it.  Note that if goto is used outside of a
      block, the label must be above the goto.  There is a
      begin macro pre-defined as if 1 which may be used if
      forward label references are required outside of a loop
      construct.
 
!!SEEALSO
proglang

!!KEYWORD
graf 
!!TITLE
graf command
!!TEXT 
      command: graf [ -options ][ expressions ]

      The graf command is for plotting simulation output on the
      screen, similar to the plot command but with a different
      format.  Options can be entered as the first token on the
      command line, following "-" (with no space).  If not
      running under the X window system, options are also entered
      from the keyboard after each plot is displayed.  Under X,
      command buttons perform the same functions.  Graf remembers
      the previous command arguments, so to display the same named
      vectors as in the previous call to graf, graf can be entered
      without arguments.

      button   cmdline   function
      [quit]             Quit window
      [help]             Print help information
      [hardcopy]         Generate a hardcopy
      [points]    (-p)   Plot data as points
      [x-y]       (-b)   Plot in X-Y mode
      [separate]  (-t)   Each trace on a separate scale
      [marker]           Enable marker, button 1 reference
      [one scale] (-N)   Plot all traces on same scale
      [grp scale] (-n)   I and V each use one scale
                  (-s)   Interpolate data as steps, hold value
                            until next point (cmd line only).
      Button 3 for zoomin (X only)

      The following options can be entered from the keyboard in
      non-X versions.  The command line options above are used
      in both versions.

      'b'  Plot the data in X-Y mode, taking 2 traces at a time.
      'c'  Bring up the marker.  The marker prints the trace
             coordinates, and is retired when c is depressed.
             Button one can be pressed to provide a reference for
             deltas.
      'h'  Print the help message.
      'n'  Use similar scales for three classes of traces: those
             with names beginning with V, I, and otherwise (case
             insensitive).
      'N'  Plot all traces on the same vertical scale.
      'P'  Print the screen.
      'p'  Plot the data as points.
      'q'  Exit the program.
      't'  Display each trace on a separate axis so as to not
             overlap.
      'x'  Change the horizontal scale, thus plot a portion of
             the graph.
      'X'  Same as 'x' but use the whole curve to generate the
             vertical scales.  For x,X the new horiz. scale max
             and min are prompted for.
      'y'  Use separate scales for each trace (undo n or N).
   
       Options p, t toggle, y,n,N remain in effect until changed
       (y is the default).  When using the x,X options, ENTER as
       response to the scale min max prompt will reset to full
       scale, and space followed by ENTER will leave the values
       unchanged.
 
!!SEEALSO
asciiplot
plot
expressions

!!KEYWORD
hardcopy
!!TITLE
hardcopy command
!!TEXT 
      command: hardcopy [ filename ] [ plot arguments ]

      This command has a syntax identical to that of the plot
      command, except for a filename in which to put the plot
      image.  If no plot arguments are given, the user will
      be prompted to select a window which will be dumped
      into the file (if he is using a graphics system with
      windows such as X).  If no filename is given a tem-
      porary file will be used.  If the hcopydev variable is
      defined, the file will be printed using the command
      "lpr -g -Phcopydev file", and if a temporary file was
      used, it will be removed.  This is likely to work only
      on a UNIX system.  The format of the plot image file is
      set by the hcopydevtype variable, and defaults to that 
      given in the UNIX manual page for plot(5), which may be
      plotted on a terminal with the UNIX plot program.
 
!!SEEALSO
plot
asciiplot
hcopydev
hcopydevtype

!!KEYWORD
help
!!TITLE
help command
!!TEXT
      command: help [ topic ] ...

      This is an interactive graphical help browser.  Its
      operation should be largely self-explanatory.  The user
      is presented with a window (if he is using the X win-
      dows system) or a screenful of information.
 
      In the X version, there will be a number of "buttons"
      which the user can click the mouse in, each of which
      correspond to a sub-topic of the topic discussed in the
      window, or a "see also" topic which is related to the
      current one.  If the user clicks the mouse in one of
      these buttons, a new window will be created overlapping
      the old one, which contains the information on the
      requested topic.  Each window also contains buttons in
      the upper right-hand corner:  Delete Window will cause
      the window and all others that are its "descendants" to
      go away; Quit Help will cause all the windows to disap-
      pear and help system to be exited; and possibly Next
      Page and Prev Page, which allow the user to scroll
      around the text if there is more data than will fit on
      a reasonable screen.
 
      If X is unavailable, the information will be paged as
      in the more program.  At the end of the text there will
      be a menu of the available sub-topics and see-alsos.
 
      If for some reason the help directory is unavailable,
      the oldhelp command will be used.  The single character
      '?' is internally aliased to "help".
 
!!SEEALSO
X
helpinitxpos
helpinitypos
oldhelp

!!KEYWORD
historycomm
!!TITLE
history command
!!TEXT 
      command: history [ -r ] [ number ] ...
 
      Print out the last number commands typed by the user,
      or all the commands saved if there are no arguments.
      The number of commands saved is determined by the value
      of the history variable.  If the -r flag is given, the
      list is printed in reverse order.
 
!!SEEALSO
historyvar
historysub

!!KEYWORD
if
!!TITLE
if command
!!TEXT 
      command: if condition
 
      This statement defines a block to be executed if the
      condition is true.  See the section on the command
      language for more details.
 
!!SEEALSO
proglang

!!KEYWORD
iplot
!!TITLE
iplot command
!!TEXT 
      command: iplot [ name ] ...
 
      Incrementally plot the values of all the names given as
      the simulation runs.  The values which are being traced
      in this manner can be examined and removed using the
      status and delete commands.  (spice only)
 
!!SEEALSO
status
delete
step
stop
plot
graf

!!KEYWORD
jobs
!!TITLE
jobs command
!!TEXT 
      command: jobs
 
      Print out a summary of all the simulations which have
      been started with the aspice command.
 
!!SEEALSO
aspice

!!KEYWORD
label
!!TITLE
label command
!!TEXT 
      command: label labelname

      This defines a label which can be used as an argument
      to goto.
 
!!SEEALSO
proglang

!!KEYWORD
let
!!TITLE
let command
!!TEXT 
      command: let vecname = expr
 
      Create a vector with name vecname and value given by
      the expression expr.  None of the vector options such
      as default scale, color, etc that are read from the
      rawfile are preserved when a vector is created in this
      manner.
 
!!SEEALSO
expressions
compose
setandlet

!!KEYWORD
linearize
!!TITLE
linearize command
!!TEXT 
      command: linearize [ vecname ] ...
 
      The purpose of this command is to force data from a
      transient analysis to conform to a linear scale.  Due
      to the algorithm used to determine the timesteps used,
      the time scale may not be linear.  If no vecnames are
      given, all the vectors in the current plot are copied
      to a new plot which becomes the current plot, and their
      data is interpolated onto a linear time scale.  If one
      or more vectors are named, only those vectors are
      copied.   The variable polydegree determines how the
      interpolation is done.  Note that this command is only
      available in spice, and the current plot must
      correspond to the current circuit (otherwise the wrong
      values for the start, step, and stop times may be
      used).
 
!!SEEALSO
nousertp

!!KEYWORD
listing
!!TITLE
listing command
!!TEXT 
      command: listing [ logical ] [ physical ] [ deck ] [ expand ]
 
      Print a listing of the current circuit to the standard
      output.  The arguments control the format of the list-
      ing.  A logical listing is one in which comments are
      removed and continuation lines are appended to the end
      of the continued line.  A physical listing is one in
      which comments and continuation lines are preserved.  A
      deck listing is one without line numbers (so as to be
      acceptible to the circuit parser).  The last option,
      expand, is orthagonal to the previous three - it
      requests that the circuit be printed after subcircuit
      expansion.  Note that only in an expanded listing are
      error messages associated with particular lines visi-
      ble.  (spice only)
 
!!SEEALSO
source

!!KEYWORD
load
!!TITLE
load command
!!TEXT 
      command: load [ filename ] ...
 
      Loads the data in either binary or ascii format from
      the files named. The default filename is rawspice, or
      the argument to the -r command line option if one was
      given.  The last plot in the file becomes the current
      plot.  A description of the rawfile format is given in
      the manual page for sconvert.
 
!!SEEALSO
write

!!KEYWORD
loop
!!TITLE
loop command
!!TEXT
      command: loop start stop step <analysis>

      This command works like the dc command, but changes the
      values of $value1 and $value2 as in the margin analysis
      command "check.  The syntax is:

      loop min1 [max1 [step1]] [min2 [max2 step2]]] [analysis]

      A multi-dimensional plot will be produced.  If "analysis"
      is omitted, an analysis spec is expected to be found in
      the deck.  Only one analysis can be specified (no dc
      nesting).  The deck should contain $value1 and $value2
      (if used) for substitution, and be the current circuit.
      Ignore any warnings issued when the circuit is loaded,
      which occur if these variables were not previously set.

!!SEEALSO
oprng
multi_dc

!!KEYWORD
mplot
!!TITLE
mplot command
!!TEXT 
      command: mplot [ -c ][ -on ][ -off ][ filenames ... ]

      This command is used for graphically plotting results from
      operating range analysis on the screen.  Filenames are
      names of files produced by the operating range analysis.
      If no file is specified, the file produced by the last
      operating range analysis run in the current session is
      assumed.  If no operating range analysis files have been
      produced in the current session, the file named "check.dat"
      is assumed.  It is also assumed that these files exist in
      the current directory.

      The -c option combines compatible data from two or more
      files into the same plot.  The data must have identical
      coordinate spacing and projected origins to be combinable.
      The options -on and -off turn on and off the plotting of
      operating range analysis while simulating, similar to iplot.
      When off, output is in text mode.  When on, output is
      plotted in graphics form, and text echoed from the input
      file is also displayed.
 
!!SEEALSO
oprng
 
!!KEYWORD
noise
!!TITLE
noise command
!!TEXT 
      command: noise v(out [,ref]) src {dec oct lin} pts fstart
                     fstop [pts_per_summary]
 
      Do an small-signal linear noise analyis.
      Only available in spice.
 
!!SEEALSO
noise_analysis

!!KEYWORD
oldhelp
!!TITLE
oldhelp command
!!TEXT
      command: help [ all ] [ commandname ] ...
 
      A brief helpful message is printed, followed by one-
      line descriptions of all the commands named, or all
      commands if all was given.  If there are no arguments
      only a few useful commands are described.  This command
      is available in case for some reason the documentation
      browser is broken.
 
!!SEEALSO
help

!!KEYWORD
op
!!TITLE
op command
!!TEXT 
      command: op

      Perform an operating point analysis on the current circuit.
      Only available in spice.
 
!!SEEALSO
op_analysis

!!KEYWORD
plot
!!TITLE
plot command
!!TEXT 
      command: plot [ expr ... [ vs x-expr ] ] [ options ] ...
 
      Plot the values of the expressions on the graphics dev-
      ice, if there is one.  For each set of expressions that
      is followed by a vs x-expr clause, all those vectors
      are plotted with the x-expr for a scale.  Multiple sets
      of expressions with different x-scales may be given in
      this manner.  The available options are listed below.
      Note that options must appear after expressions.
 
!!SUBTOPICS
combplot
lingrid
linplot
loglog
nogrid
nointerp
pointplot
samep
title
xcompress
xdelta
xindices
xlabel
xlimit
xlog
ydelta
ylabel
ylimit
ylog
!!SEEALSO
hardcopy
asciiplot
expressions
graphics
device
term
color
geometry
dontplot
graf

!!KEYWORD
print
!!TITLE
print command
!!TEXT 
      command: print [ col ] [ line ] [ expr ] ...
 
      Print the values of the given expressions to the stan-
      dard output.  If col is specified, print the values in
      columns, with the scale in the leftmost column on each
      page.  If line is specified, print the value of each
      expression on one line (or more if needed). If all
      expressions have a length of 1, the default style is
      line, otherwise col is the default.
 

!!KEYWORD
pz
!!TITLE
pz command
!!TEXT 
      command: pz node1 node2 node3 node4 {cur vol} {pol zer pz}
 
      Run a pole-zero analysis.  This command is only available
      in spice.
 
!!SEEALSO
pz_analysis

!!KEYWORD
quit
!!TITLE
quit command
!!TEXT 
      command: quit
 
      Exit the program.  If there are circuits that are in
      the middle of a simulation, or plots that have not been
      saved in a file, the user is reminded of this and asked
      to confirm.  (The variable noaskquit disables this.)
 
!!SEEALSO
noaskquit

!!KEYWORD
rehash
!!TITLE
rehash command
!!TEXT 
      command: rehash
 
      Recalculate the internal hash tables used when looking
      up UNIX commands, and make all UNIX commands in the
      user's PATH available for command completion.  This is
      a no-op unless you have the unixcom variable set.
 
!!SEEALSO
unixcomcomm
unixcom

!!KEYWORD
repeat
!!TITLE
repeat command
!!TEXT 
      command: repeat [ number ]
 
      Execute the statements in the block defined by this
      line and the corresponding end statement number times,
      or indefinitely if no number is given.
 
!!SEEALSO
proglang

!!KEYWORD
reset
!!TITLE
reset command
!!TEXT 
      command: reset
 
      Throw away the internal data structures associated with
      the current circuit and re-parse the input listing.  The
      shell variables found within the circuit are updated.
 
!!SEEALSO
run

!!KEYWORD
resume
!!TITLE
resume command
!!TEXT 
      command: resume
 
      If the current circuit is in the middle of a simula-
      tion, restart the simulation from the point it was left
      off.
 
!!SEEALSO
run

!!KEYWORD
rspice
!!TITLE
rspice command
!!TEXT 
      command: rspice [ inputfile ] ...
 
      Runs a spice job remotely, using the inputfiles as
      input, or the current circuit if no argument is given.
      The program waits for the job to complete, and passes
      output from the remote job to the user's standard out-
      put. When the job is finished the data is loaded in as
      with aspice. If the variable rhost is set, rspice will
      connect to this host instead of the default remote
      server machine.  If the variable rprogram is set, then
      rspice will use this as the pathname to the program to
      run.  Note that this command will work only if your
      system administrator has set up a spice daemon on one
      of your machines.  (See the README file in the distri-
      bution directory for details on how to do this.) If the
      daemon thinks the remote machine is too loaded already,
      it may tell the user to try another machine or to try
      again later.
 
!!SEEALSO
aspice
rhost
rprogram

!!KEYWORD
run
!!TITLE
run command
!!TEXT 
      command: run [ rawfile ]
 
      Run all the analyses given in the current circuit (the
      default is an operating point analysis). If a rawfile
      is given, the output is saved in this file.  Otherwise
      it is made available as the current plot.
 
!!SEEALSO
resume

!!KEYWORD
rusage
!!TITLE
rusage command
!!TEXT 
      command: rusage [ all ] [ resource ] ...
 
      Print out various resource usage statistics.  If all is
      given as an argument, all the information available is
      printed.  If no arguments are given, only total time
      and space usage are printed.  Otherwise, information
      corresponding to each of the arguments is printed.  The
      resource types recognised are given below.  Note that
      many of them are available only with spice, and some
      only available with UNIX.
 
!!SUBTOPICS
accept
elapsed
faults
loadtime
lutime
rejected
solvetime
space
time
totaltime
totiter
traniter
tranpoints
transolvetime
trantime

!!KEYWORD
save
!!TITLE
save command
!!TEXT 
      command: save [ all ] [ nodename ] ...
 
      Save a set of outputs, discarding the rest. If a node
      has been mentioned in a save command, it will appear in
      the working plot after a run has completed, or in the
      rawfile if spice is run in batch mode (in this case,
      the command can be given in the input file as .save
      ...). If a node is traced or plotted it will also be
      saved.  If no save commands are given, all nodes will
      be saved.
 
!!SEEALSO
status

!!KEYWORD
sens
!!TITLE
sens command
!!TEXT 
      command: sens outvar [ac {dec oct lin} pts fstart fstop]
 
      Do a sensitivity analysis of the current circuit.
      Only available in spice.
 
!!SEEALSO
sens_analysis

!!KEYWORD
set
!!TITLE
set command
!!TEXT 
      command: set [ varname [ = value ] ] ...
 
      The set command allows the user to examine and set
      variables.  In the first form, the names and values of
      all the variables are printed.  Some may be prefixed
      with a '*', which means that they are associated with
      the current plot, and will change when the current plot
      changes.  Others may be prefixed by a '+', which means
      that they are associated with the current circuit.  If
      a variable is defined which has the same name as one
      associated with the current plot or circuit, it takes
      precedence for printing with the set command and $
      expansion, but it will not change the value used by the
      circuit.  Some variables are read-only and may not be
      changed by the user.  This is not indicated by the set
      command, however.
 
      In the second form, where a varname is given, that
      variable is either set (with a 'true' boolean value),
      or given the value specified.  A value may be a number,
      a string, or a list of values.  A string is anything
      which isn't a list or parsable as a number, and a list
      is surrounded by space separated parentheses.  The
      variables which have any meaning to nutmeg or spice are
      listed in the VARIABLES section of the manual, and can
      be listed with the usrset command.
 
!!SEEALSO
unset
variables
variablesub
usrset
setandlet

!!KEYWORD
setcirc
!!TITLE
setcirc command
!!TEXT 
      command: setcirc [ circuitname ]
 
      Change the current circuit. The current circuit is the
      one that is used for the simulation commands.  When a
      circuit is loaded with the source command, it becomes
      the current circuit.  If setcirc is given no arguments,
      it prints a menu of the available circuits.
 

!!KEYWORD
setplot
!!TITLE
setplot command
!!TEXT 
      command: setplot [ plotname ]
 
      Set the current plot to the plot with the given name,
      or if no name is given, prompt the user with a menu.
      Note that setplot is a command script - it is possible
      to change the current plot by setting the variable cur-
      plot.
 
!!SEEALSO
curplot
plotvars

!!KEYWORD
setrdb
!!TITLE
setrdb command
!!TEXT 
      command: setrdb resource: value

      This adds resources to the X resource database, and can
      be used to set properties of the various components of
      the graphics display.  See your X documentation for the
      full story on setting resources.  The class hierarchy is
      given in "resources".  The resource string is a path
      containing widget names and/or classes.  The separation
      character is . for literal matches, or * to represent
      wildcard insertions.  The last token in the path is the
      resource name.

      Examples:
      jspice3*buttonbox.background: blue
         paint all buttonboxes background blue

      jspice3.Form.buttonbox.background: blue
         paint all buttonboxes background blue

      jspice3.plot.buttonbox.background: blue
         paint only plot buttonboxes background blue

      The new resource value will affect graphics items
      subsequently created.

!!SEEALSO
resources

!!KEYWORD
settype
!!TITLE
settype command
!!TEXT 
      command: settype type [ vector ] ...
 
      Change the type of the named vectors to type.  Type
      names can be found in the manual page for sconvert, or
      they may be defined with the deftype command.
 

!!KEYWORD
shell
!!TITLE
shell command
!!TEXT 
      command: shell [ command ] ...
 
      Fork a shell, or execute the arguments as a command to
      the operating system.
 
!!SEEALSO
unixcom

!!KEYWORD
shift
!!TITLE
shift command
!!TEXT 
      command: shift [ varname ] [ number ]
 
      If varname is the name of a list variable, it is
      shifted to the left by number elements. (I.e, the
      number leftmost elements are removed.)  The default
      varname is argv, and the default number is 1.
 
!!SEEALSO
variables

!!KEYWORD
show
!!TITLE
show command
!!TEXT 
      command: show [ devlist ] [, parmlist ]
 
      Print the named device parameters of the requested dev-
      ices.  Either the device name list or the parameter
      name list may be "all" ("all" is implied if the list is
      empty), and the device names may contain the *, ?, and
      [] wildcard characters.  For lists of the parameters that
      the various devices recognise, see the SPICE3 User's
      Guide, or use the show command without a parameter list.
      Spaces around the "," are optional, as is the "," itself
      if no parameters are given.  If no argument is given to
      the show command, all parameters of all devices will be
      displayed.  The parameters that can not be altered with
      the alter command are indicated with "(RO)" (Read Only).
 
!!SEEALSO
alter

!!KEYWORD
source
!!TITLE
source command
!!TEXT 
      command: source filename ...
 
      The source command reads and processes circuit descriptions
      and command text from files.  This is done implicitly if
      the name of the file is simply given as a command.  Shell
      variables found in the circuit deck (but not in the commands
      text) are evaluated at this point, the reset command can be
      used to update these variables if they are changed by the
      shell after sourcing.  If commands are present, they are
      executed after the circuit (if any) is expanded and loaded.

      Command lines must be surrounded by the lines .control and
      .endc in the file, or prefixed by *# in order to be
      recognised as commands.  The exception to this rule is the
      initialization files (spinit, .spiceinit, spice.rc) which
      are known to contain only commands.  If a file contains
      only commands, the first line is ignored, thus a blank
      line or comment should be the first line in a command file,
      corresponding to the title line of a circuit file.  This
      is not true for other types of input files, such as SCED
      circuit descriptions or margin analysis files.
 
!!SEEALSO
sourcepath

!!KEYWORD
state
!!TITLE
state command
!!TEXT 
      command: state
 
      It's not clear what this command should do.  Currently
      it prints the name and status of the current curcuit.
 

!!KEYWORD
status
!!TITLE
status command
!!TEXT 
      command: status
 
      Print out a summary of all the trace, stop, save, and
      iplot commands that are active.  The numbers given may
      be used with the delete command to de-activate the
      trace.
 
!!SEEALSO
delete
step
iplot
stop

!!KEYWORD
step
!!TITLE
step command
!!TEXT 
      command: step [ number ]
 
      Single-step the simulation, or let it run for number
      time steps if a number is given.
 
!!SEEALSO
iplot
stop
status
delete

!!KEYWORD
stop
!!TITLE
stop command
!!TEXT 
      command: stop [ after num ] [ when val1 op val2 ] ...
 
      Create a breakpoint.  If an after clause is given, the
      simulation will stop after num points.  If a when
      clause is included, at each point, the val1 op val2
      condition will be checked, and if it is true, the simu-
      lation will stop.  If more than one when or after
      clause is put on one line, the conjunction of the con-
      ditions is checked.  The vals may be either constants
      or node names.  The possible ops are:
 
         eq   or   =    (equal to)
         ne   or   <>   (not equal to)
         gt   or   >    (greater than)
         lt   or   <    (less than)
         ge   or   >=   (greater than or equal to)
         le   or   <=   (less than or equal to)
 
      Note that for this command, < and > do not denote IO
      redirection.
 
!!SEEALSO
step
iplot
delete
status

!!KEYWORD
strcmp
!!TITLE
strcmp command
!!TEXT 
      command: strcmp varname string1 string2
 
      The value of varname is set to a number that is greater
      than, equal to, or less than 0 according as string1 is
      lexically before, equal to, or after string2.  This
      command is a very bad thing, but there seems to be no
      other way to do string comparisons given the restric-
      tions of the nutmeg command language.
 

!!KEYWORD
tf
!!TITLE
tf command
!!TEXT 
      command: tf outvar insrc
 
      Do a dc transfer function analysis of the current circuit.
      Only available in spice.
 
!!SEEALSO
tf_analysis

!!KEYWORD
trace
!!TITLE
trace command
!!TEXT 
      command: trace [ node ] ...
 
      Each time point, the value of the named nodes will be
      printed to the standard output.
 
!!SEEALSO
step
stop
delete
status
iplot

!!KEYWORD
tran
!!TITLE
tran command
!!TEXT 
      command: tran tstep tstop [ tstart][ tmax ][ uic ]
 
           Run a transient analysis.  The arguments are the same
      as those of a .tran line in a spice input deck. Output is
      retained at tstart, tstop, and multiples of tstep in
      between, unless the variable "nousertp" is set.  In this
      case, output is retained at each internally generated time
      point in the range.  Accuracy can be slightly improved if
      the variable "hitusertp" is set.  This command is available
      in spice only.
 
!!SEEALSO
tran_analysis
hitusertp
nousertp

!!KEYWORD
unalias
!!TITLE
unalias command
!!TEXT 
      command: unalias [ word ] ...
 
      Removes any aliases associated with all the words.  The
      argument may be "*", in which case all aliases are
      deleted.
 
!!SEEALSO
alias
aliases

!!KEYWORD
undefine
!!TITLE
undefine command
!!TEXT 
      command: undefine [ word ] ...
 
      Remove all the macro functions defined for the words.
      If the argument is "*", then all macro functions are
      deleted.  Note that all functions with the given names
      are removed, so there is no way to delete a function
      with a particular arity without deleting all functions
      with that name.
 
!!SEEALSO
define
expressions

!!KEYWORD
unlet
!!TITLE
unlet command
!!TEXT 
      command: unlet [ vecname ] ...
 
      All the named vectors are removed from the current
      plot.  If you unlet a vector which is the default scale
      (e.g. TIME), a random remaining vector will become the
      default scale.
 
!!SEEALSO
let

!!KEYWORD
unset
!!TITLE
unset command
!!TEXT 
      command: unset [ varname ] ...
 
      All the named variables are unset.  The argument may be
      "*", in which case all variables are unset (although
      this is usually not something that you would want to
      do).
 
!!SEEALSO
set
variablesub
variables

!!KEYWORD
usrset 
!!TITLE
usrset command
!!TEXT
      command: usrset

      This command prints a list of all variables which may be
      set with the set command which have significance to
      spice and/or nutmeg.
 
!!SEEALSO
set

!!KEYWORD
version
!!TITLE
version command
!!TEXT 
      command: version [ version name ]
 
      With no arguments, this command prints out the current
      version of spice.  If there are arguments, it compares
      the current version with the given version and prints a
      warning if they differ.  A version command is usually
      included in the rawfile.
 

!!KEYWORD
while
!!TITLE
while command
!!TEXT 
      command: while condition
 
      This command defines a block which is executed while
      the condition is true.
 
!!SEEALSO
proglang

!!KEYWORD
write
!!TITLE
write command
!!TEXT 
      command: write [ file [ expr ] ... ]
 
      Writes out the exprs to the file.  First vectors are
      grouped together by plots, and written out as such.
      (E.g, if the expression list contained three vectors
      from one plot and two from another, then two plots will
      be written, one with three vectors and one with two.)
      Additionally, if the scale for a vector isn't present,
      it is automatically written out as well.  The default
      format is ascii, but this may be changed with set file-
      type.  The default filename is rawspice, or the argu-
      ment to the -r flag on the command line, if there was
      one, and the default expression list is all.
 
!!SEEALSO
load
expressions

!!KEYWORD
xeditor
!!TITLE
xeditor command
!!TEXT 
      command: xeditor [file]
 
      The xeditor command invokes a text editing window for
      editing circuit and other text files.  It is avail-
      able only when running under the X window system.
      The bindings are the same as used in the X-Consortium
      xedit(1) program:

      Command buttons:
        Quit:     Exit the editor
        Save:     Save the current buffer to a file
        Save As:  Save the current buffer or marked block to
                    a new file
        Source:   Send the buffer to Jspice3 as input
        Load:     Input a new text file for editing
        Help:     Bring up help text

      Key bindings:
        Ctrl-a   Beginning Of Line
        Ctrl-b   Backward Character
        Ctrl-d   Delete Next Character
        Ctrl-e   End Of Line
        Ctrl-f   Forward Character
        Ctrl-g   Multiply Reset
        Ctrl-h   Delete Previous Character
        Ctrl-j   Newline And Indent
        Ctrl-k   Kill To End Of Line
        Ctrl-l   Redraw Display
        Ctrl-m   Newline
        Ctrl-n   Next Line
        Ctrl-o   Newline And Backup
        Ctrl-p   Previous Line
        Ctrl-r   Search/Replace Backward
        Ctrl-s   Search/Replace Forward
        Ctrl-t   Transpose Characters
        Ctrl-u   Multiply by 4
        Ctrl-v   Next Page
        Ctrl-w   Kill Selection
        Ctrl-y   Unkill
        Ctrl-z   Scroll One Line Up

        Meta-b   Backward Word
        Meta-f   Forward Word
        Meta-i   Insert File
        Meta-k   Kill To End Of Paragraph
        Meta-q   Form Paragraph
        Meta-v   Previous Page
        Meta-y   Insert Current Selection
        Meta-z   Scroll One Line Down
        Meta-d   Delete Next Word
        Meta-D   Kill Word
        Meta-h   Delete Previous Word
        Meta-H   Backward Kill Word
        Meta-<   Beginning Of File
        Meta->   End Of File
        Meta-]   Forward Paragraph
        Meta-[   Backward Paragraph

        Delete                Delete next character
        Meta-Delete           Delete Previous Word
        Meta-Shift-Delete     Kill Previous Word
        Meta-Backspace        Delete Previous Word
        Meta-Shift-Backspace  Kill Previous Word

      Pointer button bindings (cut and paste text):
        Button 1 Down    Start Selection
        Button 1 Motion  Adjust Selection
        Button 1 Up      End Selection (cut)

        Button 2 Down    Insert Current Selection (paste)

        Button 3 Down    Extend Current Selection
        Button 3 Motion  Adjust Selection
        Button 3 Up      End Selection (cut)

      Xeditor is also invoked with the "edit" command
      when the "editor" variable is unset, or set to
      "xeditor".

!!SEEALSO
edit
editor

!!KEYWORD
xgraph
!!TITLE
xgraph command
!!TEXT 
      command: xgraph file [exprs] [plot options]
 
      The spice3/nutmeg xgraph command plots data like
      the plot command but via xgraph, a popular X11 plotting
      program.
 
      If file is either "temp" or "tmp" a temporary file
      is used to hold the data while being plotted.  For
      available plot options, see the plot command.  All op-
      tions except for polar or smith plots are supported.
 
!!SEEALSO
plot


*****************************************************************
*
* Internal Vector Functions
*
*****************************************************************

!!KEYWORD
functions
!!TITLE
Functions
!!TEXT 
      The pre-defined functions available are listed below.  In
      general, all operations and functions will work on either
      real or complex values.  Operations such as the logarithm of
      a negative number will yield errors, however.
 
      Note that all functions and operations operate pointwise on
      their arguments unless otherwise described.
 
 
!!SUBTOPICS
abs
atan
cos
db
deriv
exp
gauss
im
interpolate
vj
length
ln
log
mag
mean
norm
ph
pos
re
rnd
sin
sqrt
tan
unitvec
vector

!!KEYWORD
abs
!!TITLE
abs function
!!TEXT 
      internal function: abs()

      Absolute value.  This is actually the same function as mag().
 
 

!!KEYWORD
atan
!!TITLE
atan function
!!TEXT 
      internal function: atan()
 
      Arc tangent.  This function (and all the trig func-
      tions) treat their arguments as radians unless the
      units variable is set to degrees.
 
!!SEEALSO
units

!!KEYWORD
cos
!!TITLE
cos function
!!TEXT 
      internal function: cos()

      Returns the cosine of the argument.
 
!!SEEALSO
units

!!KEYWORD
db
!!TITLE
db function
!!TEXT 
      internal function: db()

      Decibels (20.0 * log base 10 of the argument).
 

!!KEYWORD
deriv
!!TITLE
deriv function
!!TEXT 
      internal function: deriv()

      Calculates the derivative of  the  given
      vector.   This uses numeric differentia-
      tion by interpolating a  polynomial  and
      may  not  produce  satisfactory  results
      (particularly with iterated differentia-
      tion).   The  implementation  only cacu-
      lates the dirivative with respect to the
      real componant of that vector's scale.


!!KEYWORD
exp
!!TITLE
exp function
!!TEXT 
      internal function: exp()
 
      E to the power of the argument.
 

!!KEYWORD
gauss
!!TITLE
gauss function
!!TEXT 
      internal function: gauss()
 
      This function returns a vector which contains normally
      distributed random values.  The standard deviation and
      mean are set by the corresponding real and imaginary
      coefficients of the given vector term-by-term, the mean
      is zero if the given vector is real.  The vector returned
      is always real.
 

!!KEYWORD
im
!!TITLE
im function
!!TEXT 
      internal function: im()
 
      Returns the imaginary part of the argument.
 

!!KEYWORD
interpolate
!!TITLE
interpolate function
!!TEXT 
      internal function: interpolate()

      This function takes its data and interpolates it onto a
      grid which is determined by the scale of the currently
      active plot.  The degree is determined by the polyde-
      gree variable.  This is especially useful if the argu-
      ment belongs to a plot which is not the current one.
      Some restrictions are that the current scale, the old
      scale, and the argument must be real, and that either
      both scales must be strictly increasing or strictly
      decreasing.
 

!!KEYWORD
vj
!!TITLE
j function
!!TEXT 
      internal function: j()
 
      Returns the argument multiplied by the square root of -1.
 

!!KEYWORD
length
!!TITLE
length function
!!TEXT 
      internal function: length()
 
      Returns the length of the argument.
 

!!KEYWORD
ln
!!TITLE
ln function
!!TEXT 
      internal function: ln()
 
      Returns the natural logarithm of the argument.
 

!!KEYWORD
log
!!TITLE
log function
!!TEXT 
      internal function: log()
 
      Returns the logarithm base 10 of the argument.
 

!!KEYWORD
mag
!!TITLE
mag function
!!TEXT 
      internal function: mag()
 
      Returns the magnitude of the argument.
 

!!KEYWORD
mean
!!TITLE
mean function
!!TEXT 
      internal function: mean()
 
      Returns the mean value of the elements in the argument.  This
      returns a vector of length 1.
 

!!KEYWORD
norm
!!TITLE
norm function
!!TEXT 
      internal function: norm()
 
      The elements of the argument are all multiplied by the
      magnitude of the inverse of the largest argument.
 

!!KEYWORD
ph
!!TITLE
ph function
!!TEXT 
      internal function: ph()
 
      Returns the phase of the argument (expressed in radians).
 

!!KEYWORD
pos
!!TITLE
pos function
!!TEXT 
      internal function: pos()
 
      This function returns a vector which is 1 if the
      corresponding element of the argument has a non-0 real
      part, and 0 otherwise.
 

!!KEYWORD
re
!!TITLE
re function
!!TEXT 
      internal runction: re()
 
      Returns the real part of the argument.
 

!!KEYWORD
rnd
!!TITLE
rnd function
!!TEXT 
      internal function: rnd()
 
      This function returns a vector which contains random
      values between 0 and the corresponding element of the
      argument.  If the argument is complex then the random
      value is also complex.
 

!!KEYWORD
sin
!!TITLE
sin function
!!TEXT 
      internal function: sin()
 
      Returns the sine of the argument.
 
!!SEEALSO
units

!!KEYWORD
sqrt
!!TITLE
sqrt function
!!TEXT 
      internal function: sqrt()
 
      Returns the square root of the argument.
 

!!KEYWORD
tan
!!TITLE
tan function
!!TEXT 
      internal function: tan()
 
      Returns the tangent of the argument.
 
!!SEEALSO
units

!!KEYWORD
unitvec
!!TITLE
unitvec function
!!TEXT 
      internal function: unitvec()
 
      This function returns a vector consisting of all 1's,
      with length equal to the magnitute of its argument.
 

!!KEYWORD
vector
!!TITLE
vector function
!!TEXT 
      internal function: vector()
 
      This function returns a vector consisting of the
      integers from 0 up to the magnitude of its argument.
      This function and the unitvec function both examine
      only the first element of their arguments.
 


*****************************************************************
*
* Command Keywords
*
*****************************************************************

!!KEYWORD
accept
!!TITLE
accept keyword
!!TEXT
      rusage keyword: accept
 
      The number of accepted time points.
 

!!KEYWORD
combplot
!!TITLE
combplot keyword
!!TEXT 
      plot keyword: combplot
 
      Use a comb plot instead of connected points.  Each
      point is connected to the bottom of the screen by a
      line.
 

!!KEYWORD
elapsed
!!TITLE
elapsed keyword
!!TEXT 
      rusage keyword: elapsed

      The total amount of time elapsed since the last rusage
      elapsed command.
 

!!KEYWORD
faults
!!TITLE
faults keyword
!!TEXT 
      rusage keyword: faults

      The number of page faults caused by the program so far.
 

!!KEYWORD
lingrid
!!TITLE
lingrid keyword
!!TEXT 
      plot and gridtype keyword: lingrid
 
      Use a linear grid.  This is the default grid type.
 

!!KEYWORD
linplot
!!TITLE
linplot keyword
!!TEXT 
      plot keyword: linplot
 
      Plot data as points connected by lines.  This is the
      default.
 

!!KEYWORD
loadtime
!!TITLE
loadtime keyword
!!TEXT 
      rusage keyword: loadtime
 
      The amount of time spent loading the matrix.
 

!!KEYWORD
loglog
!!TITLE
loglog keyword
!!TEXT 
      plot and gridtype keyword: loglog
 
      Use a log-log grid.
 

!!KEYWORD
lutime
!!TITLE
lutime keyword
!!TEXT 
      rusage keyword: lutime
 
      The amount of time spent doing transient L-U decomposition.
 

!!KEYWORD
nogrid
!!TITLE
nogrid keyword
!!TEXT
      plot and gridstyle keyword: nogrid
 
      Don't plot a grid.  The data will be plotted on a
      linear scale and only the border lines at the bottom
      and left sides of the screen will be drawn.
 

!!KEYWORD
nointerp
!!TITLE
nointerp keyword
!!TEXT 
      plot keyword: nointerp
 
      Normally asciiplot interpolates data onto a linear
      scale before plotting it.  If this option is given this
      won't be done - each line will correspond to one data
      point as generated by the simulation.
 
!!SEEALSO
asciiplot

!!KEYWORD
polar
!!TITLE
polar keyword
!!TEXT 
      plot keyword: polar
 
      Use a polar grid instead of a rectangular grid.
 
!!SEEALSO
smith

!!KEYWORD
pointplot
!!TITLE
pointplot keyword
!!TEXT 
      plot keyword: pointplot
 
      Plot data points as unconnected points.  Each sucessive
      expression is plotted with a different character to
      mark the points.  The characters used may be changed by
      setting the variable pointchars.
 

!!KEYWORD
rejected
!!TITLE
rejected keyword
!!TEXT 
      rusage keyword: rejected
 
      The number of rejected time points.
 

!!KEYWORD
samep
!!TITLE
samep keyword
!!TEXT 
      plot keyword: samep
 
      If this option appears anywhere on the command line,
      all the options used in the last plot command are used
      for the current one, overriding options on the current
      line if they appear on both lines.
 

!!KEYWORD
smith
!!TITLE
smith keyword
!!TEXT 
      plot keyword: smith
 
      Use a smith grid instead of a rectangular or polar
      grid.  There are a few problems, the major ones being
      that the grid is centered around the x-axis, and that
      too few labels are printed on the perimeter of the plot
      area.
 

!!KEYWORD
solvetime
!!TITLE
solvetime keyword
!!TEXT 
      rusage keyword: solvetime
 
      The amount of time spent solving the matrix.
 

!!KEYWORD
space
!!TITLE
space keyword
!!TEXT 
      rusage keyword: space
 
      The amount of data space currently used by the program.
 

!!KEYWORD
time
!!TITLE
time keyword
!!TEXT 
      rusage keyword: time
 
      The amount of time spent so far doing the current
      analysis.
 
 

!!KEYWORD
title
!!TITLE
title keyword
!!TEXT 
      plot keyword: title string
 
      The string will be used as the title printed near the
      bottom of the screen instead of the title of the plot
      that includes the first vector mentioned on the line
      that has one.
 

!!KEYWORD
totaltime
!!TITLE
totaltime keyword
!!TEXT 
      rusage keyword: totaltime
 
      The total amount of time spent by the program since it
      was started.
 

!!KEYWORD
totiter
!!TITLE
totiter keyword
!!TEXT 
      rusage keyword: totiter
 
      The total number of iterations.
 

!!KEYWORD
traniter
!!TITLE
traniter keyword
!!TEXT 
      rusage keyword: traniter
 
      The number of transient iterations.
 

!!KEYWORD
tranpoints
!!TITLE
tranpoints keyword
!!TEXT 
      rusage keyword: tranpoints
 
      The number of transient time points.
 

!!KEYWORD
transolvetime
!!TITLE
transolvetime keyword
!!TEXT 
      rusage keyword: transolvetime
 
      The amount transient solve time.
 

!!KEYWORD
trantime
!!TITLE
trantime keyword
!!TEXT 
      rusage keyword: trantime
 
      The total transient time so far.
 

!!KEYWORD
xcompress
!!TITLE
xcompress keyword
!!TEXT 
      plot keyword: xcompress value

      Plot only one out of every value points in each of the
      vectors.
 

!!KEYWORD
xdelta
!!TITLE
xdelta keyword
!!TEXT 
      plot keyword: xdelta value
 
      This value is used as the spacing between grid lines on
      the x-axis.
 

!!KEYWORD
xindices
!!TITLE
xindices keyword
!!TEXT 
      plot keyword: xindices lower upper
 
      Only data points with indices between lower and upper
      are plotted.  upper must be greater or equal to lower.
 

!!KEYWORD
xlabel
!!TITLE
xlabel keyword
!!TEXT 
      plot keyword: xlabel string
 
      The string is used as the label for the x-axis, instead
      of the name of the first scale used.
 

!!KEYWORD
xlimit
!!TITLE
xlimit keyword
!!TEXT 
      plot keyword: xlimit lower upper
 
      The plot area in the x-direction is restricted to lie
      between lower and upper.  The area actually used may be
      somewhat larger to provide nicely spaced grid lines,
      however.
 

!!KEYWORD
xlog
!!TITLE
xlog keyword
!!TEXT 
      plot and gridtype keyword: xlog
 
      Use a log scale for the x-axis and a linear scale for
      the y-axis.
 

!!KEYWORD
ydelta
!!TITLE
ydelta keyword
!!TEXT 
      plot keyword: ydelta value
 
      Use the value as the spacing between the grid lines on
      the y-axis.
 

!!KEYWORD
ylabel
!!TITLE
ylabel keyword
!!TEXT 
      plot keyword: ylabel string
 
      Use the string as the label for the y-axis.  (By
      default none is printed.)
 

!!KEYWORD
ylimit
!!TITLE
ylimit keyword
!!TEXT 
      plot keyword: ylimit lower upper
 
      Limit the plot area in the y-direction to lie between
      lower and upper.  It may be expanded slightly to allow
      for nicely spaced grid lines.
 

!!KEYWORD
ylog
!!TITLE
ylog keyword
!!TEXT 
      plot and gridtype keyword: ylog
 
      Use a log scale for the y-axis and a linear scale for
      the x-axis.
 


*****************************************************************
*
* Vector Operators
*
*****************************************************************

!!KEYWORD
operators
!!TITLE
Operators
!!TEXT 
      The operations available are described below.  They all take
      two operands, except for unary minus and unary negation (~).
 
!!SUBTOPICS
and
comma
divide
eq
ge
gt
ind
le
lt
minus
mod
ne
not
or
plus
power
ran
times

!!KEYWORD
ind
!!TITLE
Vector Indexing
!!TEXT 
      vector notation: value[index] or value[low, high]

      The first notation refers to the index'th element of
      value.  The second notation refers to all of the ele-
      ments of value which fall between the high'th and the
      low'th element, inclusive.  If high is less than low,
      the order of the elements in the result is reversed.
      Note that a complex index will have the same effect as
      using the real part for the lower value and the ima-
      ginary part for the upper, since this is the way the
      parser reads this expression.  Multi-dimensional vec-
      tors are referenced as Vec[indN][indN-1]...[ind0],
      where each of the indI can be a range, or single
      value.  The range must be within the vectors spanning
      space.  If fewer than the vector's dimensions are
      specified, the resulting object is a sub-dimensional
      vector.
 

!!KEYWORD
and
!!TITLE
and operator
!!TEXT 
      internal operator: and or &
 
      Evaluates to 1 if both operands are non-zero, 0 otherwise.
 

!!KEYWORD
comma
!!TITLE
comma operator
!!TEXT 
      internal operator: , (comma)

      The notation a , b refers to the complex number with
      real part a and imaginary part b.  Such a construction
      may not be used in the argument list to a macro func-
      tion, however, since commas are used to seperate the
      arguments and parentheses may be ignored.  The expres-
      sion a + j(b) is equivalent.
 

!!KEYWORD
divide
!!TITLE
divide operator
!!TEXT 
      internal operator: /
 
      The first operand divided by the second.
 

!!KEYWORD
eq
!!TITLE
eq operator
!!TEXT 
      internal operator: eq or =
 
      Evaluates to 1 if both operands are equal, 0 otherwise.
 

!!KEYWORD
ge
!!TITLE
ge operator
!!TEXT 
      internal operator: ge or >=

      Evaluates to 1 if the first operand is greater than or equal
      to the second, 0 otherwise.
 

!!KEYWORD
gt
!!TITLE
gt operator
!!TEXT 
      internal operator: gt or >
 
      Evaluates to 1 if the first operand is greater than the second,
      0 otherwise.
 

!!KEYWORD
le
!!TITLE
le operator
!!TEXT 
      internal oprerator: e or <=

      Evaluates to 1 if the first argument is less than or equal
      to the second, 0 otherwise.
 

!!KEYWORD
lt
!!TITLE
lt operator
!!TEXT 
      internal operator: lt or <
 
      Evaluates to 1 if the first argument is less than the second,
      0 otherwise.
 

!!KEYWORD
minus
!!TITLE
minus operator
!!TEXT 
      internal operator: -
 
      Evaluates to the first argument minus the second.  Also may
      be used as unary minus.
      In commands that take a list of vectors as arguments, such
      as plot and graf, one can force a unary minus with '--',
      for example:

      plot v(1) -v(4)
          would plot v(1)-v(4) (i.e., the difference) whereas
      plot v(1) --v(4)
          would plot v(1) and -v(4)  (two traces).
 

!!KEYWORD
mod
!!TITLE
mod operator
!!TEXT 
      internal operator: %
 
      The modulo operation.  The result is the remainder when
      the first number is divided by the second.  Note that
      both arguments are rounded down to the nearest integer
      before the operation is performed.
 

!!KEYWORD
ne
!!TITLE
ne operator
!!TEXT 
      internal operator: ne or <>
 
      Evaluates to 1 if the two operands are not equal, 0 otherwise.
 

!!KEYWORD
not
!!TITLE
not operator
!!TEXT 
      internal operator: not or ~
 
      Evaluates to 1 if the operand is 0, 0 otherwise.
 

!!KEYWORD
or
!!TITLE
or operator
!!TEXT 
      internal operator: or or |
 
      Evaluates to 1 if either of the two operands is 1, 0 otherwise.
 

!!KEYWORD
plus
!!TITLE
plus operator
!!TEXT 
      internal operator: +
 
      The add operation.
 

!!KEYWORD
power
!!TITLE
power operator
!!TEXT 
      internal operator: ^
 
      Evaluates to the first operand raised to the power of the
      second.  Note that if the base is less than 0, the exponent
      must be an integer.
 

!!KEYWORD
ran
!!TITLE
ran operator
!!TEXT 
      vector operator: value1[[value2]] or value[[low, high]]
 
      The first notation refers to all the elements of value1
      for which the element of the corresponding scale equals
      value2.  The second notation refers to all of the ele-
      ments of value for which the corresponding elements of
      the scale fall between high and low, inclusive.  If
      high is less than low, the order of the elements in the
      result is reversed.
 

!!KEYWORD
times
!!TITLE
times operator
!!TEXT 
      internal operator: *
 
      The multiplication operation.
 


*****************************************************************
*
* Predefined Constants
*
*****************************************************************

!!KEYWORD
constants
!!TITLE
Constants
!!TEXT 
      The following values are defined in a plot called the con-
      stant plot.  This is the default plot if no rawfile has been
      loaded and no simulation has been run.  Note that these con-
      stants are visible no matter what the current plot is, but
      they are overridden by a vector with the same name in the
      current plot.  These values are in MKS units.
 
 
!!SUBTOPICS
boltz
c
e
echarge
false
i
kelvin
no
pi
planck
true
yes

!!KEYWORD
boltz
!!TITLE
boltz constant
!!TEXT 
      internal constant: boltz
 
      Boltzman's constant (1.38062e-23 joules/degree kelvin).
 

!!KEYWORD
c
!!TITLE
c constant
!!TEXT 
      internal constant: c
 
      The speed of light (2.997925e8 meters/second).
 

!!KEYWORD
e
!!TITLE
e constant
!!TEXT 
      internal constant: e
 
      The base of natural logarithms (2.71828182844590452353).
 

!!KEYWORD
echarge
!!TITLE
echarge constant
!!TEXT 
      internal constant: echarge

      The charge on an electron (1.60219e-19 coulombs).
 

!!KEYWORD
false
!!TITLE
false constant
!!TEXT 
      internal constant: false

      Defined as 0.
 

!!KEYWORD
i
!!TITLE
i constant
!!TEXT 
      internal constant: i
 
      The square root of -1.  In our expression syntax, this
      may also be written as (0,1).
 

!!KEYWORD
kelvin
!!TITLE
kelvin constant
!!TEXT 
      internal constant: kelvin

      Absolute zero in centagrade (-273.15 degrees).
 

!!KEYWORD
no
!!TITLE
no constant
!!TEXT 
      internal constant: no
 
      Defined as 0.
 

!!KEYWORD
pi
!!TITLE
pi constant
!!TEXT 
      internal constant: pi
 
      Pi (3.14159265358979323846).
 

!!KEYWORD
planck
!!TITLE
planck constant
!!TEXT 
      internal constant: planck
 
      Planck's constant (6.62620e-34 joule-seconds).
 

!!KEYWORD
true
!!TITLE
true constant
!!TEXT 
      internal constant: true
 
      Defined as 1.
 

!!KEYWORD
yes
!!TITLE
yes constant
!!TEXT 
      internal constant: yes
 
      Defined as 1.
 


*****************************************************************
*
* Command Line Arguments
*
*****************************************************************

!!KEYWORD
arguments
!!TITLE
Command Line Arguments
!!TEXT 
      Nutmeg and spice take the following command line options.
      Additional arguments are taken to be circuit files in the
      case of spice, or raw data files to be loaded in the case of
      nutmeg.
 
!!SUBTOPICS
dash
dashb
dashd
dashi
dashn
dasho
dashq
dashr
dashs
dasht

!!KEYWORD
dash
!!TITLE
- cmdline option
!!TEXT 
      command line option: -
 
      Don't try load a rawfile (nutmeg only).  The default
      rawfile name is rawspice, which will be loaded in if no
      other filenames are given on the command line.
 

!!KEYWORD
dashb
!!TITLE
-b cmdline option
!!TEXT 
      command line option: -b
 
      Run in batch mode.  Instead of prompting the user
      interactively, spice will execute the source files
      given on the line, or if there are none, it will read
      from the standard input.  (spice only)
 
!!SEEALSO
batchmode

!!KEYWORD
dashd
!!TITLE
-d cmdline option
!!TEXT 
      command line option: -d

      The next argument is the name of the display to use for
      X.  The "display" variable is set to this string.  If not
      given, the DISPLAY environment variable is used, or the
      default display ":0.0" if the environment variable is not
      found.

!!SEEALSO
X
xdisplay

!!KEYWORD
dashi
!!TITLE
-i cmdline option
!!TEXT 
      command line option: -i
 
      Run in interactive (as opposed to batch) mode.  This is
      the default.  (spice only)
 

!!KEYWORD
dashn
!!TITLE
-n cmdline option
!!TEXT 
      command line option: -n
 
      Don't try to source the user's startup file (.spiceinit
      or spice.rc) upon startup.  Normally the program tries
      to find the file in the current directory, and if it is
      not found then it checks in the user's home directory
      (if in UNIX).
 

!!KEYWORD
dasho
!!TITLE
-o cmdline option
!!TEXT 
      command line option: -o outfile

      Open the given file for output, instead of sending out-
      put to the terminal.
 

!!KEYWORD
dashq
!!TITLE
-q cmdline option
!!TEXT 
      command line option: -q
 
      Disable command completion.  This prevents initial loading
      of the command completion data structures.  If the variable
      nocc is set and unset, command completion will be turned
      on, however most internal keywords will not be present in
      the database.
 
!!SEEALSO
ccom
nocc

!!KEYWORD
dashr
!!TITLE
-r cmdline option
!!TEXT 
      command line option: -r
 
      Use the named file for dumping data if this is spice in
      batch mode, and use it as the default rawfile for the
      write command.  Note that if the program is nutmeg,
      this option will not cause the named file to be loaded.
 

!!KEYWORD
dashs
!!TITLE
-s cmdline option
!!TEXT 
      command line option: -s
 
      Run in server mode.  This is like batch mode, and is
      used by the spice daemon.  Spice will read from the
      standard input up to an EOF, and then after it is fin-
      ished it will send a line consisting of one `@' and
      then the contents of the rawfile to the standard out-
      put.  (spice only)
 
!!SEEALSO
batchmode

!!KEYWORD
dasht
!!TITLE
-t cmdline option
!!TEXT 
      command line option: -t term

      The program is being run on a terminal with MFB name
      term.  (MFB is the graphics package used for dumb
      graphics terminals in UNIX.) Note that MFB names are
      often not the same as termcap names, so this option is
      needed to override the TERM environment variable.
 
      Under extended DOS, this option can be used to set the
      display resolution in graphics mode.  See the description
      for the "term" variable.
 
!!SEEALSO
term

*****************************************************************
*
* SCED
*
*****************************************************************

!!KEYWORD
sced
!!TITLE
SCED input editor
!!TEXT 
      command: sced
 
      The SCED interface is a comprehensive graphical input system
      for spice.  One creates a circuit by adding elements and
      connecting with wires.  Subcircuits are supported, and are
      added to a circuit in a manner similar to adding devices.
      
      Device properties are attached to the devices in the circuit,
      and models are pulled from an external library.  A spice
      input deck is created for the circuit, and can be analyzed
      and plotted from within the SCED interface.  Most spice
      commands are also available from within the interface.
 
!!SUBTOPICS
sced:keyboard
sced:commands
sced:pointer
sced:textedit

!!KEYWORD
sced:area
!!TITLE
area
!!TEXT 
      Perform an area select operation.  The user points at the
      diagonal endpoints of an area in which all overlapping
      objects are selected.
 
!!SEEALSO
sced:selec
sced:desel

!!KEYWORD
sced:bang
!!TITLE
!
!!TEXT 
      Text following an exclamation point is processed by the
      spice shell.  Use this for simple jspice3 commands such
      as for setting variables, etc.  Most commands which are
      non-interactive work in this mode, including the plot
      command.
 
!!SEEALSO
sced:textedit

!!KEYWORD
sced:bgrnd
!!TITLE
bgrnd
!!TEXT 
      Set the color of the background.
 
!!SEEALSO
sced:chgcolor

!!KEYWORD
sced:break
!!TITLE
break
!!TEXT 
      An electrical connection to a wire can exist only at a
      vertex.  The break command allows a connection at an
      arbitrary location by cutting the selected wire at the
      indicated point.
        
      If wires have been selected, the break command will operate
      on those selections.  Otherwise, the user is asked to point
      to a wire.  The user is then asked to point along the break
      line.  If the user points at the selected wire, then it, and
      all other selected wires (if any) are cut along the nearest
      grid line, with the cut orientation determined by the
      orientation of the wire segment which was pointed to.  If
      the user does not point at a selected wire, the cut is made
      at the nearest grid line with orientation set by the current
      rotation (0,180 vertical, otherwise horizontal).  If a wire
      segment is non-Manhattan, then it can not be pointed at to
      select the orientation, and the current rotation angle is
      used.  The break can be undone with the undo command, before
      exiting the break command.
 
!!SEEALSO
sced:rotate
sced:undo

!!KEYWORD
sced:chgcolor
!!TITLE
+r, etc
!!TEXT 
      The "-r", "+r", etc. buttons decrease or increase the
      intensity of the color component of the currently selected
      screen attribute.  The default selection is the drawing
      color.  The updated colormap can be saved with the update
      command.
 
!!SEEALSO
sced:bgrnd
sced:grid
sced:hlite
sced:menu
sced:more
sced:prmpt
sced:updat

!!KEYWORD
sced:color
!!TITLE
color
!!TEXT 
      This command displays a submenu of commands which change 
      screen colors and other attributes.  The new choices can
      be saved with the updat command.
 
!!SEEALSO
sced:bgrnd
sced:chgcolor
sced:grid
sced:hlite
sced:menu
sced:more
sced:prmpt
sced:updat

!!KEYWORD
sced:commands
!!TITLE
Menu Commands
!!TEXT 
      Commands are entered either by typing the colored prefix as
      shown in the menu, or by pointing.  Commands can be
      terminated with the ESC key.
 
!!SUBTOPICS
sced:area
sced:bgrnd
sced:break
sced:color
sced:chgcolor
sced:copy
sced:crsym
sced:delet
sced:desel
sced:dir
sced:edit
sced:expnd
sced:flatn
sced:graf
sced:grid
sced:hcopy
sced:help
sced:hlite
sced:iplot
sced:label
sced:last
sced:menu
sced:mirror
sced:more
sced:move
sced:mutul
sced:newsc
sced:pan
sced:place
sced:pop
sced:prmpt
sced:prpty
sced:push
sced:quit
sced:rgb
sced:rotate
sced:run
sced:save
sced:selec
sced:strch
sced:subct
sced:terms
sced:undo
sced:updat
sced:view
sced:windo
sced:wires
sced:zoom

!!KEYWORD
sced:copy
!!TITLE
copy
!!TEXT 
      Copy objects to other locations.  If items are selected, then
      all of the selected objects will be copied.  Otherwise, the
      user is asked to point to an object to copy, and a reference
      point.  The copied objects will be rotated and mirrored
      according to the current transform.  Multiple copies can be
      made by simply pointing to new locations.  The last operation
      can be undone with the undo command.
 
!!SEEALSO
sced:mirror
sced:rotate
sced:undo

!!KEYWORD
sced:crsym
!!TITLE
crsym
!!TEXT 
      The selected objects are used to create a new symbol.  The
      user is prompted for the new symbol name.  The new symbol is
      written to disk in the current directory.  Note that the new
      symbol is not a subcircuit.  It must be edited and connection
      points added before it can be used in another circuit.
 
!!SEEALSO
sced:subct

!!KEYWORD
sced:ctrla
!!TITLE
Control-A
!!TEXT 
      Typing ^A causes execution of the SCED quit procedure.
 
!!SEEALSO
sced:quit

!!KEYWORD
sced:ctrlf
!!TITLE
Control-F
!!TEXT 
      Wait for the user to point.  Then redisplay the fine viewport
      around the new location, or if in full screen mode pan to the
      new location.
 
!!SEEALSO
sced:pan

!!KEYWORD
sced:ctrlg
!!TITLE
Control-G
!!TEXT 
      Change the magnification of the fine viewport, or if in full
      screen mode perform a window operation, using the next two
      point operations as the new window corners.
 
!!SEEALSO
sced:windo

!!KEYWORD
sced:ctrln
!!TITLE
Control-N
!!TEXT 
      Save the present view.  The view can be returned to with the
      last command.
 
!!SEEALSO
sced:last

!!KEYWORD
sced:ctrlt
!!TITLE
Control-T
!!TEXT 
      Toggle the position of the fine viewport (if visible),
      bottom or right.
 

!!KEYWORD
sced:delet
!!TITLE
delet
!!TEXT 
      The selected objects are deleted.  This can be undone before
      exiting the delete command with the undo command.
 
!!SEEALSO
sced:area
sced:selec
sced:undo

!!KEYWORD
sced:desel
!!TITLE
desel
!!TEXT 
      The selected objects are deselected.
 
!!SEEALSO
sced:area
sced:selec

!!KEYWORD
sced:dir
!!TITLE
dir
!!TEXT 
      The current path as set in spice is scanned for symbol
      files, and the listing displayed.
 

!!KEYWORD
sced:dots
!!TITLE
dots
!!TEXT 
      Mark ambiguous connection points with a dot.  Dots are only
      placed at connection points, which include: wire vertices
      common to two or more wires (except for common end vertices
      of two wires), non-endpoint wire vertices common with device
      or subcircuit terminals, and any point common to three or
      more terminals or wire vertices.  Dots can only be shown
      during non-modifying "safe" commands, such as "hcopy".
 

!!KEYWORD
sced:edit
!!TITLE
edit
!!TEXT 
      Edit a new or existing circuit.  The circuit name is
      requested from the user, and the path searched for an
      occurrence of the circuit.  If no match is found, a new
      circuit is opened.  If a match is found and the file is
      not a circuit file, the file is opened for text editing.
      If the name of the file is "model.lib", the spice model
      database can be updated.  If no model.lib file exists
      in the current directory, a copy of the system model.lib
      is placed there before the edit starts.  This new file
      will supersede the system file if the current directory
      appears in the spice path before the system directory,
      which it does by default.  The internal model database
      is updated after the edit of any file named "model.lib".
      In the graf command, selecting edit allows the string
      sent to the jspice3 graf command to be edited.
 

!!KEYWORD
sced:escape
!!TITLE
Escape
!!TEXT 
      The ESC key will teminate the current SCED command without
      performing additional actions.  It also clears the keyboard
      buffer.
 

!!KEYWORD
sced:expnd
!!TITLE
expnd
!!TEXT 
      Subcircuits will be shown in expanded form when this toggle
      is selected.
 

!!KEYWORD
sced:flatn
!!TITLE
flatn
!!TEXT 
      Smash the selected subcircuits into the parent circuit.  The
      resulting hierarchy is flat.
 

!!KEYWORD
sced:graf
!!TITLE
graf
!!TEXT 
      Allows nodes and branches in the circuit to be tagged for
      plotting output after simulation.  Point to any part of a 
      wire to set a node mark.  One can also point to inductors
      and voltage sources to plot branch currents.  You must
      point within 5 pixels of the branch point defined in the
      device.lib file, the default is the middle of the circle
      for voltage sources, and the middle of the inductor along
      the line of the connection points.  Pointing at the same
      node or branch a second time will remove the tag.

      To actually plot the data, select the graf command again.
      One can examine and edit the string sent to the jspice3
      graf command by pointing at the edit menu entry.  The
      string is printed in edit mode, so one can modify it.
      Hit ENTER to plot, ESC to exit without plotting.
 
!!SEEALSO
sced:iplot

!!KEYWORD
sced:grid
!!TITLE
grid
!!TEXT 
      Set the grid spacing.  The snap locations are fixed at one
      unit.  If called from the color submenu, the fine and coarse
      grid colors can be set.  Point in the drawing window to
      continue.
 

!!KEYWORD
sced:hcopy
!!TITLE
hcopy
!!TEXT 
      Produce a hard copy of the current circuit.  The printer
      and format used are set by the spice "hcopydev" and
      "hcopydevtype" variables.
 

!!KEYWORD
sced:help
!!TITLE
help
!!TEXT 
      Entry to the help system.  Point at the commands for
      information on usage, hit ESC to exit.
 
!!SEEALSO
sced

!!KEYWORD
sced:hlite
!!TITLE
hlite
!!TEXT 
      Set the color of the cursor and highlighted objects.
 
!!SEEALSO
sced:chgcolor

!!KEYWORD
sced:iplot
!!TITLE
iplot
!!TEXT 
      If set, the presently selected points from the graf command
      will be plotted while simulating.
 
!!SEEALSO
sced:graf

!!KEYWORD
sced:keyboard
!!TITLE
Keyboard Commands
!!TEXT 
      Menu commands are selected from the keyboard by typing the
      colored prefix.  In addition, there are several control
      character commands recognized.
 
!!SUBTOPICS
sced:bang
sced:ctrla
sced:ctrlf
sced:ctrlg
sced:ctrln
sced:ctrlt
sced:escape
!!SEEALSO
sced:textedit

!!KEYWORD
sced:label
!!TITLE
label
!!TEXT 
      Place text labels at arbitrary locations in the circuit.
      The labels have no electrical function.  The orientation of
      the label is determined by the current transform.  The label
      can contain white space, however white space characters are 
      replaced internally with the underscore '_' character, so
      that underscores map to spaces in the displayed text.
 
!!SEEALSO
sced:mirror

!!KEYWORD
sced:last
!!TITLE
last
!!TEXT 
      Display the previous view, or a previously saved view.  The
      views are saved by entering ^N (control-n).  Each saved view
      is assigned a letter.  The user is given a menu of choices
      if there are more than one.
 
!!SEEALSO
sced:ctrln

!!KEYWORD
sced:menu
!!TITLE
menu
!!TEXT 
      Set the colors for the menu text display.  Point to the
      drawing window to continue, each color used in the menu
      text can be set in order.
 
!!SEEALSO
sced:chgcolor

!!KEYWORD
sced:mirror
!!TITLE
MX and MY
!!TEXT 
      When selected MX will mirror left to right copied or moved
      objects and newly placed devices.  Similarly, MY will mirror
      top to bottom.
 

!!KEYWORD
sced:more
!!TITLE
more
!!TEXT 
      Set the color for the text used to display spice command
      output in the large viewport.
 
!!SEEALSO
sced:chgcolor

!!KEYWORD
sced:move
!!TITLE
move
!!TEXT 
      Move an object or objects in the circuit.  If no objects
      are selected, the user is asked to point to one, and to a
      reference point.  The user then points to the destination,
      and the chosen objects will be moved to the new location.
      The orientation will change according to the current
      transform.  A move can be undone with the undo command.
 
!!SEEALSO
sced:mirror
sced:rotate
sced:undo

!!KEYWORD
sced:mutul
!!TITLE
mutul
!!TEXT 
      This command allows previously added inductors to be coupled
      electrically by mutual inductance.  The user is asked to
      point to the inductors to be coupled, and supply the
      coupling "k" factor.
 

!!KEYWORD
sced:newsc
!!TITLE
newsc
!!TEXT 
      This command prompts the user for the name of a subcircuit
      to add to the subcircuit menu.  The subcircuit must have
      been created previously, and stored in the current path.
 

!!KEYWORD
sced:pan
!!TITLE
pan
!!TEXT 
      The coarse viewport (or viewport, if in full screen mode) is 
      centered on the new location to which the user points.
 

!!KEYWORD
sced:place
!!TITLE
place
!!TEXT 
      Devices and subcircuits can be selected from the menu, and
      placed on the drawing where the user points.  The object is
      transformed according to the current transform settings.
 

!!KEYWORD
sced:pointer
!!TITLE
Pointing Device
!!TEXT 
      SCED supports three types of pointing device: the keyboard,
      a Microsoft compatible mouse, or a Summagraphics compatible
      digitizing pad.  This selection is made in the mfb.rc file
      in the system directory (see your system guru).  Each
      pointing device has 4 "buttons":
        
             Button 1 (yellow) or keyboard ENTER:
                 Basic "point" operation.
        
             Button 2 (white) or keyboard control-ENTER (LF):
                 Pan to new location (full screen) or move fine
                 window center to new location (split screen).
        
             Button 3 (green) or keyboard ALT-ENTER: 
                 Point using button 3 twice to set corners of a
                 new window, or fine window position in split
                 screen mode.
                 
             Button 4 (blue) or keyboard DELETE:
                 no function in SCED
 

!!KEYWORD
sced:pop
!!TITLE
pop
!!TEXT 
      Pop the circuit currently being edited to the parent of the
      present circuit.
 
!!SEEALSO
sced:push

!!KEYWORD
sced:prmpt
!!TITLE
prmpt
!!TEXT 
      Set the color for message line text.
 
!!SEEALSO
sced:chgcolor

!!KEYWORD
sced:prpty
!!TITLE
prpty
!!TEXT 
      Add properties to the devices in the circuit.  This is the
      means by which spice obtains values and other nontopological
      information.  If devices have been selected, one can enter
      "*" at the prompt, and the property to be entered will be
      added to or replace the similar property of each selected
      device.  This feature should be used with care, as it is
      possible to add inappropriate properties, the added
      property should make sense for each device selected.
      Otherwise, properties will be (potentially) modified in
      each of the selected objects in order.  If no devices are
      selected, the user is asked to point to select a device.
      
      The properties of the selected device are then displayed on
      the message line.  After each property is displayed, a ">"
      prompt appears, to which the user can respond with a,d,n, or
      ENTER.  In addition, ESC terminates the command at any time.
      
         ENTER :   Display the next property.
         n     :   Show the properties of the next device (if any).
         d     :   Delete the present property.
         a     :   Add or replace a property.
      
      Properties are added or modified with the a command. There
      are four property types which are modifiable by the user:
      model, value, init cnds, and other.  Model, value, and init
      cnds each contain the appropriate part of a spice element
      line.  Other properties are not used by spice, but can be
      used to keep alternate values of the model, value, and init
      cnd properties.
      
      After entering a, the user is prompted for the property type
      to modify.  Simply hitting ENTER at this point will accept
      the currently displayed property. There is only one value,
      model, and init cnd property per device, so each of these
      properties will be replaced.  There can be arbitrarily many
      other properties, however.
      
      If the user has selected a, then o (for other), a list of
      existing properties is presented.  These properties can be
      used to create the new other property.  For example, if a
      value property exists, selecting v at this point will read
      the text of the value property into the editor for the new
      other property.  If the currently displayed property is also
      an other prrperty, hitting ENTER will add this text to the
      editor for the new property, and this other property will be
      replaced ultimately by the modified text.  Otherwise, a new
      other property will ultimately be created.
      
      Once the new property text is edited, terminate editing by
      hitting ENTER.  If the new property is not an other property,
      the new property will be added to the list, or replace the
      current property of the same type if it exists.  If the new
      property is an other property, the user is promped for
      another property type into which the new property text is
      also saved.  For example, if the user selects v (for value)
      the new other property text is used to create or update the
      value property, in addition to being saved independently (or
      updated, if the text came from an other property). Hit Enter
      to bypass this feature.  Thus, the other properties can be
      used for storage for modified versions of the device
      parameters.
      
      Once editing is complete, the listing of properties for the
      currently marked device resumes.
 
!!SEEALSO
sced:textedit

!!KEYWORD
sced:push
!!TITLE
push
!!TEXT 
      If subcircuits are selected, push the current editing context
      to the first selected subcircuit on the list (most recently
      selected).  Otherwise, the user is requested to point to a
      subcircuit to push to.  The chosen subcircuit is displayed
      for editing in its true orientation, with surrounding context
      shown.
 
!!SEEALSO
sced:pop

!!KEYWORD
sced:quit
!!TITLE
quit
!!TEXT 
      Return to spice.  If the present circuit has been modified,
      the user is prompted for comfirmation before exiting.
 
!!SEEALSO
sced:ctrla

!!KEYWORD
sced:rgb
!!TITLE
rgb
!!TEXT 
      Print the Red - Green - Blue values for the currently
      selected display attrubute.
 
!!SEEALSO
sced:chgcolor

!!KEYWORD
sced:rotate
!!TITLE
0 90 180 270
!!TEXT 
      This menu item toggles between 0, 90, 180, and 270, and
      represents the angle by which new devices and moved or copied
      objects are rotated before placement.  It also controls the
      orientation of the cut in the break command.
 
!!SEEALSO
sced:break
sced:copy
sced:move
sced:place

!!KEYWORD
sced:run
!!TITLE
run
!!TEXT 
      Run a spice analysis of the current circuit.  The user is
      prompted for the analysis string.
 

!!KEYWORD
sced:save
!!TITLE
save
!!TEXT 
      Save the circuit currently being edited to disk.  The user is
      given the option of saving the circuit under a new name.  If
      this option is chosen, and if the circuit is being edited in
      a subedit, the user is given the option of changing parent
      cell references to the new cell name.
 
!!SEEALSO
sced:push

!!KEYWORD
sced:selec
!!TITLE
selec
!!TEXT 
      One can select objects for manipulation by other commands by
      pointing at them.  The selected objects are highlighted.
 
!!SEEALSO
sced:area
sced:desel

!!KEYWORD
sced:strch
!!TITLE
strch
!!TEXT 
      This command allows wire vertices to be stretched to new
      locations.  Operation is on all wires selected, and if no
      wires are currently selected, the user is requested to point
      to select one.  The user is then requested to point to a
      vertex (the nearest vertex of the chosen wire(s) is taken as
      the reference) and to the destination point.  The chosen
      vertex is moved to the destination point, and the vertices
      of other selected wires (if any) closest to the reference
      point are also moved with the same transform.  This can be
      undone with the undo command.
 
!!SEEALSO
sced:undo

!!KEYWORD
sced:subct
!!TITLE
subct
!!TEXT 
      This command allows electrical connection points to be added
      to a circuit, which is necessary if the circuit is to be used
      as a subcircuit in another circuit.  The terminals are points
      at which electrical connections are defined, as in the spice
      subcircuit definition.  In the color submenu, this command
      changes the color of the outlining box and label of
      unexpanded subcircuits.  Point in the drawing window to
      continue while in this mode.
 

!!KEYWORD
sced:terms
!!TITLE
terms
!!TEXT 
      When this indicator is selected, the electrical connection
      points of the circuit being edited are indicated.  These
      points are placed with the subckt command.
 
!!SEEALSO
sced:subct

!!KEYWORD
sced:textedit
!!TITLE
Text Editing
!!TEXT 
      SCED contains a new hypertext editing capability.  This
      is necessary, for example, when setting device properties
      which reference other devices or nodes.  The device names
      and node numbers are somewhat arbitrary, and change if the
      circuit is modified, thus property text could become
      invalid.  Instead, internally, strings are stored as data
      structures which reference pure text as well as devices
      and nodes by internal reference.  Thus, these hypertext
      strings are always valid.

      One accesses a hypertext reference by pointing at the
      schematic while in editing mode.  The returned data can be
      a node reference, a device branch reference, or a device
      name.  The string, as currently defined, is inserted into
      the displayed text in color.  Note that you can only delete
      the whole item with the DEL and BSP keys, the hypertext
      references are treated as single items.

      In text edit mode, the arrow keys move the cursor back and
      forth, BSP deletes the character or hypertext reference to
      the left of the cursor and moves the cursor to the left,
      and DEL deletes the object at the cursor.  ^U and ^X delete
      the entire line.  ESC exits edit mode, discarding the input.
      ENTER exits edit mode, saving the input.


!!KEYWORD
sced:undo
!!TITLE
undo
!!TEXT 
      Many commands can be undone from within those commands by
      issuing the undo command.  Outside of another command, undo
      has no effect.
 

!!KEYWORD
sced:updat
!!TITLE
updat
!!TEXT 
      The current screen colors and other attributes are saved in
      the file named sced.rc in the current directory.  If this
      file is found along the spice search when SCED is initially
      invoked, its contents are read to set the screen attributes.
 

!!KEYWORD
sced:view
!!TITLE
view
!!TEXT 
      Displays the current circuit centered and fully.
 

!!KEYWORD
sced:windo
!!TITLE
windo
!!TEXT 
      Allows changing the position and size of the window (coarse
      window in split screen mode).  Point to the corners of the
      new window.
 
!!SEEALSO
sced:zoom

!!KEYWORD
sced:wires
!!TITLE
wires
!!TEXT 
      Create wires for connecting devices and subcircuits.
      Terminate a wire by pointing at the same location twice.
      Only vertices are recognized as electrical connections.
      The undo command removes the last vertex or wire created.
 
!!SEEALSO
sced:undo

!!KEYWORD
sced:zoom
!!TITLE
zoom
!!TEXT 
      Change the window width (coarse window in split screen mode)
      and toggle between split screen and full screen modes.  The
      user is given the current width in arbitrary units, and
      responds with a new width, or ENTER.  The window width is
      either changed to the new width, or the display mode is 
      toggled.
 
*****************************************************************
*
* changes.doc file
*
*****************************************************************

!!KEYWORD
new
!!TITLE
New Features and Updates
!!TEXT 
 **************************************************************************
 Late news (1/28/95) Release 2.4

 The X-windows graphics interface was revised and updated.  It is
 now possible to straightforwardly set screen colors using the
 X resource database.  New features were added to the plotting
 windows, including dump-to-file and help.  A new command "setrdb"
 was added to set resources from within jspice3 or nutmeg.  See
 "help X" for more information.

 An internal editor called "xeditor" was added.  This is invoked
 with the xeditor command, or from the edit command if the editor
 variable is unset or set to "xeditor".  This editor has the
 advantage of being on-screen at all times, and the circuit can
 be sourced to jspice3 without quitting.  See "help xeditor".
 This is available under X only.  A stand-alone xeditor program
 is also provided.

 Jspice3 and supporting programs have been ported to FreeBSD 2.0.

 The makefiles and configuration files have been entirely replaced.
 It is now possible to build the programs by typing "build" in the
 top directory, with a minimum of configuration (on any reasonable
 operating system).

 X11 releases 4 through 6 are supported.

 All known bugs fixed.

 **************************************************************************
 Late news (4/3/94)
 
 A hypertext system was added to SCED, so property strings that access
 nodes and devices won't become bogus if the circuit changes.  The entries
 are generated by pointing at the screen in text edit mode, and the
 resulting string is shown in color.  The colored references are updated
 when the circuit changes.
 
 In SCED, with the graf command active, pointing at edit allows the string
 which is to be sent to the jspice3 graf command to be edited.
 
 Also in SCED, to reference a branch, you have to point at the branch
 point of the inductor or voltage source, not just at the device.  The
 branch point of voltage sources is the middle of the circle, for
 inductors it is the middle of the device in line with the connection
 points.  Otherwise, just the name of the device is returned, but you
 can add the "#branch" in the text just as well.
 
 When you edit model.lib in SCED, if no model.lib file exists in the
 current directory, a copy of the system model.lib will be copied there
 before the edit starts.  This avoids doing this by hand, and the user
 needing to know where the system model.lib is kept.
 
 If you use the jspice3 edit command and quit without saving the file,
 it will not be sourced if it has been sourced previously.
 
 When exiting sced, the file sourced (if any) is the last one being
 edited in sced.  Previously this was the file sced was called with
 (or "noname", if no argument was given).
 
 **************************************************************************
 Late news (2/28/94)
 
 White space before the first character in spice input lines is now ignored.
 
 The show command now uses ',' to separate the device list from the
 parameters, for compatibility with subcircuits.  The alter command is
 still not implemented.
 
 **************************************************************************
 Late news (12/17/93)
 
 version 2.3
 The analysis routines have been rewritten and modularized.  This enables
 a new jspice3 feature: nested dc analysis.  This allows most analyses
 to have an additional dc transfer specification, resulting in the
 analysis being performed at each dc operating point, producing a multi-
 dimensional output plot.  The new analysis specifications are as follows:
 
     .dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]]  (same as before)
 
     .ac {DEC OCT LIN} NP FSTART FSTOP [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]
 
     .noise V(OUTPUT) SRC {DEC OCT LIN} NP FSTART FSTOP [PTSPRSUM]
         [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]
 
     .tf {vsrc v(node1[,node2])} src [ac {dec oct lin} pts fstart fstop]
         [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]
 
     .sens output [ac {dec lin oct} NP FSTART FSTOP]
         [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]
 
     .tran Tstep Tstop [Tstart] [Tmax] [UIC]
         [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
         [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]
 
 For the basic dc specification, vstop and vstep ane now optional.  If vstop
 is not given, only vstart is analyzed.  If vstep is not given, analysis
 takes place at vstart and vstop.
 
 Note that ac capability has been added to tf (transfer function) analysis.
 
 For example:
 
   .ac dec 10 1Hz 1Mhz dc v1 0 2 .1 v2 4.5 5.5 .25
 
 will perform an ac analysis with the dc sources v1 and v2 stepped through
 the respective ranges.  The resulting output vectors will have dimensions
 [21,5,61].  Typing "plot v(1)" (for example) would plot all 21*5 analyses
 on the same scale (you probably don't want to do this).  You can also
 type "plot v(1)[1]" to plot the results for v1 = .1, or "plot v(1)[1][0]"
 for v1 = .1, v2 = 4.5, etc.  Range specifications also work, for example
 "plot v(1)[2][0,2]" plots the values for v1 = .2, v2 = 4.5,4.75,5.0.
 
 Warning: The memory space required to hold the plot data can grow quite
 large, so be reasonable.
 
 In the commands that take a list of vectors as arguments, such as plot and
 graf, one can now force a unary minus with '--', for example:
 
   plot v(1) -v(4)  would plot v(1)-v(4)  (i.e., the difference) whereas
   plot v(1) --v(4) would plot v(1) and -v(4)  (two traces).
 
 plot v(1) vs -v(4) now works properly.
 
 There is a new command "loop".  This command works like the dc command,
 but changes the values of $value1 and $value2 as in the margin analysis
 command "check.  The syntax is:
 
 loop min1 [max1 [step1]] [min2 [max2 step2]]] [analysis]
 
 A multi-dimensional plot will be produced.  If "analysis" is omitted,
 an analysis spec is expected to be found in the deck.  Only one analysis
 can be specified (no dc nesting).  The deck should contain $value1
 and $value2 (if used) for substitution, and be the current circuit.
 Ignore any warnings issued when the circuit is loaded, which occur if
 these variables were not previously set.
 
 the "graf" command now handles multi-dimensional plots.  The scale must
 still be monotonically increasing within a dimension, however.  True for
 "iplot graf" as well.
 
 **************************************************************************
 Late news (11/15/93)
 
 multi-dimensional vector support enhanced.  dctrcurv in two dims now 
 produces 2d plot (plot command handles this, graf doesn't).  Rawfile
 read/write supports dimensions.  deriv function added.  partial support
 for sublists added.  Only one dimension can be specified, operates on
 major dimension of variable with sublists.  Full dimension spec on
 vectors.  $& keeps structure intact.
 
 **************************************************************************
 Late news (11/2/93)
 
 Took everything apart, put it back together again.  May be bugs!
 
 Installed a set of hashing functions (new file: misc/hash.c) which are
 now used for selecting codeblocks, commands, and vectors.  This should
 speed up script execution by eliminating linear searches and string
 comparisons.
 
 The options.c file was rewritten to use the new hash functions to identify
 internal keywords.  All internal keywords (except some really strange ones
 that probably will be removed) are now defined in a single table in
 options.c.  The "user" keywords and "front end" keywords are now combined
 into this single database.
 
 The operating range "check" command now generates its own plot, where it
 stores all circuit and defined vectors, rather than using the constants
 plot.  This required the generation of a second internal codeblock,
 prefixed with "##" containing the header commands.
 
 **************************************************************************
 Late news (10/12/93)
 
 The diagnostic command "dump" now works - it prints out the current
 matrix.
 
 Fixed an obscure bug in the sparse matrix package which sometimes caused
 nonconvergence in dc analysis with inductors and sfft's.
 
 More internal rearrangement, separated the analysis routines into their
 own library.
 
 Fixed some misc. bugs which caused random segmentation faults.
 
 The graphics now supports the VGA drivers supplied with djgcc in DOS.
 This means that other than the Tseng super VGA modes should now be
 possible.  See the readme file in the src\lib\dosmfb directory.
 
 **************************************************************************
 Late news (9/19/93)
 
 The DOS makefiles were streamlined somewhat, and a new version of the
 make program was produced.  This new version should be used to make
 jspice3 for DOS.  You can now "make clean".
 
 The testsys routines are included (DOS only) if "set has_stim=HAS_STIM"
 is issued first.  This affects files in the testsys directory, and inp.c
 and spcmdtab.c in the spfte directory.
 
 **************************************************************************
 Late news (8/28/93)
 
 A flux flow transistor (SFFT) model was added.
 
 Internal changes were made to facilitate adding devices,
 eliminating the need for some files.
 
 The default spice directory has changed, see conf/defaults.
 
 The names of the extended DOS configuration files were changed,
 previously tunexd.c got clobbered by "util/build clean" in unix.
 tunexd.c -> xdtune.c, confxd.c -> xdsconf.c, nconfxd.c -> xdnconf.c
 
 ^V can be used for backslash quoting, as backslash quoting (with a \) is
 not enabled under DOS.
 
 In SCED, the graf pointer icons have been changed to indicate the
 trace number - pretty slick.
 
 Also in SCED, the input prompting has been changed to respond to
 point events in the following way.  During inputting, if you point
 to a node or branch (as in the graf command) the name of the node
 or branch will be placed in the text.  This is useful, because
 SCED assigns these names, and previously the only way to find out what
 they are was with the prpty command.  WARNING: these names may change
 if the circuit topology changes.  For example, you might get hurt
 if you use these names in voltage source property strings, as after
 a change the referenced node number might change, but not the
 property string.
 
 The plot command has been modified to correctly handle two dimensional
 dc analysis plots.  These don't work in graf, as the scale is not
 monotonic.  This can give a nice family of device i-v curves, but
 alas not for Josephson junctions.
 
 **************************************************************************
 Late news (7/11/93)
 
 The help text was updated.
 
 The compose command was extended - see help.
 
 A new internal vector command was added: gauss() - see help.
 
 The rnd() internal vector command now works as it should.
 
 The shell now interprets forms like $&v($something), so that in scripts,
 one can index the node voltages as "echo $&v($&i)", for example.  A range
 specification can be added.

 *************************************************************************
 Late news (6/27/93)
 
 The jj model was modified to make use of the stored voltage derivative
 in phase integration, which should give better accuracy without much
 cost in computation time.
 
 In sced, one can now use the "edit" command to edit text files.  If the
 named file exists and is not a sced file, a new window is presented
 which contains the editor loaded with the named file.  If the name of
 the file being edited is "model.lib", the model library will be updated.
 Thus, if during the edit the model.lib file is saved in the path,
 new model parameters can be input to a sced run without exiting sced.
 
 In sced, in the "prpty" command, one can now assign a property to all
 previously selected objects at once.  Enter "*" at the first prompt, then
 the following entry will add/replace in each of the selected objects.  Thus,
 one can select a number of resistors, and use the prpty command to set all
 the values to 50 ohms at once.  One should make sure that ridiculous
 properties are not assigned in error, i.e., make sure that the property
 makes sense for all selected objects.
 
 The sced "dots" command now works differently.  With "dots" selected,
 the dots, as set by sced, are shown.  The circuit can not be modified
 with the dots visible, but all non-modifying commands, such as "hcopy"
 work.
 
 The postscript driver now handles label text and dots decently.
 
 
 The "build install" script now works.
 
 *************************************************************************
 Late news

 $variables are now substituted for in the spice deck, as it is being
 read in.  These variables have to have been previously defined.  Since
 control statements in the deck are evaluated after the circuit is read in,
 the following doesn't work:
 
 .control
 foreach XX 1 2 3
         run
 end
 .endc
 spice deck
 v1 1 0 $XX
 r1 1 0 100
 .tran 1p 100p
 .end
  
 Use this instead (from command line or separate file):
  
 foreach XX 1 2 3
         spicedeck
         run
 end
  
 where the file "spicedeck" is
  
 spice deck
 v1 1 0 $XX
 r1 1 0 100
 .tran 1p 100p
 .end
  
 You can also use the "set" command to set the variables before the
 file is loaded.
 
 The <> construct for "not equal" now works.
 
 Space is now allowed in range specifications in shell variables without
 causing strangeness:  $a[ 2 ] is equivalent to $a[2].
 
 Vector range specification now works: values[index] works in vector
 expressions.  Previously the range was always set to 0.
 
 Parser errors now print the offending text.
 
 An internal stack is now maintained for the argc, argv[] variables.  These
 shell variables can not be altered directly by the user, but are set
 automatically on entry and exit from scripts - but NOT if the script
 is started with the source command.  Argc is the argument count, argv
 is a word vector of the invoking command line.  
 
 Optimization
 
 There are three scripts which implement a margin optimization algorithm
 used by Clark Hamilton at NIST.  These files (kept in the scripts directory)
 are optimize, margins, and merit.  Optimize is the main script, and is
 invoked with the name of the files to be optimized as an argument.  An
 example file is shown below:
 
 .check
 set checkiterate = 3
 let checkN1 = 0
 compose checkPNTS values 1n 2n
 let value[19] = 0
 let flags[19] = 0
 let flags[0] = 1
 let value[0] = .8
 .control
 if (TIME >= checkPNTS[0])
     checkFAIL = 0
     if ((abs(v(1)) > 1.5) or (abs(v(1)) < .5))
         checkFAIL = 1
     endif
 endif
 .endc
 optimization test
 i1 0 1 pulse(0 1 0 1n)
 r1 1 0 $&value[0]
 .tran .01n 1.1n
 .end
 
 This is the simplest way to input the file, alternatively one could
 set the shell variables and vectors externally and/or use a bound
 codeblock for pass/fail evaluation.
 
 The variable checkiterate must be set to a nonzero value up to 10.  This
 is the binary search depth for finding the operating range.
 
 the vectors checkN1 and value[] must be defined, checkN1 is the index into
 the value array of the variable being adjusted. It is altered by the
 scripts, but it and value[] must be defined before the script is input
 or in the header as shown.
 
 The vector checkPNTS is the array of points where analysis is performed.
 Note that due to some strangeness, at least two entries must exist.
 
 The value array is initialized to the starting values.  The flags vector
 contains 1 for each entry in the array which is to be varied, the others
 are treated as constants.
 
 The lengths of the vectors value[] and flags[] is 20, which is assumed
 in the optimization script.
 
 After the analysis is complete, the value array will contain the optimized
 values.  Two other arrays, lower and upper, are created, and contain the
 lower and upper limit for each value index.
 
!!SEEALSO
main
