Re: [ng-spice-devel] Spice API
On Mon, Jul 03, 2000 at 08:32:20PM +0200, Paolo Nenzi wrote:
> Can you tell me more about your plan to build a SPICE api:
>
> * What do you consider part of the simulator and part of the front end ?
What I understand as frontend is the interface you see in interactive
mode for both spice and nutmeg. This is the frontend everybody knows.
Let me elaborate a little on the nature of the frontend.
Part of the functionality offered by this frontend is available in
high level languages such as Perl, Python, Guile, to name but a few.
Functionality such as defining variables, using arithmic or trigonomic
operations, plotting, defining functions and using flow control.
Another part of the functionality is unique to Spice. Loading a
circuit file, starting an analysis, alter device parameters. These
are commands that typically don't appear in the nutmeg command list.
As an aside: seeing the above separation of functionality, I strongly
favor putting all frontend functionality into nutmeg and leaving the
batch processing to the ngspice executable. This cleans up the code
for the frontend considerably because the SIMULATOR define would no
longer be necessary.
That was the theoretical discussion; now back to the code. These are
the parts I currently consider to be part of the frontend:
* everything in and below src/frontend.
* ngspice.c, nutmeg.c
* functions starting with com_.
A way to find out the functions/variables shared between the frontend
and the rest of the code. Try the following commands:
ld -r -o xxx.o src/frontend/*.o src/frontend/plotting/*.o src/ngspice.o
nm xxx.o | grep ' U'
All these symbols come from elsewhere in the spice source. Remove the
helper functions, the calls to the X Window System and the libc
functions and you will be left with an initial version of the Spice
API.
Once we have an API. A nice test would be to write a wrapper for it
in Python, for example, and recreate spice or nutmeg functionality in
it. Some time ago, Berkan Eskikaya asked on this list if ngspice
could be implemented as a library of functions. As you can see, we
are working towards this goal.
> * What is the level of modularity you plan to achieve ?
This is not yet very clear in my head. I can see at least two
interfaces (API's): a library interface and a device interface. The
first is for application programmer that wish to incorporate spice
functionality in their program. The latter is for device
manufacturers/modelers to have a clear-cut interface to the spice
simulator.
> This will clear my ideas and will let our group to focus towards a
> common goal.
It has become quite a long post. I hope it brings some clarification.
Regards,
--
Arno
PGP signature
Partial thread listing:
- Re: [ng-spice-devel] Spice API, (continued)