Allow 4-terminal devices for adms models
This commit is contained in:
parent
8d0bba9ddb
commit
65f853cab5
|
|
@ -17,7 +17,6 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
/* Qname <node> <node> <node> [<node>] <model> [<val>] [OFF]
|
/* Qname <node> <node> <node> [<node>] <model> [<val>] [OFF]
|
||||||
* [IC=<val>,<val>] */
|
* [IC=<val>,<val>] */
|
||||||
|
|
||||||
int mytype; /* the type we looked up */
|
|
||||||
int type; /* the type the model says it is */
|
int type; /* the type the model says it is */
|
||||||
char *line; /* the part of the current line left to parse */
|
char *line; /* the part of the current line left to parse */
|
||||||
char *name; /* the resistor's name */
|
char *name; /* the resistor's name */
|
||||||
|
|
@ -46,13 +45,8 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
void *mdfast; /* pointer to the actual model */
|
void *mdfast; /* pointer to the actual model */
|
||||||
IFuid uid; /* uid of default model */
|
IFuid uid; /* uid of default model */
|
||||||
|
|
||||||
mytype = INPtypelook("BJT");
|
|
||||||
if (mytype < 0) {
|
|
||||||
LITERR("Device type BJT not supported by this binary\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf("INP2Q: Parsing '%s'\n",current->line);
|
printf("INP2Q: Parsing '%s'\n", current->line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nodeflag = 0; /* initially specify a 4 terminal device */
|
nodeflag = 0; /* initially specify a 4 terminal device */
|
||||||
|
|
@ -67,11 +61,16 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
INPtermInsert(ckt, &nname3, tab, &node3);
|
INPtermInsert(ckt, &nname3, tab, &node3);
|
||||||
INPgetTok(&line, &model, 1);
|
INPgetTok(&line, &model, 1);
|
||||||
|
|
||||||
|
thismodel = (INPmodel *) NULL;
|
||||||
/* See if 4th token after device specification is a model name */
|
/* See if 4th token after device specification is a model name */
|
||||||
if (INPlookMod(model)) {
|
if (INPlookMod(model)) {
|
||||||
/* 3-terminal device - substrate to ground */
|
/* 3-terminal device - substrate to ground */
|
||||||
node4 = gnode;
|
node4 = gnode;
|
||||||
INPinsert(&model, tab);
|
INPinsert(&model, tab);
|
||||||
|
#ifdef TRACE
|
||||||
|
printf("INP2Q: 3-terminal device - substrate to ground\n");
|
||||||
|
#endif
|
||||||
|
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||||
} else {
|
} else {
|
||||||
nname4 = model;
|
nname4 = model;
|
||||||
INPtermInsert(ckt, &nname4, tab, &node4);
|
INPtermInsert(ckt, &nname4, tab, &node4);
|
||||||
|
|
@ -83,7 +82,17 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
if (INPlookMod(model)) {
|
if (INPlookMod(model)) {
|
||||||
/* 4-terminal device - special case with tnodeout flag not handled */
|
/* 4-terminal device - special case with tnodeout flag not handled */
|
||||||
INPinsert(&model, tab);
|
INPinsert(&model, tab);
|
||||||
|
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||||
#ifdef ADMS
|
#ifdef ADMS
|
||||||
|
if ((thismodel->INPmodType == INPtypelook("hicum0"))
|
||||||
|
|| (thismodel->INPmodType == INPtypelook("hicum2"))
|
||||||
|
|| (thismodel->INPmodType == INPtypelook("mextram")))
|
||||||
|
{
|
||||||
|
node5 = gnode; /* 4-terminal adms device - thermal node to ground */
|
||||||
|
nname5 = "0";
|
||||||
|
INPtermInsert(ckt, &nname5, tab, &node5);
|
||||||
|
nodeflag = 1; /* now specify a 5 node device */
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* 5-terminal device */
|
/* 5-terminal device */
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
|
|
@ -94,28 +103,29 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
INPtermInsert(ckt, &nname5, tab, &node5);
|
INPtermInsert(ckt, &nname5, tab, &node5);
|
||||||
INPgetTok(&line, &model, 1);
|
INPgetTok(&line, &model, 1);
|
||||||
INPinsert(&model, tab);
|
INPinsert(&model, tab);
|
||||||
|
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf("INP2Q: Looking up model\n");
|
printf("INP2Q: Looking up model\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (thismodel != NULL) {
|
if (thismodel != NULL) {
|
||||||
if((thismodel->INPmodType != INPtypelook("BJT"))
|
if ((thismodel->INPmodType != INPtypelook("BJT"))
|
||||||
&& (thismodel->INPmodType != INPtypelook("BJT2"))
|
&& (thismodel->INPmodType != INPtypelook("BJT2"))
|
||||||
#ifdef CIDER
|
#ifdef CIDER
|
||||||
&& (thismodel->INPmodType != INPtypelook("NBJT"))
|
&& (thismodel->INPmodType != INPtypelook("NBJT"))
|
||||||
&& (thismodel->INPmodType != INPtypelook("NBJT2"))
|
&& (thismodel->INPmodType != INPtypelook("NBJT2"))
|
||||||
#endif
|
#endif
|
||||||
#ifdef ADMS
|
#ifdef ADMS
|
||||||
&& (thismodel->INPmodType != INPtypelook("hicum0"))
|
&& (thismodel->INPmodType != INPtypelook("hicum0"))
|
||||||
&& (thismodel->INPmodType != INPtypelook("hicum2"))
|
&& (thismodel->INPmodType != INPtypelook("hicum2"))
|
||||||
&& (thismodel->INPmodType != INPtypelook("mextram"))
|
&& (thismodel->INPmodType != INPtypelook("mextram"))
|
||||||
#endif
|
#endif
|
||||||
&& (thismodel->INPmodType != INPtypelook("VBIC"))
|
&& (thismodel->INPmodType != INPtypelook("VBIC")))
|
||||||
) {
|
{
|
||||||
LITERR("incorrect model type")
|
LITERR("incorrect model type")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -131,20 +141,22 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
type = (thismodel->INPmodType);
|
type = (thismodel->INPmodType);
|
||||||
mdfast = (thismodel->INPmodfast);
|
mdfast = (thismodel->INPmodfast);
|
||||||
} else {
|
} else {
|
||||||
type = mytype;
|
type = INPtypelook("BJT");
|
||||||
|
if (type < 0) {
|
||||||
|
LITERR("Device type BJT not supported by this binary\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!tab->defQmod) {
|
if (!tab->defQmod) {
|
||||||
/* create default Q model */
|
/* create default Q model */
|
||||||
IFnewUid(ckt, &uid, (IFuid) NULL, "Q", UID_MODEL,
|
IFnewUid(ckt, &uid, (IFuid) NULL, "Q", UID_MODEL, (void **) NULL);
|
||||||
(void **) NULL);
|
|
||||||
IFC(newModel, (ckt, type, &(tab->defQmod), uid));
|
IFC(newModel, (ckt, type, &(tab->defQmod), uid));
|
||||||
}
|
}
|
||||||
mdfast = tab->defQmod;
|
mdfast = tab->defQmod;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf ("INP2Q: Just about to dive into newInstance\n");
|
printf("INP2Q: Type: %d nodeflag: %d instancename: %s\n", type, nodeflag, name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
IFC(newInstance, (ckt, mdfast, &fast, name));
|
IFC(newInstance, (ckt, mdfast, &fast, name));
|
||||||
IFC(bindNode, (ckt, fast, 1, node1));
|
IFC(bindNode, (ckt, fast, 1, node1));
|
||||||
IFC(bindNode, (ckt, fast, 2, node2));
|
IFC(bindNode, (ckt, fast, 2, node2));
|
||||||
|
|
@ -152,20 +164,16 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
IFC(bindNode, (ckt, fast, 4, node4));
|
IFC(bindNode, (ckt, fast, 4, node4));
|
||||||
|
|
||||||
#ifdef ADMS
|
#ifdef ADMS
|
||||||
if (type >= 57) /* the type is set above - must be for adms models something like 57-59 */
|
if (nodeflag) { /* 5-node device */
|
||||||
{
|
IFC(bindNode, (ckt, fast, 5, node5));
|
||||||
if (nodeflag) { /* was the string a node ? */
|
}
|
||||||
IFC(bindNode, (ckt, fast, 5, node5));
|
|
||||||
} else {
|
|
||||||
((GENinstance *) fast)->GENnode5 = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab));
|
PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab));
|
||||||
if (waslead) {
|
if (waslead) {
|
||||||
#ifdef CIDER
|
#ifdef CIDER
|
||||||
if( type == INPtypelook("NBJT2") ) {
|
if( type == INPtypelook("NBJT2") ) {
|
||||||
LITERR(" error: no unlabeled parameter permitted on NBJT2\n")
|
LITERR(" error: no unlabeled parameter permitted on NBJT2\n")
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
ptemp.rValue = leadval;
|
ptemp.rValue = leadval;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue