Maker Pro
Maker Pro

Valid SPICE syntax for a switch?

S

Stuart Brorson

Jan 1, 1970
0
Hello --

I have a SPICE file from Analog Devices with the following cards in
it:

*
* Latch Section
*
RX 80 51 100E3
E1 10 98 (4,6) 1
S1 10 11 (80,51) SLATCH1
R2 11 12 1
C3 12 98 5.4E-12
E2 13 98 (12,98) 1
R3 12 13 500

The line "S1 10 11 (80,51) SLATCH1" is causing tclspice-0.2.14 to
barf. I suspect that the problem is that tclspice can't parse the
(80,51) token(s) correctly. I suppose that the writer of the SPICE
file meant to say "S1 10 11 80 51 SLATCH1".

For some reason, tclspice doesn't even blink when it sees similarly
grouped stuff in "E1 10 98 (4,6) 1". I don't know what's up with
that, except that sources and switches are processed in different
parts of the code.

Questions:

1. Are the ( , ) chars just redundant stuff for grouping? Should
SPICE just ignore them?

2. Is it valid SPICE syntax to group things with ( , )? Or does
SPICE strictly demand spaces to separate tokens? What do other
simulators do with similar constructs?

Assuming that ( , ) is valid SPICE syntax, I will just go ahead and
fix tclspice. But I wanted to ask the gurus first, before I started
hacking. . . . .

Stuart
 
J

Jim Thompson

Jan 1, 1970
0
Hello --

I have a SPICE file from Analog Devices with the following cards in
it:

*
* Latch Section
*
RX 80 51 100E3
E1 10 98 (4,6) 1
S1 10 11 (80,51) SLATCH1
R2 11 12 1
C3 12 98 5.4E-12
E2 13 98 (12,98) 1
R3 12 13 500

The line "S1 10 11 (80,51) SLATCH1" is causing tclspice-0.2.14 to
barf. I suspect that the problem is that tclspice can't parse the
(80,51) token(s) correctly. I suppose that the writer of the SPICE
file meant to say "S1 10 11 80 51 SLATCH1".

For some reason, tclspice doesn't even blink when it sees similarly
grouped stuff in "E1 10 98 (4,6) 1". I don't know what's up with
that, except that sources and switches are processed in different
parts of the code.

Questions:

1. Are the ( , ) chars just redundant stuff for grouping? Should
SPICE just ignore them?

2. Is it valid SPICE syntax to group things with ( , )? Or does
SPICE strictly demand spaces to separate tokens? What do other
simulators do with similar constructs?

Assuming that ( , ) is valid SPICE syntax, I will just go ahead and
fix tclspice. But I wanted to ask the gurus first, before I started
hacking. . . . .

Stuart

The general Spice netlist form:

S<name> <(+) switch node> <(-) switch node>
+ <(+) controlling node> <(-) controlling node>
+ <model name>

No commas.

...Jim Thompson
 
C

Charles DH Williams

Jan 1, 1970
0
Stuart Brorson said:
1. Are the ( , ) chars just redundant stuff for grouping? Should
SPICE just ignore them?

2. Is it valid SPICE syntax to group things with ( , )? Or does
SPICE strictly demand spaces to separate tokens? What do other
simulators do with similar constructs?

http://newton.ex.ac.uk/teaching/CDHW/Electronics2/userguide/sec2.html#2.1

"Fields on a line are separated by one or more blanks, a comma,
an equal ('=') sign, or a left or right parenthesis; extra
spaces are ignored. A line may be continued by entering
a '+' (plus) in column 1 of the following line; SPICE
continues reading beginning with column 2. "

HTH

Charles
 
S

Stuart Brorson

Jan 1, 1970
0
[snip]

: The general Spice netlist form:

: S<name> <(+) switch node> <(-) switch node>
: + <(+) controlling node> <(-) controlling node>
: + <model name>

Yeah, I know that that's what the *manual* says. . . . . In reading
the manual myself I have seen nothing which suggests that ( , ) are
legitimate "whitespace" chars in a SPICE netlist. But then why does
the Analog Devices netlist have those pesky ( , ) chars in it?

: No commas.

Hmmmm . . . OK. What does PSpice do with these constructs? Does it
puke, or does it parse them?

BTW: The model in question is that for the AD8611, which you can
download and inspect at:

http://www.analog.com/Analog_Root/s...26level3%3D197%26resourceWebLawID%3D8,00.html

(Third model down.) Note that the E sources also have the ( , ) in
them. I suspect that the person who made the netlist liked using
these chars to logically group the nodes, without worrying about
whether they were valid SPICE syntax in the strictest sense.

Stuart
 
S

Stuart Brorson

Jan 1, 1970
0
: In article <[email protected]>,

:> 1. Are the ( , ) chars just redundant stuff for grouping? Should
:> SPICE just ignore them?
:>
:> 2. Is it valid SPICE syntax to group things with ( , )? Or does
:> SPICE strictly demand spaces to separate tokens? What do other
:> simulators do with similar constructs?

: http://newton.ex.ac.uk/teaching/CDHW/Electronics2/userguide/sec2.html#2.1

: "Fields on a line are separated by one or more blanks, a comma,
: an equal ('=') sign, or a left or right parenthesis; extra
: spaces are ignored. A line may be continued by entering
: a '+' (plus) in column 1 of the following line; SPICE
: continues reading beginning with column 2. "

: HTH

Yes! Thank you!

Stuart
 
Top