next up previous contents index
Next: The print Command Up: Input and Output Commands Previous: The listing Command   Contents   Index


The load Command

The load command loads data from the files given.

load [filename] [-p printfile] [-cN[+[M]] [datafile] [...]

Several file formats are supported, as is discussed below.

The file data will be converted into internal plot structures containing vectors available for printing, plotting, and other manipulation just as if the analysis had been run. The last plot read becomes the current plot. Data files can also be loaded from the Load button in the Files menu of the Tool Control window. A file name given without a path prefix is searched for in the source path.

The load command is internet aware, i.e., if a given filename has an http:// or ftp:// prefix, the file will be downloaded from the internet and loaded. The file is transferred as a temporary file, so if a permanent local copy is desired, the write command should be used to save a file to disk.

ASCII and binary rawfiles, and Common Simulation Data Format (CSDF) files can be listed without options. These formats are auto-detected and the file data will be processed appropriately. The rawfile format is the native format used in WRspice and Berkeley SPICE3. CSDF is one of the formats used by HSPICE, and post-processing tools such as Synopsys WaveView.

In HSPICE, ``.options csdf=1'' and ``.options post=csdf'' will produce CSDF files. These files can be loaded into WRspice for display and other purposes with the load command.

In WRspice rawfiles or CSDF files can be produced by the Save Plot button in plot windows, the write and run commands, and may be generated in batch mode.

If no argument is given, WRspice will attempt to load a file with a default name. 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''.

If the option flag -p appears before a file name, the file that follows is assumed to be a file produced with the WRspice print command. This works for the default columnar print format only. The format is common to other SPICE programs. This can be useful on occasion, but the print format lacks to expressiveness of the plot data file formats.

The -c option will allow parsing of general columnar numerical data, and is useful for extracting data from output from other programs, or report text files. The option has several forms.

-cN
N is an integer greater than 0, representing the number of numerical columns. A plot with N vectors will be created, with names ``column_0'', ``column_1'', etc. The column_0 vector will be taken as the scale vector. The file is read, amd all lines that start with N space or comma-separated numbers will contribute to the vectors. Any additional text on the line following the numbers is ignored. Lines that don't provide N numbers are also ignored.

-cN+
As above, but lines must provide exactly N numbers or will be ignored. Parsing of a line stops if a token is read that is not a number, so that any numbers following a non-number in the line will always be ignored.

-cN+M
This assumes that there are N columns of numbers in a logical block, followed by a logical block containing M columns of numbers. We assume that there are N + M vectors, and the lines have been broken to avoid being too long, as is done in the SPICE printing if the number of columns to be printed would exceed the page width. However, it is required that M be less than N, and only one ``wrap'' can be accommodated. If for some reason the M vectors end up being a different length than the N vectors, they will be truncated or zero-padded so that all vectors will have the same length.

When reading columnar or print data, the scale vector is checked for cyclicity, and the plot dimensions will be set if found. Only two-dimensional vectors are produced, higher dimensions can not be determined.


next up previous contents index
Next: The print Command Up: Input and Output Commands Previous: The listing Command   Contents   Index
Stephen R. Whiteley 2022-09-18