Spice2 to spice3 library converter

Hi,

I ran into the spice3 not handling POLY() statements issue.. looked for
a converter but couldn't find one so I wrote one. It works on a very
simple op-amp model, but is still _very_ untested, so watch out.

This gave me considerably more trouble to write than I thought it
would. Best way to handle the poly() is almost certainly to compile
ngspice with the right options. But if anyone can use a (probably
still very buggy) converter... here it is:

spice2to3-2005-03-14.tar.gz on
http://www.dnlnk.com/spice.html.

BTW, anyone know of a good Eagle netlist to Spice format converter?
Any interest in one?

regards,

Alex

Alex Faveluke
alex at dee en el en kay dot com


Krzysztof Piecuch wrote:
Hello!!!
I'm looking for program which can be use to conversion POLY
directive
from spice2 to spice3.
(may by linux version??)


--
*** Krzysztof Piecuch ***
kris_gor@poczta.onet.pl
GG 7084611
*** Linux User #132375 ***
 
K

Krzysztof Piecuch

Guest
Hello!!!
I'm looking for program which can be use to conversion POLY directive
from spice2 to spice3.
(may by linux version??)


--
*** Krzysztof Piecuch ***
kris_gor@poczta.onet.pl
GG 7084611
*** Linux User #132375 ***
 
On Mon, 10 Jan 2005 12:39:47 +0000 (UTC), Krzysztof Piecuch
<kris_gor@poczta.onet.pl> wrote:

Hello!!!
I'm looking for program which can be use to conversion POLY directive
from spice2 to spice3.
(may by linux version??)
AFAIK, most Spice derivatives, with behavioral capability, will STILL
run POLY.

But it shouldn't be too hard to write a script to convert the terms to
Algebraic notation.

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
On Mon, 10 Jan 2005 17:08:05 +0000 (UTC), Krzysztof Piecuch
<kris_gor@poczta.onet.pl> wrote:

W artykule <sk55u0hc5gjt9kq4qao4rrltb9cv85pmrs@4ax.com> Jim Thompson napisał(a):

AFAIK, most Spice derivatives, with behavioral capability, will STILL
run POLY.

But it shouldn't be too hard to write a script to convert the terms to
Algebraic notation.

It is OK, but ...
http://groups.google.pl/groups?q=linux+poly+spice2+to+spice3+
sppp&hl=pl&lr=&client=firefox&selm=6c1uk7%241sk1%40dilbert.whoi.edu&rnum=1

where (in 1998 year):
...
Over the last weeks there have been different postings about the
translation of netlistfile from SPICE 2 in the SPICE 3-format. I have
written a little program (called "sppp" --> SpicePreProcessor), that
does this conversion automatically. The translator also converts several
PSPICE-extensions in a SPICE 3-like form. sppp does the following
things: - translates "POLY"-Sources into the new SPICE 3 syntax -
converts inlinecomments into normal comments - changes the syntax of the
device "K" (coupled Inductors) (single line notation with more than 2
Inductors in a multiline notation with only 2 Inductors each line) -
several PSPICE "Point commands" were modified or commented out sppp was
developed under LINUX with gcc V2.7.2, ELF-binaries. There are also
versions available for DOS and SunOS 5.5.
...

I'm look for this program (sppp) or other. The Author didn't answer me.
"sppp" seems dead-ended, no googling gets me anywhere.

Is it true that spice3 won't run POLY?

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
W artykule <cld5u05k03oqpegrh24tcv41kcjg9sd9il@4ax.com> Jim Thompson napisał(a):
"sppp" seems dead-ended, no googling gets me anywhere.

Is it true that spice3 won't run POLY?
spice3f5 for linux

--
**** Krzysztof Piecuch -- SP9RQA ****
sp9rqa@radio.org.pl
**********Linux User #132375*********
 
Krzysztof Piecuch <kris_gor@poczta.onet.pl> wrote:
: Hello!!!
: I'm looking for program which can be use to conversion POLY directive
: from spice2 to spice3.
: (may by linux version??)

For Linux, use ngspice:

http://sourceforge.net/projects/ngspice

Download the sources (either rework or rework-devel are OK), and
configure using --enable-xspice. That is, build like this:

../configure --enable-xspice --with-readline
make
make install

Ngspice with XSpice enabled will properly handle netlists with SPICE 2
POLY constructs.

