1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
.\" Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
.TH SCONVERT 1 "20 March 1986"
.UC 4
.SH NAME
sconvert \- convert spice formats
.SH SYNOPSIS
.B sconvert fromtype fromfile totype tofile
.br
.B sconvert fromtype totype
.br
.B sconvert
.br
.SH DESCRIPTION
.B Sconvert
translates spice output files among three formats: the old
binary format, a new binary format, and a new ascii format.
The formats are specified by the
.B fromtype
and
.B totype
arguments: `o' for the old format, `b' for the new binary format,
and `a' for the new ascii format.
.B Fromtype
specifies the format to be read, and
.B totype
specifies the format to be written.
If
.B fromfile
and
.B tofile
are given, then they are used as the input and output, otherwise
standard input and output are used.
(Note that this second option is only available on \s-2UNIX\s+2 systems
\- on VMS and other systems you must supply the filenames.)
If no arguments are given, the parameters are prompted for.
.PP
Binary format is the preferred format for general use, as it is
the most economical in terms of space and speed of access, and ascii is
provided to make it easy to modify data files and transfer them
between machines with different floating-point formats.
The old format is provided only
for backward compatibility.
The three formats are as follows:
.br
.nf
.B Old:
What Size in Bytes
title 80
date 8
time 8
numoutputs 2
the integer 4 2
variable names --
char[numoutputs][8] numoutputs * 8
types of output numoutputs * 2
node index numoutputs * 2
plot title numoutputs * 24
the actual data numpoints * numoutputs * 8
.B Ascii:
Title: \fITitle Card String\fR
Date: \fIDate\fR
[ Plotname: \fIPlot Name\fR
Flags: \fIcomplex\fR or \fIreal\fR
No. Variables: \fInumoutputs\fR
No. Points: \fInumpoints\fR
Command: \fInutmeg command\fR
Variables: 0 \fIvarname1\fR \fItypename1\fR
1 \fIvarname2\fR \fItypename2\fR
etc...
Values:
0 n n n n ...
1 n n n n ...
And so forth...
] repeated one or more times
.fi
.PP
If one of the flags is \fIcomplex\fR, the points look like r,i where r and i
are floating point (in %e format).
Otherwise they are in %e format.
Only one of \fIreal\fR and \fIcomplex\fR should appear.
.PP
The lines are guaranteed to be less than 80 columns wide (unless the
plot title or variable names are very long), so this format is safe
to mail between systems like CMS.
.PP
Any number of \fBCommand:\fR lines may appear between the \fBNo. Points:\fR
and the \fBVariables:\fR lines, and whenever the plot is loaded into
\fBnutmeg\fR they will be executed.
.nf
.B Binary:
\fITitle Card\fR (a NULL terminated string)
\fIDate, Time\fR (a NULL terminated string)
[
\fIPlot title\fR (a NULL terminated string)
\fINumber of variables\fR (an int)
\fINumber of data points\fR (an int)
\fIflags\fR (a short)
\fIvariable header struct\fR (repeated numoutputs times)
\fIvariable name\fR (a NULL terminated string)
\fIvariable type\fR (an int)
\fIset of outputs\fR (repeated numpoints times)
] repeated one or more times.
.fi
.PP
A set of outputs is a vector of doubles of length numoutputs, or
a vector of real-imaginary pairs of doubles if the data is complex.
.SH "SEE ALSO"
nutmeg(1), spice(1), writedata(3)
.SH AUTHOR
Wayne Christopher (faustus@cad.berkeley.edu)
.SH BUGS
If variable names and the title
and plotname strings have trailing
blanks in them they will be stripped off when the file is read, if
it is in ascii format.
.PP
If a plot title begins with "Title:" \fBnutmeg\fR will be fooled into thinking
that this is an ascii format file.
\fBSconvert\fR always requires the type to be specified, however.
|