diff --git a/src/spicelib/parser/inpdomod.c b/src/spicelib/parser/inpdomod.c index 5789f3143..9eb12751d 100644 --- a/src/spicelib/parser/inpdomod.c +++ b/src/spicelib/parser/inpdomod.c @@ -7,6 +7,9 @@ Author: 1985 Thomas L. Quarles #include "ngspice/iferrmsg.h" #include "ngspice/inpdefs.h" #include "inp.h" +#ifdef ADMS +#include "error.h" /* controlled_exit() */ +#endif /*-------------------------------------------------------------- * This fcn takes the model card & examines it. Depending upon @@ -42,6 +45,24 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab) INPinsert(&modname, tab); /* stick model name into table */ INPgetTok(&line, &type_name, 1); /* get model type */ +#ifdef ADMS + if ((type=load_vadev(ckt,type_name)) && type>=0) { + INPmodel *thismodel; + char *error; +#ifdef TRACE + printf("inpdomod.c: got model %s from dynamic library - create device # %i\n",type_name,type); +#endif + INPmakeMod(modname, type, image); + thismodel=NULL; + error=INPgetMod(ckt, modname, &thismodel, tab); + if (thismodel == NULL) + { + fprintf(stderr, "%s\nPlease check model, level or number of terminals!\n", error); + controlled_exit(EXIT_BAD); + } + } + else +#endif /* ----- Check if model is a BJT --------- */ if (strcmp(type_name, "npn") == 0 || strcmp(type_name, "pnp") == 0) { err = INPfindLev(line,&lev); @@ -206,7 +227,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab) } INPmakeMod(modname, type, image); } - + /* -------- Check if model is a MOSFET --------- */ else if ((strcmp(type_name, "nmos") == 0) || (strcmp(type_name, "pmos") == 0)