There is a SPICE on Linux HOWTO at:

http://www.brorson.com/gEDA/SPICE/t1.html

And this HOWTO talks about ngspice here:

http://www.brorson.com/gEDA/SPICE/x496.html

(scroll down a ways to get to ngspice.)

Good Luck!

Stuart
 
W artykule <10u6g44bi33fja8@corp.supernews.com> Stuart Brorson napisał(a):

Thanks for your answer.

./configure --enable-xspice --with-readline
make
make install
I can not compile this program correctly. Is somebody which has similar
problem (debian-3.0, gcc version 2.95.4 20011002).

In file included from ../../../src/include/memory.h:20,
from ipc.c:80:
.../../../src/include/../misc/stringutil.h:28:
conflicting types for `index'
/usr/include/string.h:252: previous declaration of `index'
.../../../src/include/../misc/stringutil.h:29:
conflicting types for `rindex'
/usr/include/string.h:255: previous declaration of `rindex'
make[4]: *** [ipc.o] Error 1


--
*** Krzysztof Piecuch ***
kris_gor@poczta.onet.pl
GG 7084611
*** Linux User #132375 ***
 
In article <crtt2j$2u7$1@nemesis.news.tpi.pl>,
Krzysztof Piecuch <kris_gor@poczta.onet.pl> wrote:

Hello!!!
I'm looking for program which can be use to conversion POLY directive
from spice2 to spice3.
(may by linux version??)
MacSpice

<http://newton.ex.ac.uk/teaching/CDHW/MacSpice/>

can translate spice2 poly into spice3 B sources rather well. If you
don't have access to a Mac just collect all the polys into a fake
netlist email it me and I'll send you back a translated version.
There is obviously a limit to the number of times I'll do this
before I get bored...

Charles
 
Krzysztof Piecuch <kris_gor@poczta.onet.pl> wrote:
: W artykule <10u6g44bi33fja8@corp.supernews.com> Stuart Brorson napisa?(a):
:>
:> ./configure --enable-xspice --with-readline
:> make
:> make install
: I can not compile this program correctly. Is somebody which has similar
: problem (debian-3.0, gcc version 2.95.4 20011002).

: In file included from ../../../src/include/memory.h:20,
: from ipc.c:80:
: ../../../src/include/../misc/stringutil.h:28:
: conflicting types for `index'
: /usr/include/string.h:252: previous declaration of `index'
: ../../../src/include/../misc/stringutil.h:29:
: conflicting types for `rindex'
: /usr/include/string.h:255: previous declaration of `rindex'
: make[4]: *** [ipc.o] Error 1
:

Hmmmm. . . . not good. Can you please e-mail me your config.log
file? E-mail to: sdb (AT) cloud9 (DOT) net.

I will look to see if the variables HAVE_STRCHR or HAVE_INDEX are
defined.

Also, what version of glibc do you have?

Stuart
 
In article <dmp7u0t4bp52rosnm5pljpoptnjkraaj65@4ax.com>,
Jim Thompson <thegreatone@example.com> wrote:

Why don't you write a program that works on a PC ?:)
Because I don't own a PC :)

Charles.
 
On 14 Mar 2005 15:32:57 -0800, "Alex" <alex@dnlnk.com> wrote:

Hi,

I ran into the spice3 not handling POLY() statements issue.. looked for
a converter but couldn't find one so I wrote one. It works on a very
simple op-amp model, but is still _very_ untested, so watch out.

This gave me considerably more trouble to write than I thought it
would. Best way to handle the poly() is almost certainly to compile
ngspice with the right options. But if anyone can use a (probably
still very buggy) converter... here it is:

spice2to3-2005-03-14.tar.gz on
http://www.dnlnk.com/spice.html.

BTW, anyone know of a good Eagle netlist to Spice format converter?
Any interest in one?

regards,

Alex

Alex Faveluke
alex at dee en el en kay dot com


Krzysztof Piecuch wrote:
Hello!!!
I'm looking for program which can be use to conversion POLY
directive
from spice2 to spice3.
(may by linux version??)


--
*** Krzysztof Piecuch ***
kris_gor@poczta.onet.pl
GG 7084611
*** Linux User #132375 ***
Truly strange. EVEN PSpice can read POLY extensions.

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
Jim,

