next up previous contents index
Next: The xeditor Command Up: Input and Output Commands Previous: Input Format Notes   Contents   Index


The write Command

The write command is used to save simulation data to a file.

write [file [expr ...]]
There are two data formats available, the ``rawfile'' format native to WRspice and other simulators based on Berkeley SPICE3, and the Common Simulation Data Format (CSDF). The CSDF is one of the formats generated by HSPICE, and is compatible with post-processors such as Synopsys WaveView.

If the file name is given an extension from among those listed below, CSDF output will be generated. Otherwise, rawfile format will be used.

.csdf
.trN
.acN
.swN
The N is an integer, and tr, ac, and sw correspond to transient, ac, and dc sweep results, respectively. This is the same convention as used by HSPICE when generating files for post-processing.

If no expr is given, then all vectors in the current plot will be written, the same as giving the word ``all'' as an expr. If, in addition, no file name is given, a default name will be used. The default name is the value of the rawfile variable if set, or the argument to the -r command line option if one was given, or ``rawspice.raw''.

The command writes out the exprs to the file. First, vectors are grouped together by plots, and written out as such. For example, if the expression list contained three vectors from one plot and two from another, then two plots will be written, one with three vectors and one with two. Additionally, if the scale for a vector isn't present, it is automatically written out as well.

The default rawfile format is ASCII, but this may be changed with the filetype variable or the SPICE_ASCIIRAWFILE environment variable.

If the appendwrite variable is set, the data will be appended to an existing file.

Files that have been appended to, or have multiple plots, are concatenations of data for a single plot. This is expected and perfectly legitimate for rawfiles, and for CSDF files used only by WRspice, but concatenated CSDF files may not be portable to other applications.


next up previous contents index
Next: The xeditor Command Up: Input and Output Commands Previous: Input Format Notes   Contents   Index
Stephen R. Whiteley 2012-09-24