diff --git a/hic0+.cir b/hic0+.cir index b6e16f16c..3c8bebc0d 100644 --- a/hic0+.cir +++ b/hic0+.cir @@ -1,6 +1,6 @@ // (compile "cat hic0+.cir | ../build-wip-adms3/src/ngspice -p") // load the adms shared library model -admsmodel hicum0 +admsmodel hicum0 U source hic0.cir diff --git a/spinit b/spinit index 10a1ca1e2..59a956306 100644 --- a/spinit +++ b/spinit @@ -1,2 +1,2 @@ * libhicum0.so -admsmodel hicum0 +admsmodel hicum0 U diff --git a/src/frontend/com_dl.c b/src/frontend/com_dl.c index cd35e18d0..3174d7056 100755 --- a/src/frontend/com_dl.c +++ b/src/frontend/com_dl.c @@ -6,11 +6,13 @@ #if ADMS >= 3 || 1 void com_admsmodel(wordlist *wl){ - wordlist *ww; - for(ww = wl;ww;ww = ww->wl_next) - if(load_vadev(wl->wl_word)) - fprintf(cp_err,"Error: ADMS Library %s couldn't be loaded!\n",ww->wl_word); - return; + if(!wl || !wl->wl_next) { + fprintf(cp_err,"Error: admsmodel, usage ...\n"); + return; + } + if(load_vadev_(wl->wl_word, wl->wl_next->wl_word)) + fprintf(cp_err,"Error: ADMS Library %s couldn't be loaded!\n",wl->wl_word); + return; } #endif #ifdef XSPICE diff --git a/src/main.c b/src/main.c index c16e3b202..4d2912eac 100644 --- a/src/main.c +++ b/src/main.c @@ -417,8 +417,9 @@ struct dvec *EVTfindvec(char *node){ } #endif /* XSPICE */ -int load_vadev(char *name){ +int load_vadev_(char *name, char *type){ NG_IGNORE(name); + NG_IGNORE(type); return(1); } diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index aa117c116..0168c9844 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -179,6 +179,9 @@ struct admsaux *a_admsaux; unsigned int adms_candidates; +extern void mark_adms(int type); +extern void mark_adms_candidates(char c); + void mark_adms_candidates(char c) { @@ -243,6 +246,17 @@ relink_fixme(void) { return; } +int load_vadev_(char *name, char *instance_letters) +{ + int type = load_vadev(name); + if(type < 0) + return -1; + mark_adms(type); + while(*instance_letters) + mark_adms_candidates(*instance_letters++); + return 0; +} + int load_vadev(char *name) { char *msg, libname[50]; @@ -299,10 +313,9 @@ int load_vadev(char *name) printf(" terminal[%d] %s\n", i, device->spicedev.DEVpublic.termNames[i]); } - mark_adms(DEVNUM); DEVices[DEVNUM++] = & (device->spicedev); relink_fixme(); - return 0; + return DEVNUM-1; } #endif