Truly strange. EVEN PSpice can read POLY extensions.
I've always had the impression that MicroSIM invented
the POLY() syntax because it was easier to parse and
differentiate then general syntax like V=3*V(x)*I(E1).
I see POLY() popularly accredited to SPICE2 in usenet,
but the string "POLY" doesn't seem to exist in the the
FORTRAN code of 2g6.

Nowadays, even the PSpice doc's frowns on POLY() syntax
as obsolete.

--Mike
 
On Tue, 15 Mar 2005 05:16:53 GMT, "Mike Engelhardt" <nospam@spam.org>
wrote:

Jim,

Truly strange. EVEN PSpice can read POLY extensions.

I've always had the impression that MicroSIM invented
the POLY() syntax because it was easier to parse and
differentiate then general syntax like V=3*V(x)*I(E1).
I see POLY() popularly accredited to SPICE2 in usenet,
but the string "POLY" doesn't seem to exist in the the
FORTRAN code of 2g6.

Nowadays, even the PSpice doc's frowns on POLY() syntax
as obsolete.

--Mike
POLY CAN certainly be confusing.

You sure about POLY not in 2G6? I sure seem to remember using it.

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
Jim,

Truly strange. EVEN PSpice can read POLY extensions.

I've always had the impression that MicroSIM invented
the POLY() syntax because it was easier to parse and
differentiate then general syntax like V=3*V(x)*I(E1).
I see POLY() popularly accredited to SPICE2 in usenet,
but the string "POLY" doesn't seem to exist in the the
FORTRAN code of 2g6.

Nowadays, even the PSpice doc's frowns on POLY() syntax
as obsolete.

POLY CAN certainly be confusing.

You sure about POLY not in 2G6? I sure seem to remember
using it.
Opps, you're right. Faulty memory. I just grep'ed
the 2g6 source and now I do see the function
evpoly(result,itype,lcoef,ncoef,larg, narg,lexp) in
the file evpoly.f

--Mike
 
Charlie,

Truly strange. EVEN PSpice can read POLY extensions.

I've always had the impression that MicroSIM invented
the POLY() syntax because it was easier to parse and
differentiate then general syntax like V=3*V(x)*I(E1).
I see POLY() popularly accredited to SPICE2 in usenet,
but the string "POLY" doesn't seem to exist in the the
FORTRAN code of 2g6.

Nowadays, even the PSpice doc's frowns on POLY() syntax
as obsolete.

POLY CAN certainly be confusing.

You sure about POLY not in 2G6? I sure seem to remember
using it.

Opps, you're right. Faulty memory. I just grep'ed
the 2g6 source and now I do see the function
evpoly(result,itype,lcoef,ncoef,larg,narg,lexp) in
the file evpoly.f

Yep, the MicroSim folks hated that function. It always
seemed to invite convergence errors and difficulties in
setting up the matrix properly. But, I think it was one
of those things that they couldn't really 're-code'
from the original...
I thought you told me you didn't know the original
MicroSim folks, one founder of which I used to retain. No
matter. Anyway, the POLY() syntax is much better wrt to
convergence then the alternative, arbitrary arithmetic
expressions. The advantage is that the POLY() syntax
limits you to a polynomial with all positive powers. This
is everywhere differentiable and is only singular at
infinite input. The arbitrary arithmetic expressions
can have negative powers and various functions that
aren't differentiable everywhere. The reason that
the POLY() is obsolete is that it's a terrible syntax
for the user, not for the convenience of the simulator
author.

--Mike
 
On Wed, 16 Mar 2005 15:43:28 GMT, "Mike Engelhardt" <nospam@spam.org>
wrote:

Charlie wrote:

Yep, the MicroSim folks hated that function. It always
seemed to invite convergence errors and difficulties in
setting up the matrix properly. But, I think it was one
of those things that they couldn't really 're-code'
from the original...

I thought you told me you didn't know the original
MicroSim folks, one founder of which I used to retain.
[snip]

--Mike
IIRC Charlie IS one of the original MicroSim folks.

And some of the originals are involved in...

http://www.trabucotechnologies.com/

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
Jim,

Yep, the MicroSim folks hated that function. It always
seemed to invite convergence errors and difficulties in
setting up the matrix properly. But, I think it was one
of those things that they couldn't really 're-code'
from the original...

