📄 nutmeg.1
字号:
.\" RCS Info: $Revision: 1.4 $ on $Date: 86/01/07 06:12:19 $.\" $Source: /cad4/faustus/spice/doc/RCS/nutmeg.1,v $.\" Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group.TH NUTMEG 1 "27 April 1987".UC 4.SH NAMEnutmeg \- spice post-processor.SH SYNOPSIS\fBnutmeg [ - ] [ -n ] [ -t term ] [ datafile ... ]\fR.SH DESCRIPTION.B Nutmegis a post processor for \s-2SPICE\s+2 \- it takes the raw output file created by \fBspice -r\fRand plots the data on a graphics terminal or a workstation display.Note that the raw output file is different from thedata that \s-2SPICE\s+2 writes to the standard output..PPArguments are:.TP\fB-\fRDon't try to load the default data file ("rawspice") if no other filesare given..TP\fB-n\fR (or \fB-N\fR)Don't try to source the file ".spiceinit" upon startup. Normally \fBnutmeg\fRtries to find the file in the current directory, and if it is not found thenin the user's home directory..TP\fB-t term\fR (or \fB-T term\fR)The program is being run on a terminal with \fImfb\fR name \fBterm\fR..PPFurther arguments are taken to be data files in binary or ascii format(see \fBsconvert\fR(1)) which are loaded into nutmeg. If the fileis in binary format, it may be only partially completed (useful forexamining \s-2SPICE\s+2 ouput before the simulation is finished). Onefile may contain any number of data sets from different analyses..PP\fBNutmeg\fRdata is in the form of vectors: time, voltage, etc. Each vector hasa type, and vectors can be operated on and combined algebraicly inways consistent with their types. Vectors are normally created whena data file is read in (see the.B loadcommand below), and when the initial datafile is loaded. They canalso be created with the.B letcommand..PPAn expression is an algebraicformula involving vectors and scalars (a scalar is a vector oflength 1), and the following operations:.IP+, -, *, %, /, ^, and ,..PP% is the modulo operator, and the comma operator has two meanings:if it is present in the argument list of a user-definable function, itserves to seperate the arguments. Otherwise, the term \fBx , y\fR issynonymous with \fBx + j(y)\fR..PPAlso available are the logical operations & (and), | (or), ! (not),and the relational operations <, >, >=, <=, =, and <> (not equal).If used in an algebraic expression they work like they would in C,producing values of 0 or 1. The relational operators have thefollowing synonyms: \fB"gt"\fR is >,\fB"lt"\fR is <, \fB"ge"\fR is >=,\fB"le"\fR is <=,\fB"ne"\fR is <>,\fB"eq"\fR is =,\fB"and"\fR is &,\fB"or"\fR is |,and\fB"not"\fR is !.These are useful when < and > might be confused with IO redirection(which is almost always)..PPThe following functions are available:.IP\fBmag(vector) \-\fRThe magnitude of vector..IP\fBph(vector) \-\fRThe phase of vector..IP\fBj(vector) \-\fR\fIi\fR (sqrt(-1)) times vector..IP\fBreal(vector) \-\fRThe real component of vector..IP\fBimag(vector) \-\fRThe imaginary part of vector..IP\fBdb(vector) \-\fR20 * log10(mag(vector))..IP\fBlog(vector) \-\fRThe logarithm (base 10) of the vector..IP\fBln(vector) \-\fRThe natural logarithm (base e) of vector..IP\fBexp(vector) \-\fRe to the vector power..IP\fBabs(vector) \-\fRThe absolute value of vector..IP\fBsqrt(vector) \-\fRThe square root of vector..IP\fBsin(vector) \-\fRThe sin of vector..IP\fBcos(vector) \-\fRThe cosine of vector..IP\fBtan(vector) \-\fRThe tangent of vector..IP\fBatan(vector) \-\fRThe inverse tangent of vector..IP\fBnorm(vector) \-\fRThe \fBvector\fR normalized to 1 (i.e, the largest magnitude of any componentwill be 1)..IP\fBrnd(vector) \-\fRA vector with each component a random integer between 0 and the absolutevalue of the vectors's corresponding component..IP\fBmean(vector) \-\fRThe result is a scalar (a length 1 vector) that is the mean of the elementsof \fBvector\fR..IP\fBvector(number) \-\fRThe result is a vector of length \fBnumber\fR, with elements 0, 1, ... \fBnumber - 1\fR. If \fBnumber\fR is a vector then just the first elementis taken, and if it isn't an integer then the floor of the magnitude isused..IP\fBlength(vector) \-\fRThe length of \fBvector\fR..IP\fBinterpolate(plot.vector) \-\fRThe result of interpolating the named vector onto the scale of the currentplot. This function uses the variable \fBpolydegree\fR to determinethe degree of interpolation..PPA vector may be either the name of a vector already defined, a floating-point number (a scalar), or a list like \fB[elt1 elt2 ... eltn]\fR, whichis a vector of length n.A number may be written in any format acceptable to \s-2SPICE\s+2, suchas \fB14.6MEG\fR or \fB-1.231E-4\fR. Note that you can either usescientific notation or one of the abbreviations like \fIMEG\fR or \fIG\fR,but not both. As with \s-2SPICE\s+2, a number may have trailing alphabetic characters after it..PPThe notation \fBexpr [lower upper]\fR, where \fBlower\fR and \fBupper\fRare numbers, denotes the range of elements from \fBexpr\fR between\fBlower\fR and \fBupper\fR. The notation \fBexpr [num]\fR denotesthe \fBnum\fR'th element of \fBexpr\fR. If \fBupper\fRis lower than \fBlower\fR, the order of the elements in the vectoris reversed. In all other cases, \fB[\fR and \fB]\fR serve to surroundliteral vectors as described above. (You may have to use a lot ofparentheses to make sure that you get what you want. For instance,you have to type \fBprint (foo) ([1 2])\fR to print the two vectors.Otherwise it will be interpreted as a function call or a vector with anindex.) Note that the expression \fBfoo[10 20][5]\fR will \fInot\fR yield the 15th element of \fBfoo\fR, but rather the 5th. In general onlythe last index suffix on an expression will take effect..PPTo reference vectors in a plot that is not the\fIcurrent plot\fR (see the \fBsetplot\fR command, below), thenotation \fBplotname.vecname\fR can be used..PPEither a plotname or a vector name may be the wildcard \fBall\fR. If theplotname is \fBall\fR, matching vectors from all plots are specified, andif the vector name is \fBall\fR, all vectors in the specified plots arereferenced. Note that you may not use binary operations on expressionsinvolving wildcards \- it is not obvious what \fBall + all\fR shoulddenote, for instance..PPThus some (contrived) examples of expressions are:.IP\fBcos(TIME) + db(v(3))\fR.IP\fBsin(cos(log([1 2 3 4 5 6 7 8 9 10])))\fR.IP\fBTIME * rnd(v(9)) - 15 * cos(vin#branch) ^ [7.9e5 8]\fR.IP\fBnot ((ac3.FREQ[32] & tran1.TIME[10]) gt 3)\fR.PP.B Nutmegcommands are as follows:.TP\fBplot exprs [ylimit ylo yhi] [xlimit xlo xhi] [xindices xilo xihi]\fR.ce\fB[xcompress comp] [xdelta xdel] [ydelta ydel] [xlog] [ylog] [vs xname]\fR.ce\fB[xlabel word] [ylabel word] [title word] [samep]\fRPlot the given.B exprson the screen (if you are on a graphics terminal). The.B xlimitand.B ylimitarguments determine the high and low x- and y-limits of the axes,respectively. The.B xindicesarguments determine what range of points are to be plotted \- everythingbetween the \fBxilo\fR'th point and the \fBxihi\fR'th point is plotted.The.B xcompressargument specifies that only one out of every \fBcomp\fR points shouldbe plotted. If an \fBxdelta\fR or a \fBydelta\fR parameter is present,it specifies the spacing between grid lines on the X- and Y-axis.These parameter names may be abbreviated to.B xl,.B yl,.B xind,.B xcomp,.B xdel,and.B ydelrespectively.The.B xnameargument is an expression to use as the scale on the x-axis. If \fBxlog\fR or \fBylog\fR are present, the X or Y scale respectivelywill be logarithmic.The \fBxlabel\fR and \fBylabel\fR arguments cause the specifiedlabels to be used for the X and Y axes, respectively.If \fBsamep\fR is given, the values of the other parameters (other than\fBxname\fR) from the previous \fBplot, hardcopy,\fR or \fBasciiplot\fRcommand will be used unless re-defined on the command line.Finally, the \fBtitle\fR argument will be used in the place of the plotname at the bottom of the graph..TP\fBhardcopy file \fIplotargs\fRJust like \fBplot\fR, except creates a file called.B filecontaining the plot. The file is an image in \fIplot(5)\fR format,and can be printed by either the \fBplot(1)\fR program or \fBlpr\fRwith the \fB-g\fR flag..TP\fBasciiplot \fIplotargs\fRProduce a line printer plot of the vectors.The plot is sent to the standardoutput, so you can put it into a file with \fIasciiplot args ... > file\fR.The \fBset\fR options \fBwidth, height,\fR and \fBnobreak\fR determinethe width and height of the plot, and whether there are page breaks,respectively. Note that you will have problems if you try to \fBasciiplot\fRsomething with an X-scale that isn't monotonic (i.e, somethinglike \fIsin(TIME)\fR ), because \fBasciiplot\fR uses a simple-minded sortof linear interpolation..TP\fBdefine function(arg1, arg2, ...) expression\fRDefine the \fIuser-definable function\fR with the name \fIfunction\fRand arguments \fIarg1, arg2, ...\fR to be \fIexpression\fR, whichmay involve the arguments. When the function is later used, the argumentsit is given are substituted for the formal arguments when it is parsed.If \fIexpression\fR is not present, any definition for \fIfunction\fRis printed, and if there are no arguments to \fIdefine\fR then allcurrently active definitions are printed. Note that you may have differentfunctions defined with the same name but different arities.Some useful definitions are:.IPdefine max(x,y) (x > y) * x + (x <= y) * y.brdefine min(x,y) (x < y) * x + (x >= y) * y.TP\fBundefine function ...\fRDefinitions for the named user-defined functions are deleted..TP\fBlet name = expr\fRCreates a new vector called.B namewith the value specified by.B expr,an expression as described above. If \fBexpr\fR is [] (a zero-length vector)then the vector becomes undefined.If there are no arguments, \fBlet\fR is the same as \fBdisplay\fR..TP\fBprint [col] [line] expr ... \fRPrints the vector described by the expression.B expr.If the .B colargument is present, print the vectors named side by side. If \fBline\fRis given, the vectors are printed horizontally. \fBcol\fR is the default,unless all the vectors named have a length of one, in which case \fBline\fRis the default.The options\fBwidth, length,\fR and \fBnobreak\fR are effective for thiscommand (see \fBasciiplot\fR). If the expression is \fBall\fR,all of the vectors available are printed. Thus \fBprint col all > file\fRwill print everything in the file in \s-2SPICE\s+2\&2 format.The scale vector (time, frequency) will always be in the first columnunless the variable \fBnoprintscale\fR is true..TP\fBload [filename] ... \fRLoads the raw data in either binary or ascii formatfrom the files named. The default filename is \fBrawspice\fR, or the argumentto the \fB-r\fR flag if there was one..TP\fBsource filename\fRReads commands from the file.B filename.Lines beginning with the character \fB*\fR are considered comments andignored..TP\fBhelp [all] [command ...]\fRPrints help. If the argument \fBall\fR is given, a short descriptionof everything you could possibly type is printed. If \fBcommand\fRs aregiven, descriptions of those commands are printed. Otherwise help foronly a few major commands is printed..TP\fBdisplay [varname ...]\fRPrints a summary of currently defined vectors, or of the names specified.The vectors are sorted by name unless the variable \fBnosort\fR is set.The information given is the name of the vector, the length, thetype of the vector, and whether it is real or complex data. Additionally,one vector will be labeled \fB[scale]\fR. When a command such as\fIplot\fR is given without a \fIvs\fR argument, this scale is usedfor the X-axis. It is always the first vector in a rawfile, orthe first vector defined in a new plot. If you undefine the scale(i.e, \fIlet TIME = []\fR), a random remainingvector will become the scale..TP\fBsetplot [plotname]\fRSet the \fBcurrent plot\fR to the plot with the givenname, or if no name is given, prompt the user with a menu. (Note that the plots are named as they are loaded, with nameslike \fBtran1\fR or \fBop2\fR. These names are shown by the\fBsetplot\fR and \fBdisplay\fR commands and are used by \fBdiff\fR,below.)If the"New plot" item is selected, the current plot will become one withno vectors defined.Note that here the word "plot" refersto a group of vectors that are the result of one \s-2SPICE\s+2 run.Whenmore than one file is loaded in, or more than one plot is presentin one file, \fBnutmeg\fR keeps them seperate and only shows you thevectors in the current plot..TP\fBsettype type vector ...\fR
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -