home *** CD-ROM | disk | FTP | other *** search
- .\" RCS Info: $Revision: 1.2 $ on $Date: 85/09/16 17:34:03 $
- .\" $Source: /cad4/faustus/spice/doc/RCS/nutmegintro.ms,v $
- .\" Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
- .TL
- A Short Introduction to Nutmeg
- .AU
- Wayne Christopher
- .AI
- CAD Group
- U. C. Berkeley
- .PP
- \fBNutmeg\fR
- is a post-processor for \s-2SPICE\s+2\&3: it takes data that \s-2SPICE\s+2\&3
- generates and plots it on a graphics terminal. If you run \s-2SPICE\s+2\&3 as
- .IP
- \fBspice -r filename\fR,
- .LP
- it will write the values of the variables you
- specify into the file \fBfilename\fR. Then you can run
- .IP
- \fBnutmeg filename\fR
- .LP
- to load the data into the post-processor. The default filename for both
- \s-2SPICE\s+2\&3 and \fBnutmeg\fR is \fBrawspice\fR.
- .PP
- The most important command in \fBnutmeg\fR is the
- .B plot
- command. If you type
- .IP
- \fBplot varname\fR
- .LP
- where
- .B varname
- is the name of one of the outputs in the file (such as
- .B TIME),
- \fBnutmeg\fR will plot a graph of the variable on the screen. \fBNutmeg\fR
- will print the names of the variables on the bottom line of the
- screen as they are plotted. When it prints "-more-" it is waiting
- for you to hit a key before proceeding to something else.
- You can specify many variables in a
- .B plot
- command, like
- .IP
- \fBplot TIME v(1) v(2) VWB\fR
- .LP
- You can also specify combinations of outputs and functions of them, as
- in
- .IP
- \fBplot v(1) + 2 * v(2)\fR
- .br
- or
- .IP
- \fBplot log(v(1)) sin(cos(v(2)))\fR
- .LP
- Notice that the variable name \fBv(1)\fR is not a function, but rather
- denotes the voltage at the node named \fB1\fR. (If there is a variable
- with a number as a name, like \fB5\fR, you can name it by writing
- \fB"5"\fR, or if the type is voltage, as \fBV(5)\fR.) You can use
- most algebraic functions, including trig functions,
- \fBlog()\fR, log base 10,
- \fBln()\fR, log base \fBe\fR, and functions such as
- \fBmag()\fR, the magnitude of the complex number,
- \fBphase()\fR, the phase,
- \fBreal()\fR, the real part, and
- \fBimag()\fR, the imaginary part.
- These all operate on real or complex values.
- You cannot plot complex values, so should you use these
- functions to specify what parts of the complex values you want to
- plot. (The default for complex values is to plot the real part.)
- A complete list of functions and operations available can be
- found in the manual page for \fBnutmeg\fR.
- .PP
- A few other commands are useful -- the
- .B display
- command prints out
- the variables that you have available, along with some information
- about them. You can leave \fBnutmeg\fR with the
- .B quit
- command, and the
- .B bug
- command sends a bug report to the person in charge of
- \fBnutmeg\fR. (This depends upon what networks your machine can send
- mail to -- if you are an internet host it should work. If it doesn't
- report the bug to whomever on your system is in charge of CAD
- software.)
- .PP
- You can create new variables with the
- .B let
- command, as in
- .IP
- \fBlet hodedo = v(1) + 2 * v(2)\fR
- .PP
- (The \fBlet\fR command is different from the \fBset\fR command, which
- sets non-vector variables like \fBwidth, nosort,\fR and \fBprompt\fR.)
- .PP
- You can print variables with the
- .B print
- command:
- .IP
- \fBprint TIME\fR
- .PP
- There are also alias and history mechanisms available (see the manual
- page for details), and a \fBshell\fR command, which passes its
- arguments to the
- .UX
- shell (if you are using
- .UX ),
- or starts a subshell.
- .PP
- Ascii plots are also available, with the
- .B asciiplot
- command. The command
- .IP
- \fBasciiplot one two log(three) > file\fR
- .LP
- creates an ascii plot in the file "file". If you want a different size
- plot, use the
- .B set
- command to reset the sizes, like
- .IP
- \fBset width=80 height=14\fR
- .LP
- The default values are 130 and 60, suitable for a line printer. Normally
- every \fBheight\fR lines there is a page break, but if you do
- .IP
- \fBset nobreak\fR
- .LP
- this will be suppressed.
- .PP
- To see what other commands are available, look at the manual page, or
- type
- .B help
- in \fBnutmeg\fR. This introduction should be enough to get you
- started. Here is a sample \fBnutmeg\fR run (user input is in italics):
-
- .nf
- % \fInutmeg\fR
-
- Title: SPICE 3-C raw output test heading
- Name: Transient analysis.
- Date: 08/19/8403:17:11
-
- nutmeg 1 -> \fIdisplay\fR
- Here are the variables currently active:
-
- Title: SPICE 3-C raw output test heading
- Plotname: Transient analysis.
- Date: Sun Dec 1 11:18:25 PST 1985
-
- .cs R 20
- TIME : time (real, 152 long) [scale]
- v(1) : voltage (real, 152 long)
- v(2) : voltage (real, 152 long)
- v(3) : voltage (real, 152 long)
- v(4) : voltage (real, 152 long)
- v(5) : voltage (real, 152 long)
- .cs R 0
-
- nutmeg 2 -> \fIprint v(1)\fR
- v(1) = ( 0 0 0 0 0 0 0 0 0 0.010663 0.031989 0.074641
- 0.159945 0.330552 0.671767 1.354197 2 2 2 2 2
-
- (\fBand so forth\fR)
-
- 0 0 0 0 0 0 0 0 )
- nutmeg 3 -> \fIplot v(1)\fR
-
- (\fBplot takes place\fR)
-
- nutmeg 4 -> \fIlet xxx = log(v(1))\fR
- nutmeg 5 -> \fIplot xxx\fR
-
- (\fBplot takes place\fR)
-
- nutmeg 6 -> \fIplot v(1) v(2) v(3) + 1 vs TIME * 2\fR
-
- (\fBplot takes place\fR)
-
- nutmeg 7 -> \fIbug\fR
- Enter a description of the bug. End with ^D.
- This works only if you can mail directly to faustus@ic.berkeley.edu
-
- \fIGreat program!!
-
- ^D\fR
- Bug report sent. Thank you.
- nutmeg 8 -> \fIasciiplot v(1) v(2) TIME + 2 > File\fR
- nutmeg 9 -> \fIshell lpr File\fR
-
- (\fBPick up ascii plot ...\fR)
-
- nutmeg 10 -> \fIhelp\fR
- For a complete description of nutmeg read the nutmeg manual.
- Here is a short list of available commands:
-
- alias [[word] alias] : Define an alias.
- asciiplot plotargs : Produce ascii plots.
- aspice file [outfile] : Run a spice job asynchronously.
- bug : Report a nutmeg bug.
- cd [directory] : Change working directory.
- define [[func (args)] stuff] : Define a user-definable function.
- diff plotname plotname [vec ...] : 'diff' two plots.
- display : Display vector status.
- echo [stuff ...] : Print stuff.
- fourier fund_freq vector ... : Do a fourier analysis of some data.
- hardcopy device file plotargs : Produce hardcopy plots.
- help commandname ... : Print help.
- history [number] : Print the history (last number events).
- jobs : Report on asynchronous spice jobs.
- let varname = expr : Assign vector variables.
- load file : Load in data.
- plot expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things.
- print expr ... : Print vector values.
- quit : Quit nutmeg.
- rspice [input file] : Run a spice job remotely.
- rusage : Print current resource usage.
- set [option] [option = value] ... : Set a variable.
- setplot [plotname] : Change the current working plot.
- shell [args] : Fork a shell, or execute the command.
- source file : Source a nutmeg file.
- unalias word ... : Undefine an alias.
- undefine [func ...] : Undefine a user-definable function.
- unset varname ... : Unset a variable.
- version [number] : Print the version number.
- write file expr ... : Write data to a file.
-
- nutmeg 11 -> \fIquit\fR
- So long.
-
- %
-
-