I thought you told me you didn't know the original
MicroSim folks, one founder of which I used to retain. No
matter. Anyway, the POLY() syntax is much better wrt to
convergence then the alternative, arbitrary arithmetic
expressions. The advantage is that the POLY() syntax
limits you to a polynomial with all positive powers. This
is everywhere differentiable and is only singular at
infinite input. The arbitrary arithmetic expressions
can have negative powers and various functions that
aren't differentiable everywhere. The reason that
the POLY() is obsolete is that it's a terrible syntax
for the user, not for the convenience of the simulator
author.


IIRC Charlie IS one of the original MicroSim folks.
I used to retain one of the original MicroSim founders.
Charlie tried to guess which one and said he hardly know
so-and-so -- that that predated his association. That's
what I based the first sentence on. Anyway, POLY() is
much easier to deal with with respect to convergence
then arbitrary arithmetic expressions like

E1 1 2 VALUE { if(V(x) < 1, 1/V(x), 1/V(x)/V(x)) }

--Mike
 
Mike Engelhardt wrote:

Jim,


Truly strange. EVEN PSpice can read POLY extensions.

I've always had the impression that MicroSIM invented
the POLY() syntax because it was easier to parse and
differentiate then general syntax like V=3*V(x)*I(E1).
I see POLY() popularly accredited to SPICE2 in usenet,
but the string "POLY" doesn't seem to exist in the the
FORTRAN code of 2g6.

Nowadays, even the PSpice doc's frowns on POLY() syntax
as obsolete.

POLY CAN certainly be confusing.

You sure about POLY not in 2G6? I sure seem to remember
using it.


Opps, you're right. Faulty memory. I just grep'ed
the 2g6 source and now I do see the function
evpoly(result,itype,lcoef,ncoef,larg, narg,lexp) in
the file evpoly.f

--Mike


Yep, the MicroSim folks hated that function. It always seemed to invite
convergence errors and difficulties in setting up the matrix properly.
But, I think it was one of those things that they couldn't really
're-code' from the original...

--
Charlie
--
Edmondson Engineering
Unique Solutions to Unusual Problems
 
W artykule <sk55u0hc5gjt9kq4qao4rrltb9cv85pmrs@4ax.com> Jim Thompson napisał(a):
AFAIK, most Spice derivatives, with behavioral capability, will STILL
run POLY.

But it shouldn't be too hard to write a script to convert the terms to
Algebraic notation.
It is OK, but ...
http://groups.google.pl/groups?q=linux+poly+spice2+to+spice3+
sppp&hl=pl&lr=&client=firefox&selm=6c1uk7%241sk1%40dilbert.whoi.edu&rnum=1

where (in 1998 year):
...
Over the last weeks there have been different postings about the
translation of netlistfile from SPICE 2 in the SPICE 3-format. I have
written a little program (called "sppp" --> SpicePreProcessor), that
does this conversion automatically. The translator also converts several
PSPICE-extensions in a SPICE 3-like form. sppp does the following
things: - translates "POLY"-Sources into the new SPICE 3 syntax -
converts inlinecomments into normal comments - changes the syntax of the
device "K" (coupled Inductors) (single line notation with more than 2
Inductors in a multiline notation with only 2 Inductors each line) -
several PSPICE "Point commands" were modified or commented out sppp was
developed under LINUX with gcc V2.7.2, ELF-binaries. There are also
versions available for DOS and SunOS 5.5.
...
I'm look for this program (sppp) or other. The Author didn't answer me.

--
**** Krzysztof Piecuch -- SP9RQA ****
sp9rqa@radio.org.pl
**********Linux User #132375*********
 
On Tue, 11 Jan 2005 11:53:41 +0000, Charles DH Williams
<C.D.H.Williams@exeter.ac.uk> wrote:

In article <crtt2j$2u7$1@nemesis.news.tpi.pl>,
Krzysztof Piecuch <kris_gor@poczta.onet.pl> wrote:

Hello!!!
I'm looking for program which can be use to conversion POLY directive
from spice2 to spice3.
(may by linux version??)

MacSpice

http://newton.ex.ac.uk/teaching/CDHW/MacSpice/

can translate spice2 poly into spice3 B sources rather well. If you
don't have access to a Mac just collect all the polys into a fake
netlist email it me and I'll send you back a translated version.
There is obviously a limit to the number of times I'll do this
before I get bored...

Charles
Why don't you write a program that works on a PC ?:)

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 

Welcome to EDABoard.com

Sponsor

Back
Top