Re: [ng-spice] spice3f5 benchmark
> (1) use as much code you have. I think that the spice3f5 code is not bad.
>The only
> messy things are the interfaces to the operating system and the memory
>leaks. Maybe
> you could separate that
The spice3f5 code is quite bad in terms of structure, readability,
reliability,
maintainability, ....
> from the code. I read in the mailing that some people have spice code in
>which they
> solved the memory leaks and have a simple interface: string in, result
>vectors out.
I believe that I posted this original email. My company has been using this
interface for several months and we are in the process of commercializing our
product. Basically, a char* buffer is passed in and a c-style struct comes
out. We then translate the c struct into C++ STL vectors for use in our
system. The memory leaks are fairly easy to clean up if you don't mind the
hack-style solution (which fits in nicely with the rest of the code).
> This kind of simple interface is useful because it allows other programmers
>to
> interface it without much problems and it would also allow other code to be
>wrapped
> around the spice code: for example python is a nice candidate.
Exactly. In fact, I have written a simple python wrapper around this
interface
which does basic simulations and plotting. Using this method, it is extremely
easy to plug on all sort of different front-ends and back-ends. You can write
more complex algorithms around the simulation engine etc.
My own pipe dream is to find/develop a good simulator interface which
would support spice-like simulators at the very least. We could then plug in
different spice simulators easily without having to rely on the generation of
correct Spice netlists, and the parsing of simulator outputs. Basically, a
library version of Spice3F5 with a well-designed interface that commercial
simulators would copy.
Reid van Melle
Software Design Engineer
Analog Design Automation
Partial thread listing: