Re: [ng-spice-devel] Re: Shared library support
On Tue, 7 Dec 1999, Arno wrote:
> > > Enclosed you'll find a preliminary patch to add shared library support
> > > to ng-spice. I get it to compile everything as shared lib but when I
> > > try to link it to the spice main program, all the symbols in the libs
> > > doesn't seem to be found: there are a lot of undefined references.
It seems that I have missed a mesg!
> I made all libraries dynamic. From your diagnosis, I think I know the
> solution: declare the additional shared libraries on compile-time so
> that the symbols get resolved before we try to link the resulting
> model library with ng-spice. I'll try to make that work this evening.
> Once the shared libraries work, we can look at producing a registering
> function to load models on demand.
There is a function called INPtypeLook that should be modifed. The actual
version check the code of a particular device and it it does not exists
returns an error. Its come should be made smarter:
if model is not here then
load module
if load module failed then issue "inexistent model" and abort
else register device
else
return model type.
Please note that there is an hardcoded MAX number for models in the
CKTcircuit structure. In a later stage this limitation should be
eliminated. For now you can set it to a reasonably large value.
> > [...] Basicaly, what we want to do is to have a monolithic simulator
> > (ngspice) which is capable of loading a shared library (for example
> > libbsim3.so) when necessary.
> For testing the model code, I am looking at extracting the model
> interface and support functions to link it with a standalone program.
> It could than do automatic validation of a model, based on (for
> example) empiric results.
Good.
Paolo
Partial thread listing: