VLSI Design Tools Manual SPCPP(1.VLSI)
NAME
spcpp - Spice (circuit simulator) input pre-processor
SYNOPSIS
spcpp [-c] [-sn] [-dlr] [-t tname] [-o oname] iname
DESCRIPTION
Spcpp is a program that translates bracketed text tokens in
an input file into other text strings. It is intended to
allow users of spice to prepare their simulation input using
mnemonic node names rather than the numeric node numbers
required by Spice commands. The program has two major modes
of operation. If the user does not specify a file that con-
tains a translation table, then spcpp builds a translation
table itself numbering the tokens from zero as it encounters
them. Alternatively, the user can specify the name of a
file containing a translation table to be used. In particu-
lar, the .names file created by sim2spice is usable as a
translation table file.
The options and parameters are:
-c Indicates that the first non-whitespace word of
each line of the translation table file should be
skipped over. This is useful if your translation
table has an asterisk ('*') in column 1 of each
line to allow it to be read by spice as comments.
-sn Indicates that n lines at the beginning of the
translation table file should be skipped over. If
no number is specified then only the first line of
the file is skipped.
-dlr Redefines the token delimiters to be 'l' and 'r'
respectively. The default delimiters are '<' and
'>'.
-t tname Specifies a file that contains a translation table
(default is to build a translation table as
described above). Each line of this file should
have at least two non-whitespace words on it. If
the -c option is specified then the first word on
each line is ignored. The next word is interpreted
as a string to be translated and following one is
interpreted as the target string into which it is
translated. Any subsequent words on the line are
ignored. For Spice input preparation the target
string should be a numeral. The -s option allows
the file to be prefaced by one or more lines that
spcpp will ignore.
Northwest LIS Release 3Last change: 7/15/88 1
VLSI Design Tools Manual SPCPP(1.VLSI)
-o oname Specifies a file into which the output is to be
written. If this option is not used then the out-
put is written to iroot.spcx where iroot is
obtained by stripping away any tags from iname.
iname Specifies the name of the file to process.
A bracketed token is defined to be a left delimiter charac-
ter, zero or more spaces, a word (the token) not containing
either right or left delimiters, zero or more spaces, and a
right delimiter character. Unmatched delimiter characters
are not allowed in any context. Bracketed tokens are not
allowed to span lines. Tokens and the strings that they
translate into are limited to be at most 40 characters each.
Any line that contains no bracketed tokens is simply copied
from the input to the output. If a line does contain a
bracketed token then the input line is written into the out-
put a Spice comment line. An output line follows immedi-
ately. If the line is valid, then the output line has the
untranslated parts immediately below the corresponding parts
of the commented input line with the target strings substi-
tuted for the bracketed tokens. If an error is detected,
then the output line has a caret ('^') immediately below the
point at which the first error is detected. An error mes-
sage line then follows. Since the scanning of the line is
abandoned there may be subsequent undetected errors in the
remaining part of the line.
Example:
If the following lines are contained in the translation
table file:
Vdd 1
Input 55
Output 107
foo 23
bar 45
then spcpp will, upon seeing the lines:
.plot trans v() v(