home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / n / spice / docs / FTE / LPR / WRITEDATA < prev   
Encoding:
Text File  |  1988-01-27  |  5.7 KB  |  199 lines

  1.  
  2.  
  3.  
  4. WRITEDATA(3)        UNIX Programmer's Manual         WRITEDATA(3)
  5.  
  6.  
  7.  
  8. NAME
  9.      wrd_open, wrd_run, wrd_init, wrd_command, wrd_output,
  10.      wrd_point, wrd_end, wrd_close, wrd_chtrace, wrd_stopnow -
  11.      spice output routines
  12.  
  13. SYNOPSIS
  14.      #include "FTEwritedata.h"
  15.  
  16.      int wrd_open(filename, title, asciiflag)
  17.      char *filename, *title;
  18.  
  19.      int wrd_run(title)
  20.      char *title;
  21.  
  22.      int wrd_init(plotname, flags)
  23.      char *plotname;
  24.      short flags;
  25.  
  26.      int wrd_command(comm)
  27.      char *comm;
  28.  
  29.      int wrd_output(name, type, flags)
  30.      char *name;
  31.      short flags;
  32.  
  33.      int wrd_point(rdata, idata)
  34.      double *rdata, *idata;
  35.  
  36.      int wrd_end()
  37.  
  38.      int wrd_close()
  39.  
  40.      int wrd_chtrace(name, addflag, what)
  41.      char *name;
  42.  
  43.      int wrd_stopnow()
  44.  
  45. DESCRIPTION
  46.      These routines are used by SPICE3 to create raw data files.
  47.      They can be used with any circuit simulator that outputs
  48.      data similar to that of SPICE3, making it usable with nut-
  49.      meg(1) and sconvert(1). See the manual page for sconvert(1)
  50.      for details of the data file formats.
  51.  
  52.      To compile a program with writedata, you should link with
  53.      the files "writedata.o", "std.o", and "wrdfix.o". The file
  54.      "std.c" contains some utility routines, and the file
  55.      "wrdfix.c" contains dummy declarations that allow writedata
  56.      to be used apart from the rest of the front-end.
  57.  
  58.      Descriptions of the routines follow. Note that they must be
  59.      called in the order given, except where noted.
  60.  
  61.  
  62.  
  63. Printed 12/9/85            Aug 7, 1985                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. WRITEDATA(3)        UNIX Programmer's Manual         WRITEDATA(3)
  71.  
  72.  
  73.  
  74.      wrd_open opens the file filename, and begins creating a raw
  75.      file with the title title. If asciiflag is 1, then an ascii
  76.      format file is created, otherwise a binary format file is
  77.      written. Either this call or wrd_run must be the first call
  78.      to a writedata routine.
  79.  
  80.      wrd_run starts a run of a circuit with a title of title. All
  81.      the data passed to writedata from now on is accumulated and
  82.      is available to the user after the run is finished. This
  83.      only works when the SPICE3 front-end (FTE) is compiled as a
  84.      part of the simulator.
  85.  
  86.      wrd_init starts a run. Any number of runs may be done with
  87.      one call to wrd_open, with the result that they are placed
  88.      in the file one after another.
  89.  
  90.      wrd_command causes the SPICE3 or nutmeg command string comm
  91.      to be written to the file, to be executed by nutmeg whenever
  92.      the file is read in or made current with the setplot com-
  93.      mand. If the current run was started with a wrd_run, the
  94.      command is executed immediately, in addition to being saved
  95.      for setplot commands. Note that all commands must be given
  96.      between the call to wrd_init and the first call to
  97.      wrd_output. A common command is version version-id, which
  98.      causes nutmeg to warn the user if the version-id is out of
  99.      date.
  100.  
  101.      wrd_output declares an output variable, with name name,
  102.      variable type type, and variable flags determined by or'ing
  103.      the flags given to wrd_init and the flags argument.  Flags
  104.      are as follows, defined in the file "FTEconstant.h" (which
  105.      is included by "FTEwritedata.h"):
  106.  
  107.      #define VF_REAL     (1 << 0) /* The data is complex. */
  108.      #define VF_COMPLEX  (1 << 1) /* The data is real. */
  109.      #define VF_ACCUM    (1 << 2) /* Save this vector. */
  110.      #define VF_PLOT     (1 << 3) /* Incrementally plot it. */
  111.      #define VF_PRINT    (1 << 4) /* Print this vector. */
  112.      #define VF_LOGSCALE (1 << 5) /* Use a log scale to plot this. */
  113.  
  114.      Only the flags VF_REAL, VF_COMPLEX, and VF_LOGSCALE should
  115.      be used. The variable types are defined as follows:
  116.  
  117.      #define SV_NOTYPE   0
  118.      #define SV_TIME     1
  119.      #define SV_FREQUENCY    2
  120.      #define SV_VOLTAGE  3
  121.      #define SV_CURRENT  4
  122.      #define SV_OUTPUT_NOISE 5
  123.      #define SV_INPUT_NOISE  6
  124.      #define SV_HD2      7
  125.      #define SV_HD3      8
  126.  
  127.  
  128.  
  129. Printed 12/9/85            Aug 7, 1985                          2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. WRITEDATA(3)        UNIX Programmer's Manual         WRITEDATA(3)
  137.  
  138.  
  139.  
  140.      #define SV_DIM2     9
  141.      #define SV_SIM2     10
  142.      #define SV_DIM3     11
  143.  
  144.      Any number of outputs may be declared. The types of vari-
  145.      ables and the order in which they are declared must be con-
  146.      sistent with the succeeding calls to wrd_point.
  147.  
  148.      wrd_point is given pointers to real and imaginary vectors,
  149.      each point of which corresponds to a point to be added to
  150.      one of the outputs declared above.  If the outputs are all
  151.      real, then the idata pointer may be NULL.
  152.  
  153.      wrd_end is called when there are no more points to be out-
  154.      put. A new call to wrd_init may now be given, if writedata
  155.      is writing to a file.
  156.  
  157.      wrd_close closes the current file, if there is one open.
  158.  
  159.      wrd_chtrace changes the flag with value what in the variable
  160.      named name - if addflag is 0, then the flag is cleared, oth-
  161.      erwise it is set. This is mainly used by the FTE tracing
  162.      routines.
  163.  
  164.      wrd_stopnow returns a value of WRD_STOP if the user desires
  165.      the simulation to stop, either because a breakpoint has been
  166.      reached, or because he has typed interrupt. Otherwise, the
  167.      value WRD_OK is returned. The next time wrd_stopnow is
  168.      called, WRD_OK is returned, unless another interrupt has
  169.      been typed in the meantime.
  170.  
  171. DIAGNOSTICS
  172.      If everything went ok, the value WRD_OK is returned. If
  173.      there was some error, WRD_ERROR is returned. Additionally
  174.      wrd_stopnow may return WRD_STOP. These values are defined in
  175.      "writedata.h".
  176.  
  177. SEE ALSO
  178.      nutmeg(1), sconvert(1), spice(1)
  179.  
  180. AUTHOR
  181.      Wayne Christopher (faustus@cad.berkeley.edu)
  182.  
  183. BUGS
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. Printed 12/9/85            Aug 7, 1985                          3
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.