102 changed files with 2399 additions and 2169 deletions
-
4src/Makefile.am
-
1src/analysis/cktdisto.c
-
1src/analysis/cktnoise.c
-
1src/analysis/noisean.c
-
1src/frontend/.cvsignore
-
36src/frontend/Makefile.am
-
5src/frontend/README
-
2src/frontend/agraf.c
-
2src/frontend/aspice.c
-
3src/frontend/breakp.c
-
2src/frontend/breakp2.c
-
2src/frontend/circuits.c
-
130src/frontend/com_compose.c
-
10src/frontend/com_compose.h
-
77src/frontend/com_display.c
-
8src/frontend/com_display.h
-
206src/frontend/com_let.c
-
8src/frontend/com_let.h
-
33src/frontend/com_setscale.c
-
9src/frontend/com_setscale.h
-
744src/frontend/commands.c
-
11src/frontend/commands.h
-
25src/frontend/completion.h
-
12src/frontend/compose.h
-
3src/frontend/cpitf.c
-
2src/frontend/debugcom.c
-
5src/frontend/define.c
-
4src/frontend/diff.c
-
2src/frontend/dimens.c
-
8src/frontend/display.c
-
4src/frontend/doplot.c
-
5src/frontend/dotcards.c
-
445src/frontend/evaluate.c
-
2src/frontend/fourier.c
-
4src/frontend/graf.c
-
2src/frontend/grid.c
-
4src/frontend/inp.c
-
2src/frontend/inpcom.c
-
18src/frontend/interp.c
-
2src/frontend/linear.c
-
18src/frontend/misccoms.c
-
1src/frontend/misccoms.h
-
2src/frontend/miscvars.c
-
2src/frontend/mw_coms.c
-
2src/frontend/newcoms.c
-
355src/frontend/nutctab.c
-
12src/frontend/nutctab.h
-
2src/frontend/nutinp.c
-
2src/frontend/options.c
-
5src/frontend/outitf.c
-
3src/frontend/parse.c
-
2src/frontend/plotcurv.c
-
3src/frontend/plotting/.cvsignore
-
17src/frontend/plotting/Makefile.am
-
0src/frontend/plotting/plot5.c
-
0src/frontend/plotting/plot5.h
-
16src/frontend/plotting/plotting.c
-
12src/frontend/plotting/plotting.h
-
85src/frontend/plotting/pvec.c
-
8src/frontend/plotting/pvec.h
-
327src/frontend/plotting/x11.c
-
5src/frontend/plotting/x11.h
-
2src/frontend/plotting/xgraph.c
-
0src/frontend/plotting/xgraph.h
-
2src/frontend/points.c
-
409src/frontend/postcoms.c
-
6src/frontend/rawfile.c
-
4src/frontend/runcoms.c
-
2src/frontend/runcoms2.c
-
2src/frontend/shyu.c
-
381src/frontend/spcmdtab.c
-
4src/frontend/spec.c
-
1src/frontend/spiceif.c
-
8src/frontend/streams.h
-
25src/frontend/testcommands.c
-
2src/frontend/typesdef.c
-
257src/frontend/vectors.c
-
2src/frontend/where.c
-
6src/include/bool.h
-
19src/include/complex.h
-
74src/include/cpdefs.h
-
6src/include/cpextern.h
-
29src/include/cpstd.h
-
65src/include/dvec.h
-
80src/include/fteconst.h
-
61src/include/ftedata.h
-
2src/include/ftedev.h
-
4src/include/fteext.h
-
6src/include/ftegraph.h
-
28src/include/fteparse.h
-
12src/include/grid.h
-
27src/include/plot.h
-
14src/include/pnode.h
-
19src/include/sim.h
-
36src/include/variable.h
-
14src/include/wordlist.h
-
4src/main.c
-
2src/maths/cmaths/cmath1.c
-
2src/maths/cmaths/cmath2.c
-
2src/maths/cmaths/cmath3.c
@ -1,3 +1,4 @@ |
|||||
Makefile.in |
Makefile.in |
||||
Makefile |
Makefile |
||||
.deps |
.deps |
||||
|
.libs |
||||
@ -0,0 +1,5 @@ |
|||||
|
This directory contains the code that is behind the commands of the |
||||
|
interactive frontend. Note that every command has a source file |
||||
|
associated with it. The source file is prefixed with `com_' to |
||||
|
distinguish command source files from other supporting code. |
||||
|
|
||||
@ -0,0 +1,10 @@ |
|||||
|
|
||||
|
#ifndef _COM_COMPOSE_H |
||||
|
#define _COM_COMPOSE_H |
||||
|
|
||||
|
#include <wordlist.h> |
||||
|
|
||||
|
|
||||
|
void com_compose(wordlist *wl); |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,77 @@ |
|||||
|
#include <ngspice.h> |
||||
|
#include <bool.h> |
||||
|
#include <variable.h> |
||||
|
#include <fteext.h> |
||||
|
|
||||
|
#include "com_display.h" |
||||
|
#include "streams.h" |
||||
|
#include "plotting/plotting.h" |
||||
|
#include "plotting/pvec.h" |
||||
|
|
||||
|
|
||||
|
/* For the sort in display. */ |
||||
|
static int |
||||
|
dcomp(const void *d1, const void *d2) |
||||
|
{ |
||||
|
struct dvec **v1 = (struct dvec **) d1; |
||||
|
struct dvec **v2 = (struct dvec **) d2; |
||||
|
|
||||
|
return (strcmp((*v1)->v_name, (*v2)->v_name)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/* Display vector status, etc. Note that this only displays stuff |
||||
|
* from the current plot, and you must do a setplot to see the rest of |
||||
|
* it. */ |
||||
|
void |
||||
|
com_display(wordlist *wl) |
||||
|
{ |
||||
|
struct dvec *d; |
||||
|
struct dvec **dvs; |
||||
|
int len = 0, i = 0; |
||||
|
bool b; |
||||
|
char *s; |
||||
|
|
||||
|
/* Maybe he wants to know about just a few vectors. */ |
||||
|
|
||||
|
out_init(); |
||||
|
while (wl) { |
||||
|
s = cp_unquote(wl->wl_word); |
||||
|
d = vec_get(s); |
||||
|
if (d == NULL) |
||||
|
fprintf(cp_err, "Error: no such vector as %s.\n", |
||||
|
wl->wl_word); |
||||
|
else |
||||
|
while (d) { |
||||
|
pvec(d); |
||||
|
d = d->v_link2; |
||||
|
} |
||||
|
if (wl->wl_next == NULL) |
||||
|
return; |
||||
|
wl = wl->wl_next; |
||||
|
} |
||||
|
if (plot_cur) |
||||
|
for (d = plot_cur->pl_dvecs; d; d = d->v_next) |
||||
|
len++; |
||||
|
if (len == 0) { |
||||
|
fprintf(cp_out, "There are no vectors currently active.\n"); |
||||
|
return; |
||||
|
} |
||||
|
out_printf("Here are the vectors currently active:\n\n"); |
||||
|
dvs = (struct dvec **) tmalloc(len * (sizeof (struct dvec *))); |
||||
|
for (d = plot_cur->pl_dvecs, i = 0; d; d = d->v_next, i++) |
||||
|
dvs[i] = d; |
||||
|
if (!cp_getvar("nosort", VT_BOOL, (char *) &b)) |
||||
|
qsort((char *) dvs, len, sizeof (struct dvec *), dcomp); |
||||
|
|
||||
|
out_printf("Title: %s\n", plot_cur->pl_title); |
||||
|
out_printf("Name: %s (%s)\nDate: %s\n\n", |
||||
|
plot_cur->pl_typename, plot_cur->pl_name, |
||||
|
plot_cur->pl_date); |
||||
|
for (i = 0; i < len; i++) { |
||||
|
d = dvs[i]; |
||||
|
pvec(d); |
||||
|
} |
||||
|
return; |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
#ifndef _COM_DISPLAY_H |
||||
|
#define _COM_DISPLAY_H |
||||
|
|
||||
|
#include <wordlist.h> |
||||
|
|
||||
|
void com_display(wordlist *wl); |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,206 @@ |
|||||
|
#include <stddef.h> |
||||
|
|
||||
|
#include <dvec.h> |
||||
|
#include <ngspice.h> |
||||
|
#include <fteext.h> |
||||
|
|
||||
|
#include "com_let.h" |
||||
|
#include "com_display.h" |
||||
|
#include "completion.h" |
||||
|
#include "streams.h" |
||||
|
|
||||
|
void |
||||
|
com_let(wordlist *wl) |
||||
|
{ |
||||
|
char *p, *q, *s; |
||||
|
int indices[MAXDIMS]; |
||||
|
int numdims; |
||||
|
wordlist fake_wl; |
||||
|
int need_open; |
||||
|
int offset, length; |
||||
|
struct pnode *nn; |
||||
|
struct dvec *n, *t; |
||||
|
int i, cube; |
||||
|
int depth; |
||||
|
int newvec; |
||||
|
char *rhs; |
||||
|
|
||||
|
fake_wl.wl_next = NULL; |
||||
|
|
||||
|
if (!wl) { |
||||
|
com_display((wordlist *) NULL); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
p = wl_flatten(wl); |
||||
|
|
||||
|
/* extract indices */ |
||||
|
numdims = 0; |
||||
|
if ((rhs =strchr(p, '='))) { |
||||
|
*rhs++ = 0; |
||||
|
} else { |
||||
|
fprintf(cp_err, "Error: bad let syntax\n"); |
||||
|
return; |
||||
|
} |
||||
|
if ((s =strchr(p, '['))) { |
||||
|
need_open = 0; |
||||
|
*s++ = 0; |
||||
|
while (!need_open || *s == '[') { |
||||
|
depth = 0; |
||||
|
if (need_open) |
||||
|
s++; |
||||
|
for (q = s; *q && (*q != ']' && (*q != ',' || depth > 0)); q++) { |
||||
|
switch (*q) { |
||||
|
case '[': |
||||
|
depth += 1; |
||||
|
break; |
||||
|
case ']': |
||||
|
depth -= 1; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (depth != 0 || !*q) { |
||||
|
printf("syntax error specifyingstrchr\n"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (*q == ']') |
||||
|
need_open = 1; |
||||
|
else |
||||
|
need_open = 0; |
||||
|
if (*q) |
||||
|
*q++ = 0; |
||||
|
for (s = q; *s && isspace(*s); s++) |
||||
|
; |
||||
|
} |
||||
|
} |
||||
|
/* vector name at p */ |
||||
|
|
||||
|
for (q = p + strlen(p) - 1; *q <= ' ' && p <= q; q--) |
||||
|
; |
||||
|
|
||||
|
*++q = 0; |
||||
|
|
||||
|
/* sanity check */ |
||||
|
if (eq(p, "all") ||strchr(p, '@')) { |
||||
|
fprintf(cp_err, "Error: bad variable name %s\n", p); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
/* evaluate rhs */ |
||||
|
fake_wl.wl_word = rhs; |
||||
|
nn = ft_getpnames(&fake_wl, TRUE); |
||||
|
if (nn == NULL) { |
||||
|
/* XXX error message */ |
||||
|
tfree(p); |
||||
|
return; |
||||
|
} |
||||
|
t = ft_evaluate(nn); |
||||
|
if (!t) { |
||||
|
fprintf(cp_err, "Error: Can't evaluate %s\n", rhs); |
||||
|
tfree(p); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (t->v_link2) |
||||
|
fprintf(cp_err, "Warning: extra wildcard values ignored\n"); |
||||
|
|
||||
|
n = vec_get(p); |
||||
|
|
||||
|
if (n) { |
||||
|
/* re-allocate? */ |
||||
|
/* vec_free(n); */ |
||||
|
newvec = 0; |
||||
|
} else { |
||||
|
if (numdims) { |
||||
|
fprintf(cp_err, "Can't assign into a subindex of a new vector\n"); |
||||
|
tfree(p); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
/* create and assign a new vector */ |
||||
|
n = alloc(struct dvec); |
||||
|
ZERO(n, struct dvec); |
||||
|
n->v_name = copy(p); |
||||
|
n->v_type = t->v_type; |
||||
|
n->v_flags = (t->v_flags | VF_PERMANENT); |
||||
|
n->v_length = t->v_length; |
||||
|
|
||||
|
if (!t->v_numdims) { |
||||
|
n->v_numdims = 1; |
||||
|
n->v_dims[0] = n->v_length; |
||||
|
} else { |
||||
|
n->v_numdims = t->v_numdims; |
||||
|
for (i = 0; i < t->v_numdims; i++) |
||||
|
n->v_dims[i] = t->v_dims[i]; |
||||
|
} |
||||
|
|
||||
|
if (isreal(t)) |
||||
|
n->v_realdata = (double *) tmalloc(n->v_length * sizeof(double)); |
||||
|
else |
||||
|
n->v_compdata = (complex *) tmalloc(n->v_length * sizeof(complex)); |
||||
|
newvec = 1; |
||||
|
vec_new(n); |
||||
|
} |
||||
|
|
||||
|
/* fix-up dimensions */ |
||||
|
if (n->v_numdims < 1) { |
||||
|
n->v_numdims = 1; |
||||
|
n->v_dims[0] = n->v_length; |
||||
|
} |
||||
|
|
||||
|
/* Compare dimensions */ |
||||
|
offset = 0; |
||||
|
length = n->v_length; |
||||
|
|
||||
|
cube = 1; |
||||
|
for (i = n->v_numdims - 1; i >= numdims; i--) |
||||
|
cube *= n->v_dims[i]; |
||||
|
|
||||
|
for (i = numdims - 1; i >= 0; i--) { |
||||
|
offset += cube * indices[i]; |
||||
|
if (i < n->v_numdims) { |
||||
|
cube *= n->v_dims[i]; |
||||
|
length /= n->v_dims[i]; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* length is the size of the unit refered to */ |
||||
|
/* cube ends up being the length */ |
||||
|
|
||||
|
if (length > t->v_length) { |
||||
|
fprintf(cp_err, "left-hand expression is too small (need %d)\n", |
||||
|
length * cube); |
||||
|
if (newvec) |
||||
|
n->v_flags &= ~VF_PERMANENT; |
||||
|
tfree(p); |
||||
|
return; |
||||
|
} |
||||
|
if (isreal(t) != isreal(n)) { |
||||
|
fprintf(cp_err, |
||||
|
"Types of vectors are not the same (real vs. complex)\n"); |
||||
|
if (newvec) |
||||
|
n->v_flags &= ~VF_PERMANENT; |
||||
|
tfree(p); |
||||
|
return; |
||||
|
} else if (isreal(t)) { |
||||
|
bcopy((char *) t->v_realdata, (char *) (n->v_realdata + offset), |
||||
|
length * sizeof (double)); |
||||
|
} else { |
||||
|
bcopy((char *) t->v_compdata, (char *) (n->v_compdata + offset), |
||||
|
length * sizeof (complex)); |
||||
|
} |
||||
|
|
||||
|
n->v_minsignal = 0.0; /* How do these get reset ??? */ |
||||
|
n->v_maxsignal = 0.0; |
||||
|
|
||||
|
n->v_scale = t->v_scale; |
||||
|
|
||||
|
if (newvec) |
||||
|
cp_addkword(CT_VECTOR, n->v_name); |
||||
|
|
||||
|
/* XXXX Free t !?! */ |
||||
|
tfree(p); |
||||
|
return; |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
#ifndef _COM_LET_H |
||||
|
#define _COM_LET_H |
||||
|
|
||||
|
#include <wordlist.h> |
||||
|
|
||||
|
void com_let(wordlist *wl); |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,33 @@ |
|||||
|
#include <ngspice.h> |
||||
|
#include <dvec.h> |
||||
|
#include <cpextern.h> |
||||
|
|
||||
|
#include "com_setscale.h" |
||||
|
#include "plotting/plotting.h" |
||||
|
#include "plotting/pvec.h" |
||||
|
|
||||
|
/* Set the default scale to the named vector. If no vector named, |
||||
|
* find and print the default scale. |
||||
|
*/ |
||||
|
void |
||||
|
com_setscale(wordlist *wl) |
||||
|
{ |
||||
|
struct dvec *d; |
||||
|
char *s; |
||||
|
|
||||
|
if (plot_cur) { |
||||
|
if (wl) { |
||||
|
s = cp_unquote(wl->wl_word); |
||||
|
d = vec_get(s); |
||||
|
if (d == NULL) |
||||
|
fprintf(cp_err, "Error: no such vector as %s.\n", |
||||
|
wl->wl_word); |
||||
|
else |
||||
|
plot_cur->pl_scale = d; |
||||
|
} else if (plot_cur->pl_scale) { |
||||
|
pvec(plot_cur->pl_scale); |
||||
|
} |
||||
|
} else { |
||||
|
fprintf(cp_err, "Error: no current plot.\n"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
#ifndef _COM_SETSCALE_H |
||||
|
#define _COM_SETSCALE_H |
||||
|
|
||||
|
#include <wordlist.h> |
||||
|
|
||||
|
|
||||
|
void com_setscale(wordlist *wl); |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,744 @@ |
|||||
|
/* NG-SPICE -- An electrical circuit simulator |
||||
|
* |
||||
|
* Copyright (c) 1990 University of California |
||||
|
* Copyright (c) 2000 Arno W. Peters |
||||
|
* |
||||
|
* Permission to use, copy, modify, and distribute this software and |
||||
|
* its documentation without fee, and without a written agreement is |
||||
|
* hereby granted, provided that the above copyright notice, this |
||||
|
* paragraph and the following three paragraphs appear in all copies. |
||||
|
* |
||||
|
* This software program and documentation are copyrighted by their |
||||
|
* authors. The software program and documentation are supplied "as |
||||
|
* is", without any accompanying services from the authors. The |
||||
|
* authors do not warrant that the operation of the program will be |
||||
|
* uninterrupted or error-free. The end-user understands that the |
||||
|
* program was developed for research purposes and is advised not to |
||||
|
* rely exclusively on the program for any reason. |
||||
|
* |
||||
|
* IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, |
||||
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING |
||||
|
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS |
||||
|
* DOCUMENTATION, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE |
||||
|
* POSSIBILITY OF SUCH DAMAGE. THE AUTHORS SPECIFICALLY DISCLAIMS ANY |
||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
||||
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE |
||||
|
* SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHORS |
||||
|
* HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, |
||||
|
* ENHANCEMENTS, OR MODIFICATIONS. */ |
||||
|
|
||||
|
/* Table of available commands. Note that they're sorted so that the |
||||
|
* commands that appear in the spiceinit file are at the top. */ |
||||
|
|
||||
|
#include <ngspice.h> |
||||
|
#include <ftedefs.h> |
||||
|
#include <ftehelp.h> |
||||
|
|
||||
|
#include "commands.h" |
||||
|
|
||||
|
|
||||
|
/* FIXME: Integrate spcp_coms and nutcp_coms into one variable. */ |
||||
|
|
||||
|
|
||||
|
/* Bool fields: stringargs, spiceonly, major */ |
||||
|
|
||||
|
struct comm spcp_coms[] = { |
||||
|
|
||||
|
{ "let", com_let, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
arg_let, |
||||
|
"varname = expr : Assign vector variables." } , |
||||
|
{ "reshape", com_reshape, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
arg_let, |
||||
|
"vector ... [ shape ] : change the dimensions of a vector." } , |
||||
|
{ "define", com_define, FALSE, FALSE, TRUE, |
||||
|
{ 010000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[[func (args)] stuff] : Define a user-definable function." } , |
||||
|
{ "set", com_set, FALSE, FALSE, TRUE, |
||||
|
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, |
||||
|
arg_set, |
||||
|
"[option] [option = value] ... : Set a variable." } , |
||||
|
{ "alias", com_alias, FALSE, FALSE, FALSE, |
||||
|
{ 02, 04, 04, 04 }, E_ADVANCED, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[[word] alias] : Define an alias." } , |
||||
|
{ "deftype", com_dftype, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"spec name pat ... : Redefine vector and plot types.\n" } , |
||||
|
{ "plot", com_plot, FALSE, FALSE, TRUE, |
||||
|
{ 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, |
||||
|
arg_plot, |
||||
|
"expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, |
||||
|
{ "display", com_display, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 0, LOTS, |
||||
|
arg_display, |
||||
|
": Display vector status." } , |
||||
|
{ "destroy", com_destroy, FALSE, FALSE, FALSE, |
||||
|
{ 0400, 0400, 0400, 0400 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[plotname] ... : Throw away all the data in the plot." } , |
||||
|
{ "setplot", com_splot, FALSE, FALSE, TRUE, |
||||
|
{ 0400, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[plotname] : Change the current working plot." } , |
||||
|
{ "setcirc", com_scirc, FALSE, TRUE, FALSE, |
||||
|
{ 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[circuit name] : Change the current circuit." } , |
||||
|
{ "setscale", com_setscale, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[vecname] : Change default scale of current working plot." } , |
||||
|
{ "transpose", com_transpose, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"varname ... : Perform matrix transposition on multi-D vectors." } , |
||||
|
{ "xgraph", com_xgraph, FALSE, FALSE, TRUE, |
||||
|
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file plotargs : Send plot to Xgraph-11." } , |
||||
|
{ "hardcopy", com_hardcopy, FALSE, FALSE, TRUE, |
||||
|
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file plotargs : Produce hardcopy plots." } , |
||||
|
{ "asciiplot", com_asciiplot, FALSE, FALSE, TRUE, |
||||
|
{ 041000, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"plotargs : Produce ascii plots." } , |
||||
|
{ "write", com_write, FALSE, FALSE, TRUE, |
||||
|
{ 1, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file expr ... : Write data to a file." } , |
||||
|
{ "compose", com_compose, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"var parm=val ... : Compose a vector." } , |
||||
|
{ "unlet", com_unlet, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"varname ... : Undefine vectors." } , |
||||
|
{ "print", com_print, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, |
||||
|
arg_print, |
||||
|
"[col] expr ... : Print vector values." } , |
||||
|
{ "load", com_load, FALSE, FALSE, TRUE, |
||||
|
{ 1, 1, 1, 1 }, E_BEGINNING | E_NOPLOTS, 1, LOTS, |
||||
|
arg_load, |
||||
|
"file ... : Load in data." } , |
||||
|
{ "cross", com_cross, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 0, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"vecname number [ vector ... ] : Make a vector in a strange way." } , |
||||
|
{ "undefine", com_undefine, FALSE, FALSE, FALSE, |
||||
|
{ 010000, 010000, 010000, 010000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[func ...] : Undefine a user-definable function." } , |
||||
|
{ "op", com_op, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.op line args] : Determine the operating point of the circuit." } , |
||||
|
{ "tf", com_tf, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.tran line args] : Do a transient analysis." } , |
||||
|
{ "tran", com_tran, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.tran line args] : Do a transient analysis." } , |
||||
|
{ "ac", com_ac, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.ac line args] : Do an ac analysis." } , |
||||
|
{ "dc", com_dc, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.dc line args] : Do a dc analysis." } , |
||||
|
{ "pz", com_pz, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.pz line args] : Do a pole / zero analysis." } , |
||||
|
{ "sens", com_sens, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.sens line args] : Do a sensitivity analysis." } , |
||||
|
{ "disto", com_disto, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.disto line args] : Do an distortion analysis." } , |
||||
|
{ "noise", com_noise, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.noise line args] : Do a noise analysis." } , |
||||
|
{ "listing", com_listing, FALSE, TRUE, TRUE, |
||||
|
{ 0100, 0100, 0100, 0100 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[logical] [physical] [deck] : Print the current circuit." } , |
||||
|
{ "edit", com_edit, FALSE, TRUE, TRUE, |
||||
|
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[filename] : Edit a spice deck and then load it in." } , |
||||
|
{ "dump", com_dump, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Print a dump of the current circuit." } , |
||||
|
{ "fourier", com_fourier, FALSE, FALSE, TRUE, |
||||
|
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"fund_freq vector ... : Do a fourier analysis of some data." } , |
||||
|
{ "spec", com_spec, FALSE, FALSE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 4, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"start_freq stop_freq step_freq vector ... : Create a frequency domain plot." } , |
||||
|
{ "show", com_show, FALSE, TRUE, FALSE, |
||||
|
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"devices ... : parameters ... : Print out device summary." } , |
||||
|
{ "showmod", com_showmod, FALSE, TRUE, FALSE, |
||||
|
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"models ... : parameters ... : Print out model summary." } , |
||||
|
{ "alter", com_alter, FALSE, TRUE, FALSE, |
||||
|
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"devspecs : parmname value : Alter device parameters." } , |
||||
|
{ "altermod", com_altermod, FALSE, TRUE, FALSE, |
||||
|
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"devspecs : parmname value : Alter model parameters." } , |
||||
|
{ "resume", com_resume, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Continue after a stop." } , |
||||
|
{ "state", com_state, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"(unimplemented) : Print the state of the circuit." }, |
||||
|
{ "stop", com_stop, FALSE, TRUE, FALSE, |
||||
|
{ 04200, 04200, 04200, 04200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[stop args] : Set a breakpoint." } , |
||||
|
{ "trace", com_trce, FALSE, TRUE, FALSE, |
||||
|
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [node ...] : Trace a node." } , |
||||
|
{ "save", com_save, FALSE, TRUE, FALSE, |
||||
|
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [node ...] : Save a spice output." } , |
||||
|
{ "iplot", com_iplot, FALSE, TRUE, TRUE, |
||||
|
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [node ...] : Incrementally plot a node." } , |
||||
|
{ "status", com_sttus, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Print the current breakpoints and traces." } , |
||||
|
{ "delete", com_delete, FALSE, TRUE, FALSE, |
||||
|
{ 020, 020, 020, 020 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [break number ...] : Delete breakpoints and traces." } , |
||||
|
{ "step", com_step, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[number] : Iterate number times, or one." } , |
||||
|
{ "reset", com_rset, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Terminate a simulation after a breakpoint (formerly 'end')." } , |
||||
|
{ "run", com_run, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[rawfile] : Run the simulation as specified in the input file." } , |
||||
|
{ "aspice", com_aspice, FALSE, FALSE, FALSE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 1, 2, |
||||
|
(void (*)()) NULL, |
||||
|
"file [outfile] : Run a spice job asynchronously." } , |
||||
|
{ "jobs", com_jobs, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Report on asynchronous spice jobs." } , |
||||
|
{ "rspice", com_rspice, FALSE, FALSE, FALSE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[input file] : Run a spice job remotely." } , |
||||
|
{ "bug", com_bug, FALSE, FALSE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Report a %s bug." } , |
||||
|
{ "where", com_where, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Print last non-converging node or device" } , |
||||
|
{ "newhelp", com_ahelp, FALSE, FALSE, TRUE, |
||||
|
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[command name] ... : help." }, |
||||
|
{ "tutorial", com_ghelp, FALSE, FALSE, TRUE, |
||||
|
{ 023010, 023010, 023010, 023010 }, E_BEGINNING, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[subject] ... : Hierarchical documentation browser." } , |
||||
|
{ "help", com_ghelp, FALSE, FALSE, TRUE, |
||||
|
{ 023010, 023010, 023010, 023010 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[subject] ... : Hierarchical documentation browser." } , |
||||
|
{ "oldhelp", com_help, FALSE, FALSE, TRUE, |
||||
|
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[command name] ... : Print help." } , |
||||
|
{ "quit", com_quit, FALSE, FALSE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_BEGINNING, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Quit %s." } , |
||||
|
{ "source", com_source, FALSE, FALSE, TRUE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file : Source a %s file." } , |
||||
|
{ "shift", com_shift, FALSE, FALSE, FALSE, |
||||
|
{ 020000, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
||||
|
(void (*)()) NULL, |
||||
|
"[var] [number] : Shift argv or the named list var to the left." } , |
||||
|
{ "unset", com_unset, FALSE, FALSE, FALSE, |
||||
|
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"varname ... : Unset a variable." } , |
||||
|
{ "unalias", com_unalias, FALSE, FALSE, FALSE, |
||||
|
{ 02, 02, 02, 02 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"word ... : Undefine an alias." } , |
||||
|
{ "history", com_history, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
||||
|
(void (*)()) NULL, |
||||
|
"[-r] [number] : Print command history." } , |
||||
|
{ "echo", com_echo, FALSE, FALSE, FALSE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[stuff ...] : Print stuff." } , |
||||
|
{ "shell", com_shell, FALSE, FALSE, TRUE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[args] : Fork a shell, or execute the command." } , |
||||
|
{ "rusage", com_rusage, FALSE, FALSE, FALSE, |
||||
|
{ 02000, 02000, 02000, 02000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[resource ...] : Print current resource usage." } , |
||||
|
{ "cd", com_chdir, FALSE, FALSE, FALSE, |
||||
|
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[directory] : Change working directory." } , |
||||
|
{ "version", com_version, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[number] : Print the version number." } , |
||||
|
{ "diff", com_diff, FALSE, FALSE, FALSE, |
||||
|
{ 0400, 0400, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"plotname plotname [vec ...] : 'diff' two plots." } , |
||||
|
{ "rehash", com_rehash, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Rebuild the unix command database." } , |
||||
|
{ "while", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"condition : Execute while the condition is TRUE." } , |
||||
|
{ "repeat", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0}, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[number] : Repeat number times, or forever." } , |
||||
|
{ "dowhile", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"condition : Execute while the condition is TRUE." } , |
||||
|
{ "foreach", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"variable value ... : Do once for each value." } , |
||||
|
{ "if", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"condition : Execute if the condition is TRUE." } , |
||||
|
{ "else", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Goes with if." } , |
||||
|
{ "end", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": End a block." } , |
||||
|
{ "break", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Break out of a block." } , |
||||
|
{ "continue", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Continue a loop." } , |
||||
|
{ "label", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"word : Create someplace to go to." } , |
||||
|
{ "goto", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0100000, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"word : Go to a label." } , |
||||
|
{ "cdump", com_cdump, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Dump the current control structures." } , |
||||
|
{ "settype", com_stype, FALSE, FALSE, FALSE, |
||||
|
{ 0200000, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"type vec ... : Change the type of a vector." } , |
||||
|
{ "strcmp", com_strcmp, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, 3, |
||||
|
(void (*)()) NULL, |
||||
|
"varname s1 s2 : Set $varname to strcmp(s1, s2)." } , |
||||
|
{ "linearize", com_linearize, FALSE, TRUE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
" [ vec ... ] : Convert plot into one with linear scale." } , |
||||
|
{ 0, NULL, FALSE, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
NULL } |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/* Bool fields: stringargs, spiceonly, major */ |
||||
|
struct comm nutcp_coms[] = { |
||||
|
{ "let", com_let, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
arg_let, |
||||
|
"varname = expr : Assign vector variables." } , |
||||
|
{ "reshape", com_reshape, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
arg_let, |
||||
|
"vector ... [ shape ] : change the dimensions of a vector." } , |
||||
|
{ "define", com_define, FALSE, FALSE, TRUE, |
||||
|
{ 010000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[[func (args)] stuff] : Define a user-definable function." } , |
||||
|
{ "set", com_set, FALSE, FALSE, TRUE, |
||||
|
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, |
||||
|
arg_set, |
||||
|
"[option] [option = value] ... : Set a variable." } , |
||||
|
{ "alias", com_alias, FALSE, FALSE, FALSE, |
||||
|
{ 02, 04, 04, 04 }, E_ADVANCED, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[[word] alias] : Define an alias." } , |
||||
|
{ "deftype", com_dftype, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"spec name pat ... : Redefine vector and plot types.\n" } , |
||||
|
{ "plot", com_plot, FALSE, FALSE, TRUE, |
||||
|
{ 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, |
||||
|
arg_plot, |
||||
|
"expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, |
||||
|
{ "display", com_display, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 0, LOTS, |
||||
|
arg_display, |
||||
|
": Display vector status." } , |
||||
|
{ "destroy", com_destroy, FALSE, FALSE, FALSE, |
||||
|
{ 0400, 0400, 0400, 0400 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[plotname] ... : Throw away all the data in the plot." } , |
||||
|
{ "setplot", com_splot, FALSE, FALSE, TRUE, |
||||
|
{ 0400, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[plotname] : Change the current working plot." } , |
||||
|
{ "setcirc", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[circuit name] : Change the current circuit." } , |
||||
|
{ "setscale", com_setscale, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[vecname] : Change default scale of current working plot." } , |
||||
|
{ "transpose", com_transpose, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"varname ... : Perform matrix transposition on multi-D vectors." } , |
||||
|
{ "xgraph", com_xgraph, FALSE, FALSE, TRUE, |
||||
|
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file plotargs : Send plot to Xgraph-11." } , |
||||
|
{ "hardcopy", com_hardcopy, FALSE, FALSE, TRUE, |
||||
|
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file plotargs : Produce hardcopy plots." } , |
||||
|
{ "asciiplot", com_asciiplot, FALSE, FALSE, TRUE, |
||||
|
{ 041000, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"plotargs : Produce ascii plots." } , |
||||
|
{ "write", com_write, FALSE, FALSE, TRUE, |
||||
|
{ 1, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file expr ... : Write data to a file." } , |
||||
|
{ "compose", com_compose, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"var parm=val ... : Compose a vector." } , |
||||
|
{ "unlet", com_unlet, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"varname ... : Undefine vectors." } , |
||||
|
{ "print", com_print, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, |
||||
|
arg_print, |
||||
|
"[col] expr ... : Print vector values." } , |
||||
|
{ "load", com_load, FALSE, FALSE, TRUE, |
||||
|
{ 1, 1, 1, 1 }, E_BEGINNING | E_NOPLOTS, 1, LOTS, |
||||
|
arg_load, |
||||
|
"file ... : Load in data." } , |
||||
|
{ "cross", com_cross, FALSE, FALSE, TRUE, |
||||
|
{ 040000, 0, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"vecname number [ vector ... ] : Make a vector in a strange way." } , |
||||
|
{ "undefine", com_undefine, FALSE, FALSE, FALSE, |
||||
|
{ 010000, 010000, 010000, 010000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[func ...] : Undefine a user-definable function." } , |
||||
|
{ "op", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.op line args] : Determine the operating point of the circuit." } , |
||||
|
{ "tran", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.tran line args] : Do a transient analysis." } , |
||||
|
{ "ac", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.ac line args] : Do an ac analysis." } , |
||||
|
{ "dc", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.dc line args] : Do a dc analysis." } , |
||||
|
{ "pz", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.pz line args] : Do a pole / zero analysis." } , |
||||
|
{ "sens", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.ac line args] : Do a sensitivity analysis." } , |
||||
|
{ "disto", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.disto line args] : Do an distortion analysis." } , |
||||
|
{ "noise", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[.noise line args] : Do a noise analysis." } , |
||||
|
{ "listing", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0100, 0100, 0100, 0100 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[logical] [physical] [deck] : Print the current circuit." } , |
||||
|
{ "edit", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[filename] : Edit a spice deck and then load it in." } , |
||||
|
{ "dump", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Print a dump of the current circuit." } , |
||||
|
{ "fourier", com_fourier, FALSE, FALSE, TRUE, |
||||
|
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"fund_freq vector ... : Do a fourier analysis of some data." } , |
||||
|
{ "show", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"devspecs ... : parmspecs ... : Print out device parameters." } , |
||||
|
{ "alter", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 040, 040, 040, 040 }, E_DEFHMASK, 3, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"devspecs : parmname value : Alter device parameters." } , |
||||
|
{ "altermod", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 040, 040, 040, 040 }, E_DEFHMASK, 3, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"devspecs : parmname value : Alter model parameters." } , |
||||
|
{ "resume", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Continue after a stop." } , |
||||
|
{ "state", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"(unimplemented) : Print the state of the circuit." }, |
||||
|
{ "stop", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 04200, 04200, 04200, 04200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[stop args] : Set a breakpoint." } , |
||||
|
{ "trace", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [node ...] : Trace a node." } , |
||||
|
{ "save", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [node ...] : Save a spice output." } , |
||||
|
{ "iplot", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [node ...] : Incrementally plot a node." } , |
||||
|
{ "status", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Print the current breakpoints and traces." } , |
||||
|
{ "delete", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 020, 020, 020, 020 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[all] [break number ...] : Delete breakpoints and traces." } , |
||||
|
{ "step", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[number] : Iterate number times, or one." } , |
||||
|
{ "reset", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Terminate a simulation after a breakpoint (formerly 'end')." } , |
||||
|
{ "run", NULL, FALSE, TRUE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[rawfile] : Run the simulation as specified in the input file." } , |
||||
|
{ "bug", com_bug, FALSE, FALSE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Report a %s bug." } , |
||||
|
{ "newhelp", com_ahelp, FALSE, FALSE, TRUE, |
||||
|
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[command name] ... : help." }, |
||||
|
{ "tutorial", com_ghelp, FALSE, FALSE, TRUE, |
||||
|
{ 023010, 023010, 023010, 023010 }, E_BEGINNING, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[subject] ... : Hierarchical documentation browser." } , |
||||
|
{ "help", com_ghelp, FALSE, FALSE, TRUE, |
||||
|
{ 023010, 023010, 023010, 023010 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[subject] ... : Hierarchical documentation browser." } , |
||||
|
{ "oldhelp", com_help, FALSE, FALSE, TRUE, |
||||
|
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[command name] ... : Print help." } , |
||||
|
{ "quit", com_quit, FALSE, FALSE, TRUE, |
||||
|
{ 0, 0, 0, 0 }, E_BEGINNING, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Quit %s." } , |
||||
|
{ "source", nutcom_source, FALSE, FALSE, TRUE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"file : Source a %s file." } , |
||||
|
{ "shift", com_shift, FALSE, FALSE, FALSE, |
||||
|
{ 020000, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
||||
|
(void (*)()) NULL, |
||||
|
"[var] [number] : Shift argv or the named list var to the left." } , |
||||
|
{ "unset", com_unset, FALSE, FALSE, FALSE, |
||||
|
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"varname ... : Unset a variable." } , |
||||
|
{ "unalias", com_unalias, FALSE, FALSE, FALSE, |
||||
|
{ 02, 02, 02, 02 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"word ... : Undefine an alias." } , |
||||
|
{ "history", com_history, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
||||
|
(void (*)()) NULL, |
||||
|
"[-r] [number] : Print command history." } , |
||||
|
{ "echo", com_echo, FALSE, FALSE, FALSE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[stuff ...] : Print stuff." } , |
||||
|
{ "shell", com_shell, FALSE, FALSE, TRUE, |
||||
|
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[args] : Fork a shell, or execute the command." } , |
||||
|
{ "rusage", com_rusage, FALSE, FALSE, FALSE, |
||||
|
{ 02000, 02000, 02000, 02000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[resource ...] : Print current resource usage." } , |
||||
|
{ "cd", com_chdir, FALSE, FALSE, FALSE, |
||||
|
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[directory] : Change working directory." } , |
||||
|
{ "version", com_version, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"[number] : Print the version number." } , |
||||
|
{ "diff", com_diff, FALSE, FALSE, FALSE, |
||||
|
{ 0400, 0400, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"plotname plotname [vec ...] : 'diff' two plots." } , |
||||
|
{ "rehash", com_rehash, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Rebuild the unix command database." } , |
||||
|
{ "while", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"condition : Execute while the condition is TRUE." } , |
||||
|
{ "repeat", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0}, E_DEFHMASK, 0, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"[number] : Repeat number times, or forever." } , |
||||
|
{ "dowhile", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"condition : Execute while the condition is TRUE." } , |
||||
|
{ "foreach", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"variable value ... : Do once for each value." } , |
||||
|
{ "if", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"condition : Execute if the condition is TRUE." } , |
||||
|
{ "else", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Goes with if." } , |
||||
|
{ "end", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": End a block." } , |
||||
|
{ "break", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Break out of a block." } , |
||||
|
{ "continue", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Continue a loop." } , |
||||
|
{ "label", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"word : Create someplace to go to." } , |
||||
|
{ "goto", NULL, FALSE, FALSE, FALSE, |
||||
|
{ 0100000, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
||||
|
(void (*)()) NULL, |
||||
|
"word : Go to a label." } , |
||||
|
{ "cdump", com_cdump, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
||||
|
(void (*)()) NULL, |
||||
|
": Dump the current control structures." } , |
||||
|
{ "settype", com_stype, FALSE, FALSE, FALSE, |
||||
|
{ 0200000, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
"type vec ... : Change the type of a vector." } , |
||||
|
{ "strcmp", com_strcmp, FALSE, FALSE, FALSE, |
||||
|
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, 3, |
||||
|
(void (*)()) NULL, |
||||
|
"varname s1 s2 : Set $varname to strcmp(s1, s2)." } , |
||||
|
{ "linearize", NULL, FALSE, TRUE, FALSE, |
||||
|
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
" [ vec ... ] : Convert plot into one with linear scale." } , |
||||
|
|
||||
|
{ 0, NULL, FALSE, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
||||
|
(void (*)()) NULL, |
||||
|
NULL } |
||||
|
|
||||
|
} ; |
||||
@ -0,0 +1,11 @@ |
|||||
|
#ifndef _COMMANDS_H |
||||
|
#define _COMMANDS_H |
||||
|
|
||||
|
#include <cpdefs.h> |
||||
|
|
||||
|
|
||||
|
|
||||
|
extern struct comm spcp_coms[]; |
||||
|
extern struct comm nutcp_coms[]; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,25 @@ |
|||||
|
#ifndef _COMPLETION_H |
||||
|
#define _COMPLETION_H |
||||
|
|
||||
|
/* The types for command completion keywords. Note that these |
||||
|
* constants are built into cmdtab.c, so DON'T change them unless you |
||||
|
* want to change all of the bitmasks in cp_coms. Note that this is |
||||
|
* spice- and nutmeg- dependent. */ |
||||
|
|
||||
|
#define CT_FILENAME 0 |
||||
|
#define CT_CKTNAMES 2 |
||||
|
#define CT_COMMANDS 3 |
||||
|
#define CT_DBNUMS 4 |
||||
|
#define CT_DEVNAMES 5 |
||||
|
#define CT_LISTINGARGS 6 |
||||
|
#define CT_NODENAMES 7 |
||||
|
#define CT_PLOT 8 |
||||
|
#define CT_PLOTKEYWORDS 9 |
||||
|
#define CT_RUSEARGS 10 |
||||
|
#define CT_STOPARGS 11 |
||||
|
#define CT_UDFUNCS 12 |
||||
|
#define CT_VARIABLES 13 |
||||
|
#define CT_VECTOR 14 |
||||
|
#define CT_TYPENAMES 16 |
||||
|
|
||||
|
#endif |
||||
@ -1,12 +0,0 @@ |
|||||
/************* |
|
||||
* Header file for compose.c |
|
||||
* 1999 E. Rouat |
|
||||
************/ |
|
||||
|
|
||||
#ifndef COMPOSE_H_INCLUDED |
|
||||
#define COMPOSE_H_INCLUDED |
|
||||
|
|
||||
void com_compose(wordlist *wl); |
|
||||
|
|
||||
|
|
||||
#endif |
|
||||
@ -1,355 +0,0 @@ |
|||||
/********** |
|
||||
Copyright 1990 Regents of the University of California. All rights reserved. |
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group |
|
||||
**********/ |
|
||||
|
|
||||
/* |
|
||||
* Table of available commands. Note that they're sorted so that the commands |
|
||||
* that appear in the spiceinit file are at the top. |
|
||||
*/ |
|
||||
|
|
||||
#include "ngspice.h" |
|
||||
#include "cpdefs.h" |
|
||||
#include "ftedefs.h" |
|
||||
#include "ftehelp.h" |
|
||||
#include "nutctab.h" |
|
||||
|
|
||||
|
|
||||
/* Bool fields: stringargs, spiceonly, major */ |
|
||||
|
|
||||
struct comm nutcp_coms[] = { |
|
||||
{ "let", com_let, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
arg_let, |
|
||||
"varname = expr : Assign vector variables." } , |
|
||||
{ "reshape", com_reshape, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
arg_let, |
|
||||
"vector ... [ shape ] : change the dimensions of a vector." } , |
|
||||
{ "define", com_define, FALSE, FALSE, TRUE, |
|
||||
{ 010000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[[func (args)] stuff] : Define a user-definable function." } , |
|
||||
{ "set", com_set, FALSE, FALSE, TRUE, |
|
||||
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, |
|
||||
arg_set, |
|
||||
"[option] [option = value] ... : Set a variable." } , |
|
||||
{ "alias", com_alias, FALSE, FALSE, FALSE, |
|
||||
{ 02, 04, 04, 04 }, E_ADVANCED, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[[word] alias] : Define an alias." } , |
|
||||
{ "deftype", com_dftype, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"spec name pat ... : Redefine vector and plot types.\n" } , |
|
||||
{ "plot", com_plot, FALSE, FALSE, TRUE, |
|
||||
{ 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, |
|
||||
arg_plot, |
|
||||
"expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, |
|
||||
{ "display", com_display, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 0, LOTS, |
|
||||
arg_display, |
|
||||
": Display vector status." } , |
|
||||
{ "destroy", com_destroy, FALSE, FALSE, FALSE, |
|
||||
{ 0400, 0400, 0400, 0400 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[plotname] ... : Throw away all the data in the plot." } , |
|
||||
{ "setplot", com_splot, FALSE, FALSE, TRUE, |
|
||||
{ 0400, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[plotname] : Change the current working plot." } , |
|
||||
{ "setcirc", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[circuit name] : Change the current circuit." } , |
|
||||
{ "setscale", com_setscale, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[vecname] : Change default scale of current working plot." } , |
|
||||
{ "transpose", com_transpose, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"varname ... : Perform matrix transposition on multi-D vectors." } , |
|
||||
{ "xgraph", com_xgraph, FALSE, FALSE, TRUE, |
|
||||
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file plotargs : Send plot to Xgraph-11." } , |
|
||||
{ "hardcopy", com_hardcopy, FALSE, FALSE, TRUE, |
|
||||
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file plotargs : Produce hardcopy plots." } , |
|
||||
{ "asciiplot", com_asciiplot, FALSE, FALSE, TRUE, |
|
||||
{ 041000, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"plotargs : Produce ascii plots." } , |
|
||||
{ "write", com_write, FALSE, FALSE, TRUE, |
|
||||
{ 1, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file expr ... : Write data to a file." } , |
|
||||
{ "compose", com_compose, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"var parm=val ... : Compose a vector." } , |
|
||||
{ "unlet", com_unlet, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"varname ... : Undefine vectors." } , |
|
||||
{ "print", com_print, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, |
|
||||
arg_print, |
|
||||
"[col] expr ... : Print vector values." } , |
|
||||
{ "load", com_load, FALSE, FALSE, TRUE, |
|
||||
{ 1, 1, 1, 1 }, E_BEGINNING | E_NOPLOTS, 1, LOTS, |
|
||||
arg_load, |
|
||||
"file ... : Load in data." } , |
|
||||
{ "cross", com_cross, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 0, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"vecname number [ vector ... ] : Make a vector in a strange way." } , |
|
||||
{ "undefine", com_undefine, FALSE, FALSE, FALSE, |
|
||||
{ 010000, 010000, 010000, 010000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[func ...] : Undefine a user-definable function." } , |
|
||||
{ "op", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.op line args] : Determine the operating point of the circuit." } , |
|
||||
{ "tran", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.tran line args] : Do a transient analysis." } , |
|
||||
{ "ac", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.ac line args] : Do an ac analysis." } , |
|
||||
{ "dc", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.dc line args] : Do a dc analysis." } , |
|
||||
{ "pz", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.pz line args] : Do a pole / zero analysis." } , |
|
||||
{ "sens", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.ac line args] : Do a sensitivity analysis." } , |
|
||||
{ "disto", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.disto line args] : Do an distortion analysis." } , |
|
||||
{ "noise", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.noise line args] : Do a noise analysis." } , |
|
||||
{ "listing", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0100, 0100, 0100, 0100 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[logical] [physical] [deck] : Print the current circuit." } , |
|
||||
{ "edit", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[filename] : Edit a spice deck and then load it in." } , |
|
||||
{ "dump", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Print a dump of the current circuit." } , |
|
||||
{ "fourier", com_fourier, FALSE, FALSE, TRUE, |
|
||||
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"fund_freq vector ... : Do a fourier analysis of some data." } , |
|
||||
{ "show", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"devspecs ... : parmspecs ... : Print out device parameters." } , |
|
||||
{ "alter", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 040, 040, 040, 040 }, E_DEFHMASK, 3, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"devspecs : parmname value : Alter device parameters." } , |
|
||||
{ "altermod", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 040, 040, 040, 040 }, E_DEFHMASK, 3, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"devspecs : parmname value : Alter model parameters." } , |
|
||||
{ "resume", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Continue after a stop." } , |
|
||||
{ "state", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"(unimplemented) : Print the state of the circuit." }, |
|
||||
{ "stop", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 04200, 04200, 04200, 04200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[stop args] : Set a breakpoint." } , |
|
||||
{ "trace", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [node ...] : Trace a node." } , |
|
||||
{ "save", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [node ...] : Save a spice output." } , |
|
||||
{ "iplot", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [node ...] : Incrementally plot a node." } , |
|
||||
{ "status", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Print the current breakpoints and traces." } , |
|
||||
{ "delete", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 020, 020, 020, 020 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [break number ...] : Delete breakpoints and traces." } , |
|
||||
{ "step", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[number] : Iterate number times, or one." } , |
|
||||
{ "reset", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Terminate a simulation after a breakpoint (formerly 'end')." } , |
|
||||
{ "run", NULL, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[rawfile] : Run the simulation as specified in the input file." } , |
|
||||
{ "bug", com_bug, FALSE, FALSE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Report a %s bug." } , |
|
||||
{ "newhelp", com_ahelp, FALSE, FALSE, TRUE, |
|
||||
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[command name] ... : help." }, |
|
||||
{ "tutorial", com_ghelp, FALSE, FALSE, TRUE, |
|
||||
{ 023010, 023010, 023010, 023010 }, E_BEGINNING, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[subject] ... : Hierarchical documentation browser." } , |
|
||||
{ "help", com_ghelp, FALSE, FALSE, TRUE, |
|
||||
{ 023010, 023010, 023010, 023010 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[subject] ... : Hierarchical documentation browser." } , |
|
||||
{ "oldhelp", com_help, FALSE, FALSE, TRUE, |
|
||||
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[command name] ... : Print help." } , |
|
||||
{ "quit", com_quit, FALSE, FALSE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_BEGINNING, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Quit %s." } , |
|
||||
{ "source", nutcom_source, FALSE, FALSE, TRUE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file : Source a %s file." } , |
|
||||
{ "shift", com_shift, FALSE, FALSE, FALSE, |
|
||||
{ 020000, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
|
||||
(int (*)()) NULL, |
|
||||
"[var] [number] : Shift argv or the named list var to the left." } , |
|
||||
{ "unset", com_unset, FALSE, FALSE, FALSE, |
|
||||
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"varname ... : Unset a variable." } , |
|
||||
{ "unalias", com_unalias, FALSE, FALSE, FALSE, |
|
||||
{ 02, 02, 02, 02 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"word ... : Undefine an alias." } , |
|
||||
{ "history", com_history, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
|
||||
(int (*)()) NULL, |
|
||||
"[-r] [number] : Print command history." } , |
|
||||
{ "echo", com_echo, FALSE, FALSE, FALSE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[stuff ...] : Print stuff." } , |
|
||||
{ "shell", com_shell, FALSE, FALSE, TRUE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[args] : Fork a shell, or execute the command." } , |
|
||||
{ "rusage", com_rusage, FALSE, FALSE, FALSE, |
|
||||
{ 02000, 02000, 02000, 02000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[resource ...] : Print current resource usage." } , |
|
||||
{ "cd", com_chdir, FALSE, FALSE, FALSE, |
|
||||
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[directory] : Change working directory." } , |
|
||||
{ "version", com_version, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[number] : Print the version number." } , |
|
||||
{ "diff", com_diff, FALSE, FALSE, FALSE, |
|
||||
{ 0400, 0400, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"plotname plotname [vec ...] : 'diff' two plots." } , |
|
||||
{ "rehash", com_rehash, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Rebuild the unix command database." } , |
|
||||
{ "while", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"condition : Execute while the condition is TRUE." } , |
|
||||
{ "repeat", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0}, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[number] : Repeat number times, or forever." } , |
|
||||
{ "dowhile", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"condition : Execute while the condition is TRUE." } , |
|
||||
{ "foreach", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"variable value ... : Do once for each value." } , |
|
||||
{ "if", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"condition : Execute if the condition is TRUE." } , |
|
||||
{ "else", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Goes with if." } , |
|
||||
{ "end", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": End a block." } , |
|
||||
{ "break", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Break out of a block." } , |
|
||||
{ "continue", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Continue a loop." } , |
|
||||
{ "label", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"word : Create someplace to go to." } , |
|
||||
{ "goto", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0100000, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"word : Go to a label." } , |
|
||||
{ "cdump", com_cdump, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Dump the current control structures." } , |
|
||||
{ "settype", com_stype, FALSE, FALSE, FALSE, |
|
||||
{ 0200000, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"type vec ... : Change the type of a vector." } , |
|
||||
{ "strcmp", com_strcmp, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, 3, |
|
||||
(int (*)()) NULL, |
|
||||
"varname s1 s2 : Set $varname to strcmp(s1, s2)." } , |
|
||||
{ "linearize", NULL, FALSE, TRUE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
" [ vec ... ] : Convert plot into one with linear scale." } , |
|
||||
|
|
||||
{ 0, NULL, FALSE, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
NULL } |
|
||||
|
|
||||
} ; |
|
||||
|
|
||||
@ -1,12 +0,0 @@ |
|||||
/************* |
|
||||
* Header file for nutctab.c |
|
||||
* 1999 E. Rouat |
|
||||
************/ |
|
||||
|
|
||||
#ifndef NUTCTAB_H_INCLUDED |
|
||||
#define NUTCTAB_H_INCLUDED |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
#endif |
|
||||
@ -0,0 +1,3 @@ |
|||||
|
Makefile.in |
||||
|
Makefile |
||||
|
.deps |
||||
@ -0,0 +1,17 @@ |
|||||
|
noinst_LIBRARIES = libplotting.a |
||||
|
|
||||
|
libplotting_a_SOURCES = \
|
||||
|
plotting.c \
|
||||
|
plotting.h \
|
||||
|
pvec.c \
|
||||
|
pvec.h \
|
||||
|
plot5.c \
|
||||
|
plot5.h \
|
||||
|
x11.c \
|
||||
|
x11.h \
|
||||
|
xgraph.c \
|
||||
|
xgraph.h |
||||
|
|
||||
|
INCLUDES = -I$(top_srcdir)/src/include @X_CFLAGS@ |
||||
|
|
||||
|
MAINTAINERCLEANFILES = Makefile.in |
||||
@ -0,0 +1,16 @@ |
|||||
|
#include <ngspice.h> |
||||
|
|
||||
|
#include "plotting.h" |
||||
|
|
||||
|
/* Where 'constants' go when defined on initialization. */ |
||||
|
|
||||
|
struct plot constantplot = { |
||||
|
"Constant values", "Sat Aug 16 10:55:15 PDT 1986", "constants", |
||||
|
"const", NULL, NULL, NULL, NULL, NULL, NULL, TRUE |
||||
|
} ; |
||||
|
|
||||
|
struct plot *plot_cur = &constantplot; |
||||
|
struct plot *plot_list = &constantplot; |
||||
|
int plotl_changed; /* TRUE after a load */ |
||||
|
|
||||
|
int plot_num = 1; |
||||
@ -0,0 +1,12 @@ |
|||||
|
#ifndef _PLOTTING_H |
||||
|
#define _PLOTTING_H |
||||
|
|
||||
|
#include <plot.h> |
||||
|
|
||||
|
extern struct plot constantplot; |
||||
|
extern struct plot *plot_cur; |
||||
|
extern struct plot *plot_list; |
||||
|
extern int plotl_changed; |
||||
|
extern int plot_num; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,85 @@ |
|||||
|
#include <ngspice.h> |
||||
|
#include <dvec.h> |
||||
|
#include <plot.h> |
||||
|
#include <fteext.h> |
||||
|
|
||||
|
#include "pvec.h" |
||||
|
|
||||
|
void |
||||
|
pvec(struct dvec *d) |
||||
|
{ |
||||
|
char buf[BSIZE_SP], buf2[BSIZE_SP]; |
||||
|
|
||||
|
sprintf(buf, " %-20s: %s, %s, %d long", |
||||
|
d->v_name, |
||||
|
ft_typenames(d->v_type), |
||||
|
isreal(d) ? "real" : "complex", |
||||
|
d->v_length); |
||||
|
if (d->v_flags & VF_MINGIVEN) { |
||||
|
sprintf(buf2, ", min = %g", d->v_minsignal); |
||||
|
strcat(buf, buf2); |
||||
|
} |
||||
|
if (d->v_flags & VF_MAXGIVEN) { |
||||
|
sprintf(buf2, ", max = %g", d->v_maxsignal); |
||||
|
strcat(buf, buf2); |
||||
|
} |
||||
|
switch (d->v_gridtype) { |
||||
|
case GRID_LOGLOG: |
||||
|
strcat(buf, ", grid = loglog"); |
||||
|
break; |
||||
|
|
||||
|
case GRID_XLOG: |
||||
|
strcat(buf, ", grid = xlog"); |
||||
|
break; |
||||
|
|
||||
|
case GRID_YLOG: |
||||
|
strcat(buf, ", grid = ylog"); |
||||
|
break; |
||||
|
|
||||
|
case GRID_POLAR: |
||||
|
strcat(buf, ", grid = polar"); |
||||
|
break; |
||||
|
|
||||
|
case GRID_SMITH: |
||||
|
strcat(buf, ", grid = smith (xformed)"); |
||||
|
break; |
||||
|
|
||||
|
case GRID_SMITHGRID: |
||||
|
strcat(buf, ", grid = smithgrid (not xformed)"); |
||||
|
break; |
||||
|
|
||||
|
default: |
||||
|
} |
||||
|
|
||||
|
switch (d->v_plottype) { |
||||
|
|
||||
|
case PLOT_COMB: |
||||
|
strcat(buf, ", plot = comb"); |
||||
|
break; |
||||
|
|
||||
|
case PLOT_POINT: |
||||
|
strcat(buf, ", plot = point"); |
||||
|
break; |
||||
|
|
||||
|
default: |
||||
|
} |
||||
|
if (d->v_defcolor) { |
||||
|
sprintf(buf2, ", color = %s", d->v_defcolor); |
||||
|
strcat(buf, buf2); |
||||
|
} |
||||
|
if (d->v_scale) { |
||||
|
sprintf(buf2, ", scale = %s", d->v_scale->v_name); |
||||
|
strcat(buf, buf2); |
||||
|
} |
||||
|
if (d->v_numdims > 1) { |
||||
|
sprintf(buf2, ", dims = [%s]", dimstring(d->v_dims, d->v_numdims)); |
||||
|
strcat(buf, buf2); |
||||
|
} |
||||
|
if (d->v_plot->pl_scale == d) { |
||||
|
strcat(buf, " [default scale]\n"); |
||||
|
} else { |
||||
|
strcat(buf, "\n"); |
||||
|
} |
||||
|
out_send(buf); |
||||
|
return; |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
#ifndef _PVEC_H |
||||
|
#define _PVEC_H |
||||
|
|
||||
|
#include <dvec.h> |
||||
|
|
||||
|
void pvec(struct dvec *d); |
||||
|
|
||||
|
#endif |
||||
@ -1,381 +0,0 @@ |
|||||
/********** |
|
||||
Copyright 1990 Regents of the University of California. All rights reserved. |
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group |
|
||||
**********/ |
|
||||
|
|
||||
/* |
|
||||
* Table of available commands. Note that they're sorted so that the commands |
|
||||
* that appear in the spiceinit file are at the top. |
|
||||
*/ |
|
||||
|
|
||||
#include "ngspice.h" |
|
||||
#include "cpdefs.h" |
|
||||
#include "ftedefs.h" |
|
||||
#include "ftehelp.h" |
|
||||
|
|
||||
|
|
||||
/* Bool fields: stringargs, spiceonly, major */ |
|
||||
|
|
||||
struct comm spcp_coms[] = { |
|
||||
|
|
||||
{ "let", com_let, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
arg_let, |
|
||||
"varname = expr : Assign vector variables." } , |
|
||||
{ "reshape", com_reshape, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
arg_let, |
|
||||
"vector ... [ shape ] : change the dimensions of a vector." } , |
|
||||
{ "define", com_define, FALSE, FALSE, TRUE, |
|
||||
{ 010000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[[func (args)] stuff] : Define a user-definable function." } , |
|
||||
{ "set", com_set, FALSE, FALSE, TRUE, |
|
||||
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 0, LOTS, |
|
||||
arg_set, |
|
||||
"[option] [option = value] ... : Set a variable." } , |
|
||||
{ "alias", com_alias, FALSE, FALSE, FALSE, |
|
||||
{ 02, 04, 04, 04 }, E_ADVANCED, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[[word] alias] : Define an alias." } , |
|
||||
{ "deftype", com_dftype, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"spec name pat ... : Redefine vector and plot types.\n" } , |
|
||||
{ "plot", com_plot, FALSE, FALSE, TRUE, |
|
||||
{ 041000, 041000, 041000, 041000 }, E_BEGINNING | E_HASPLOTS, 1, LOTS, |
|
||||
arg_plot, |
|
||||
"expr ... [vs expr] [xl xlo xhi] [yl ylo yhi] : Plot things." }, |
|
||||
{ "display", com_display, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 0, LOTS, |
|
||||
arg_display, |
|
||||
": Display vector status." } , |
|
||||
{ "destroy", com_destroy, FALSE, FALSE, FALSE, |
|
||||
{ 0400, 0400, 0400, 0400 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[plotname] ... : Throw away all the data in the plot." } , |
|
||||
{ "setplot", com_splot, FALSE, FALSE, TRUE, |
|
||||
{ 0400, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[plotname] : Change the current working plot." } , |
|
||||
{ "setcirc", com_scirc, FALSE, TRUE, FALSE, |
|
||||
{ 04, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[circuit name] : Change the current circuit." } , |
|
||||
{ "setscale", com_setscale, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[vecname] : Change default scale of current working plot." } , |
|
||||
{ "transpose", com_transpose, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"varname ... : Perform matrix transposition on multi-D vectors." } , |
|
||||
{ "xgraph", com_xgraph, FALSE, FALSE, TRUE, |
|
||||
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file plotargs : Send plot to Xgraph-11." } , |
|
||||
{ "hardcopy", com_hardcopy, FALSE, FALSE, TRUE, |
|
||||
{ 1, 041000, 041000, 041000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file plotargs : Produce hardcopy plots." } , |
|
||||
{ "asciiplot", com_asciiplot, FALSE, FALSE, TRUE, |
|
||||
{ 041000, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"plotargs : Produce ascii plots." } , |
|
||||
{ "write", com_write, FALSE, FALSE, TRUE, |
|
||||
{ 1, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file expr ... : Write data to a file." } , |
|
||||
{ "compose", com_compose, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"var parm=val ... : Compose a vector." } , |
|
||||
{ "unlet", com_unlet, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"varname ... : Undefine vectors." } , |
|
||||
{ "print", com_print, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_BEGINNING, 1, LOTS, |
|
||||
arg_print, |
|
||||
"[col] expr ... : Print vector values." } , |
|
||||
{ "load", com_load, FALSE, FALSE, TRUE, |
|
||||
{ 1, 1, 1, 1 }, E_BEGINNING | E_NOPLOTS, 1, LOTS, |
|
||||
arg_load, |
|
||||
"file ... : Load in data." } , |
|
||||
{ "cross", com_cross, FALSE, FALSE, TRUE, |
|
||||
{ 040000, 0, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"vecname number [ vector ... ] : Make a vector in a strange way." } , |
|
||||
{ "undefine", com_undefine, FALSE, FALSE, FALSE, |
|
||||
{ 010000, 010000, 010000, 010000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[func ...] : Undefine a user-definable function." } , |
|
||||
{ "op", com_op, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.op line args] : Determine the operating point of the circuit." } , |
|
||||
{ "tf", com_tf, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.tran line args] : Do a transient analysis." } , |
|
||||
{ "tran", com_tran, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.tran line args] : Do a transient analysis." } , |
|
||||
{ "ac", com_ac, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.ac line args] : Do an ac analysis." } , |
|
||||
{ "dc", com_dc, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.dc line args] : Do a dc analysis." } , |
|
||||
{ "pz", com_pz, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.pz line args] : Do a pole / zero analysis." } , |
|
||||
{ "sens", com_sens, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.sens line args] : Do a sensitivity analysis." } , |
|
||||
{ "disto", com_disto, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.disto line args] : Do an distortion analysis." } , |
|
||||
{ "noise", com_noise, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[.noise line args] : Do a noise analysis." } , |
|
||||
{ "listing", com_listing, FALSE, TRUE, TRUE, |
|
||||
{ 0100, 0100, 0100, 0100 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[logical] [physical] [deck] : Print the current circuit." } , |
|
||||
{ "edit", com_edit, FALSE, TRUE, TRUE, |
|
||||
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[filename] : Edit a spice deck and then load it in." } , |
|
||||
{ "dump", com_dump, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Print a dump of the current circuit." } , |
|
||||
{ "fourier", com_fourier, FALSE, FALSE, TRUE, |
|
||||
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"fund_freq vector ... : Do a fourier analysis of some data." } , |
|
||||
{ "spec", com_spec, FALSE, FALSE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 4, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"start_freq stop_freq step_freq vector ... : Create a frequency domain plot." } , |
|
||||
{ "show", com_show, FALSE, TRUE, FALSE, |
|
||||
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"devices ... : parameters ... : Print out device summary." } , |
|
||||
{ "showmod", com_showmod, FALSE, TRUE, FALSE, |
|
||||
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"models ... : parameters ... : Print out model summary." } , |
|
||||
{ "alter", com_alter, FALSE, TRUE, FALSE, |
|
||||
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"devspecs : parmname value : Alter device parameters." } , |
|
||||
{ "altermod", com_altermod, FALSE, TRUE, FALSE, |
|
||||
{ 040, 040, 040, 040 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"devspecs : parmname value : Alter model parameters." } , |
|
||||
{ "resume", com_resume, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Continue after a stop." } , |
|
||||
{ "state", com_state, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"(unimplemented) : Print the state of the circuit." }, |
|
||||
{ "stop", com_stop, FALSE, TRUE, FALSE, |
|
||||
{ 04200, 04200, 04200, 04200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[stop args] : Set a breakpoint." } , |
|
||||
{ "trace", com_trce, FALSE, TRUE, FALSE, |
|
||||
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [node ...] : Trace a node." } , |
|
||||
{ "save", com_save, FALSE, TRUE, FALSE, |
|
||||
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [node ...] : Save a spice output." } , |
|
||||
{ "iplot", com_iplot, FALSE, TRUE, TRUE, |
|
||||
{ 0200, 0200, 0200, 0200 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [node ...] : Incrementally plot a node." } , |
|
||||
{ "status", com_sttus, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Print the current breakpoints and traces." } , |
|
||||
{ "delete", com_delete, FALSE, TRUE, FALSE, |
|
||||
{ 020, 020, 020, 020 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[all] [break number ...] : Delete breakpoints and traces." } , |
|
||||
{ "step", com_step, FALSE, TRUE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[number] : Iterate number times, or one." } , |
|
||||
{ "reset", com_rset, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Terminate a simulation after a breakpoint (formerly 'end')." } , |
|
||||
{ "run", com_run, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[rawfile] : Run the simulation as specified in the input file." } , |
|
||||
{ "aspice", com_aspice, FALSE, FALSE, FALSE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 1, 2, |
|
||||
(int (*)()) NULL, |
|
||||
"file [outfile] : Run a spice job asynchronously." } , |
|
||||
{ "jobs", com_jobs, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Report on asynchronous spice jobs." } , |
|
||||
{ "rspice", com_rspice, FALSE, FALSE, FALSE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[input file] : Run a spice job remotely." } , |
|
||||
{ "bug", com_bug, FALSE, FALSE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Report a %s bug." } , |
|
||||
{ "where", com_where, FALSE, TRUE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Print last non-converging node or device" } , |
|
||||
{ "newhelp", com_ahelp, FALSE, FALSE, TRUE, |
|
||||
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[command name] ... : help." }, |
|
||||
{ "tutorial", com_ghelp, FALSE, FALSE, TRUE, |
|
||||
{ 023010, 023010, 023010, 023010 }, E_BEGINNING, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[subject] ... : Hierarchical documentation browser." } , |
|
||||
{ "help", com_ghelp, FALSE, FALSE, TRUE, |
|
||||
{ 023010, 023010, 023010, 023010 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[subject] ... : Hierarchical documentation browser." } , |
|
||||
{ "oldhelp", com_help, FALSE, FALSE, TRUE, |
|
||||
{ 010, 010, 010, 010 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[command name] ... : Print help." } , |
|
||||
{ "quit", com_quit, FALSE, FALSE, TRUE, |
|
||||
{ 0, 0, 0, 0 }, E_BEGINNING, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Quit %s." } , |
|
||||
{ "source", com_source, FALSE, FALSE, TRUE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"file : Source a %s file." } , |
|
||||
{ "shift", com_shift, FALSE, FALSE, FALSE, |
|
||||
{ 020000, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
|
||||
(int (*)()) NULL, |
|
||||
"[var] [number] : Shift argv or the named list var to the left." } , |
|
||||
{ "unset", com_unset, FALSE, FALSE, FALSE, |
|
||||
{ 020000, 020000, 020000, 020000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"varname ... : Unset a variable." } , |
|
||||
{ "unalias", com_unalias, FALSE, FALSE, FALSE, |
|
||||
{ 02, 02, 02, 02 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"word ... : Undefine an alias." } , |
|
||||
{ "history", com_history, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 2, |
|
||||
(int (*)()) NULL, |
|
||||
"[-r] [number] : Print command history." } , |
|
||||
{ "echo", com_echo, FALSE, FALSE, FALSE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[stuff ...] : Print stuff." } , |
|
||||
{ "shell", com_shell, FALSE, FALSE, TRUE, |
|
||||
{ 1, 1, 1, 1 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[args] : Fork a shell, or execute the command." } , |
|
||||
{ "rusage", com_rusage, FALSE, FALSE, FALSE, |
|
||||
{ 02000, 02000, 02000, 02000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[resource ...] : Print current resource usage." } , |
|
||||
{ "cd", com_chdir, FALSE, FALSE, FALSE, |
|
||||
{ 1, 0, 0, 0 }, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[directory] : Change working directory." } , |
|
||||
{ "version", com_version, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"[number] : Print the version number." } , |
|
||||
{ "diff", com_diff, FALSE, FALSE, FALSE, |
|
||||
{ 0400, 0400, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"plotname plotname [vec ...] : 'diff' two plots." } , |
|
||||
{ "rehash", com_rehash, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Rebuild the unix command database." } , |
|
||||
{ "while", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"condition : Execute while the condition is TRUE." } , |
|
||||
{ "repeat", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0}, E_DEFHMASK, 0, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"[number] : Repeat number times, or forever." } , |
|
||||
{ "dowhile", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"condition : Execute while the condition is TRUE." } , |
|
||||
{ "foreach", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"variable value ... : Do once for each value." } , |
|
||||
{ "if", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"condition : Execute if the condition is TRUE." } , |
|
||||
{ "else", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Goes with if." } , |
|
||||
{ "end", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": End a block." } , |
|
||||
{ "break", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Break out of a block." } , |
|
||||
{ "continue", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Continue a loop." } , |
|
||||
{ "label", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"word : Create someplace to go to." } , |
|
||||
{ "goto", NULL, FALSE, FALSE, FALSE, |
|
||||
{ 0100000, 0, 0, 0 }, E_DEFHMASK, 1, 1, |
|
||||
(int (*)()) NULL, |
|
||||
"word : Go to a label." } , |
|
||||
{ "cdump", com_cdump, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, 0, |
|
||||
(int (*)()) NULL, |
|
||||
": Dump the current control structures." } , |
|
||||
{ "settype", com_stype, FALSE, FALSE, FALSE, |
|
||||
{ 0200000, 040000, 040000, 040000 }, E_DEFHMASK, 2, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
"type vec ... : Change the type of a vector." } , |
|
||||
{ "strcmp", com_strcmp, FALSE, FALSE, FALSE, |
|
||||
{ 0, 0, 0, 0 }, E_DEFHMASK, 3, 3, |
|
||||
(int (*)()) NULL, |
|
||||
"varname s1 s2 : Set $varname to strcmp(s1, s2)." } , |
|
||||
{ "linearize", com_linearize, FALSE, TRUE, FALSE, |
|
||||
{ 040000, 040000, 040000, 040000 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
" [ vec ... ] : Convert plot into one with linear scale." } , |
|
||||
{ 0, NULL, FALSE, FALSE, FALSE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, |
|
||||
(int (*)()) NULL, |
|
||||
NULL } |
|
||||
}; |
|
||||
|
|
||||
@ -0,0 +1,8 @@ |
|||||
|
#ifndef _STREAMS_H |
||||
|
#define _STREAMS_H |
||||
|
|
||||
|
extern FILE *cp_in; |
||||
|
extern FILE *cp_out; |
||||
|
extern FILE *cp_err; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,25 @@ |
|||||
|
#include <stdio.h> |
||||
|
|
||||
|
#include "commands.h" |
||||
|
|
||||
|
|
||||
|
void |
||||
|
print_struct_comm(struct comm coms[]) |
||||
|
{ |
||||
|
int i; |
||||
|
|
||||
|
for (i = 0; coms[i].co_comname != NULL; i++) { |
||||
|
printf("Command: %s\n" |
||||
|
"help: %s\n\n", |
||||
|
coms[i].co_comname, |
||||
|
coms[i].co_help); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
int |
||||
|
main(void) |
||||
|
{ |
||||
|
print_struct_comm(nutcp_coms); |
||||
|
print_struct_comm(spcp_coms); |
||||
|
return 0; |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
#ifndef _BOOL_H |
||||
|
#define _BOOL_H |
||||
|
|
||||
|
typedef int bool; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,65 @@ |
|||||
|
#ifndef _DVEC_H |
||||
|
#define _DVEC_H |
||||
|
|
||||
|
#include "complex.h" |
||||
|
#include "grid.h" |
||||
|
|
||||
|
|
||||
|
/* Dvec flags. */ |
||||
|
enum dvec_flags { |
||||
|
VF_REAL = (1 << 0), /* The data is real. */ |
||||
|
VF_COMPLEX = (1 << 1), /* The data is complex. */ |
||||
|
VF_ACCUM = (1 << 2), /* writedata should save this vector. */ |
||||
|
VF_PLOT = (1 << 3), /* writedata should incrementally plot it. */ |
||||
|
VF_PRINT = (1 << 4), /* writedata should print this vector. */ |
||||
|
VF_MINGIVEN = (1 << 5), /* The v_minsignal value is valid. */ |
||||
|
VF_MAXGIVEN = (1 << 6), /* The v_maxsignal value is valid. */ |
||||
|
VF_PERMANENT = (1 << 7) /* Don't garbage collect this vector. */ |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/* Plot types. */ |
||||
|
typedef enum { |
||||
|
PLOT_LIN, PLOT_COMB, PLOT_POINT |
||||
|
} PLOTTYPE; |
||||
|
|
||||
|
|
||||
|
/* A (possibly multi-dimensional) data vector. The data is represented |
||||
|
* internally by a 1-d array. The number of dimensions and the size |
||||
|
* of each dimension is recorded, along with v_length, the total size of |
||||
|
* the array. If the dimensionality is 0 or 1, v_length is significant |
||||
|
* instead of v_numdims and v_dims, and the vector is handled in the old |
||||
|
* manner. |
||||
|
*/ |
||||
|
|
||||
|
#define MAXDIMS 8 |
||||
|
|
||||
|
struct dvec { |
||||
|
char *v_name; /* Same as so_vname. */ |
||||
|
int v_type; /* Same as so_vtype. */ |
||||
|
short v_flags; /* Flags (a combination of VF_*). */ |
||||
|
double *v_realdata; /* Real data. */ |
||||
|
complex *v_compdata; /* Complex data. */ |
||||
|
double v_minsignal; /* Minimum value to plot. */ |
||||
|
double v_maxsignal; /* Maximum value to plot. */ |
||||
|
GRIDTYPE v_gridtype; /* One of GRID_*. */ |
||||
|
PLOTTYPE v_plottype; /* One of PLOT_*. */ |
||||
|
int v_length; /* Length of the vector. */ |
||||
|
int v_rlength; /* How much space we really have. */ |
||||
|
int v_outindex; /* Index if writedata is building the |
||||
|
vector. */ |
||||
|
int v_linestyle; /* What line style we are using. */ |
||||
|
int v_color; /* What color we are using. */ |
||||
|
char *v_defcolor; /* The name of a color to use. */ |
||||
|
int v_numdims; /* How many dims -- 0 = scalar (len = 1). */ |
||||
|
int v_dims[MAXDIMS]; /* The actual size in each dimension. */ |
||||
|
struct plot *v_plot; /* The plot structure (if it has one). */ |
||||
|
struct dvec *v_next; /* Link for list of plot vectors. */ |
||||
|
struct dvec *v_link2; /* Extra link for things like print. */ |
||||
|
struct dvec *v_scale; /* If this has a non-standard scale... */ |
||||
|
} ; |
||||
|
|
||||
|
#define isreal(v) ((v)->v_flags & VF_REAL) |
||||
|
#define iscomplex(v) ((v)->v_flags & VF_COMPLEX) |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,12 @@ |
|||||
|
#ifndef _GRID_H |
||||
|
#define _GRID_H |
||||
|
|
||||
|
/* Grid types. |
||||
|
|
||||
|
Note: SMITHGRID is only a smith grid, SMITH transforms the data */ |
||||
|
typedef enum { |
||||
|
GRID_NONE, GRID_LIN, GRID_LOGLOG, GRID_XLOG, |
||||
|
GRID_YLOG, GRID_POLAR, GRID_SMITH, GRID_SMITHGRID |
||||
|
} GRIDTYPE; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,27 @@ |
|||||
|
#ifndef _PLOT_H |
||||
|
#define _PLOT_H |
||||
|
|
||||
|
#include "wordlist.h" |
||||
|
#include "bool.h" |
||||
|
#include "dvec.h" |
||||
|
#include "variable.h" |
||||
|
|
||||
|
/* The information for a particular set of vectors that come from one |
||||
|
* plot. */ |
||||
|
struct plot { |
||||
|
char *pl_title; /* The title card. */ |
||||
|
char *pl_date; /* Date. */ |
||||
|
char *pl_name; /* The plot name. */ |
||||
|
char *pl_typename; /* Tran1, op2, etc. */ |
||||
|
struct dvec *pl_dvecs; /* The data vectors in this plot. */ |
||||
|
struct dvec *pl_scale; /* The "scale" for the rest of the vectors. */ |
||||
|
struct plot *pl_next; /* List of plots. */ |
||||
|
wordlist *pl_commands; /* Commands to execute for this plot. */ |
||||
|
struct variable *pl_env; /* The 'environment' for this plot. */ |
||||
|
char *pl_ccom; /* The ccom struct for this plot. */ |
||||
|
bool pl_written; /* Some or all of the vecs have been saved. */ |
||||
|
int pl_ndims; /* Number of dimensions */ |
||||
|
} ; |
||||
|
|
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,14 @@ |
|||||
|
#ifndef _PNODE_H |
||||
|
#define _PNODE_H |
||||
|
|
||||
|
struct pnode { |
||||
|
char *pn_name; /* If non-NULL, the name. */ |
||||
|
struct dvec *pn_value; /* Non-NULL in a terminal node. */ |
||||
|
struct func *pn_func; /* Non-NULL is a function. */ |
||||
|
struct op *pn_op; /* Operation if the above two NULL. */ |
||||
|
struct pnode *pn_left; /* Left branch or function argument. */ |
||||
|
struct pnode *pn_right; /* Right branch. */ |
||||
|
struct pnode *pn_next; /* For expression lists. */ |
||||
|
} ; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,19 @@ |
|||||
|
#ifndef _SIM_H |
||||
|
#define _SIM_H |
||||
|
|
||||
|
enum simulation_types { |
||||
|
SV_NOTYPE, |
||||
|
SV_TIME, |
||||
|
SV_FREQUENCY, |
||||
|
SV_VOLTAGE, |
||||
|
SV_CURRENT, |
||||
|
SV_OUTPUT_N_DENS, |
||||
|
SV_OUTPUT_NOISE, |
||||
|
SV_INPUT_N_DENS, |
||||
|
SV_INPUT_NOISE, |
||||
|
SV_POLE, |
||||
|
SV_ZERO, |
||||
|
SV_SPARAM |
||||
|
}; |
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,36 @@ |
|||||
|
#ifndef _VARIABLE_H |
||||
|
#define _VARIABLE_H |
||||
|
|
||||
|
/* Variables that are accessible to the parser via $varname expansions. |
||||
|
* If the type is VT_LIST the value is a pointer to a list of the elements. |
||||
|
*/ |
||||
|
|
||||
|
struct variable { |
||||
|
char va_type; |
||||
|
char *va_name; |
||||
|
union { |
||||
|
bool vV_bool; |
||||
|
int vV_num; |
||||
|
double vV_real; |
||||
|
char *vV_string; |
||||
|
struct variable *vV_list; |
||||
|
} va_V; |
||||
|
struct variable *va_next; /* Link. */ |
||||
|
} ; |
||||
|
|
||||
|
#define va_bool va_V.vV_bool |
||||
|
#define va_num va_V.vV_num |
||||
|
#define va_real va_V.vV_real |
||||
|
#define va_string va_V.vV_string |
||||
|
#define va_vlist va_V.vV_list |
||||
|
|
||||
|
enum vt_types { |
||||
|
VT_BOOL, |
||||
|
VT_NUM, |
||||
|
VT_REAL, |
||||
|
VT_STRING, |
||||
|
VT_LIST |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
#endif |
||||
@ -0,0 +1,14 @@ |
|||||
|
#ifndef _WORDLIST_H |
||||
|
#define _WORDLIST_H |
||||
|
|
||||
|
|
||||
|
/* Doubly linked lists of words. */ |
||||
|
struct wordlist { |
||||
|
char *wl_word; |
||||
|
struct wordlist *wl_next; |
||||
|
struct wordlist *wl_prev; |
||||
|
} ; |
||||
|
|
||||
|
typedef struct wordlist wordlist; |
||||
|
|
||||
|
#endif |
||||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue