pass the allowed instance_letters, when announcing a `admsmodel'

This commit is contained in:
rlar 2012-04-12 17:29:15 +02:00
parent 570bb98061
commit 291212ecc4
5 changed files with 26 additions and 10 deletions

View File

@ -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

2
spinit
View File

@ -1,2 +1,2 @@
* libhicum0.so
admsmodel hicum0
admsmodel hicum0 U

View File

@ -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

View File

@ -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);
}

View File

@ -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