Re: [ng-spice-devel] Spice API
On Tue, Jul 04, 2000 at 09:23:49PM +0200, Paolo Nenzi wrote:
> On Tue, 4 Jul 2000, Arno W. Peters wrote:
>
> > On Tue, Jul 04, 2000 at 09:51:51AM +0200, Paolo Nenzi wrote:
> >
> > > On Tue, 4 Jul 2000, Arno W. Peters wrote:
> > >
> > > > 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.
> > >
> > > Ok, in loading a circuit file you include the parsing of a textual
> > > netlist. But what about the output ? As you have seen, the analyses
> > > sources contain a lot of "front end functions" (SpBeginPlot and others).
> > > How do you plan to deal whit these ?
>
> Sorry, I have wrote contain while the correct word was "call" and then
> SPbeginPlot is beginPlot (damn my memory). I was asking what we should do
> with these functions, since they are closely connected with the Nutmeg
> frontend ? Replace them with more general ones ?
The analysis code uses a callback mechanism to functions in the
frontend.
IFfrontEnd *SPfrontEnd;
The structure IFfrontEnd is defined in ifsim.h. From the comment:
/*
* Structure: IFfrontEnd
*
* This structure provides the simulator with all the information
* it needs about the front end. This is the entire set of
* front end and back end related routines the simulator
* should know about.
*
*/
Currently the code expects all functions in this structure to be
defined and pointing to actual code. This is no longer true if we use
Spice as a library. We have to take measures to handle this case.
As to the definition of SPfrontEnd. Once again, we shouldn't allow a
global variable to be exposed to the code using the library. We could
use an interface function such as
void sp_register_frontend(IFfrontEnd *frontend);
to handle this transparently to the calling code. This function could
also replace all NULLs in frontend to dummy functions that simply
return. In that case, no extra changes are required to the rest of
the simulator code (Famous last words).
Regards,
--
Arno
PGP signature
Partial thread listing:
TODO list
Arno W. Peters