Bipolar devices support 5 nodes now (Dietmar)
This commit is contained in:
parent
b6763b9a39
commit
2bfcb8cf4c
|
|
@ -1,3 +1,10 @@
|
||||||
|
2006-02-21 Paolo Nenzi <p.nenzi@ieee.org>
|
||||||
|
|
||||||
|
* src/frontend/subckt.c, src/spicelib/parser/inp2q.c,
|
||||||
|
src/spicelib/parser/inpdomod.c: Added fifth node on bipolar devices
|
||||||
|
(Dietmar Warning) to support newer (adms) models. Updated number of
|
||||||
|
nodes for subcircuits.
|
||||||
|
|
||||||
2006-02-19 Paolo Nenzi <p.nenzi@ieee.org>
|
2006-02-19 Paolo Nenzi <p.nenzi@ieee.org>
|
||||||
|
|
||||||
* tests/bin/check.sh: added patch from Gary R. Van Sickle
|
* tests/bin/check.sh: added patch from Gary R. Van Sickle
|
||||||
|
|
|
||||||
|
|
@ -1887,7 +1887,7 @@ inp_numnodes(char c)
|
||||||
case 'm': return (7); /* This means that 7 is the maximun number of nodes */
|
case 'm': return (7); /* This means that 7 is the maximun number of nodes */
|
||||||
case 'o': return (4);
|
case 'o': return (4);
|
||||||
case 'p': return (0);
|
case 'p': return (0);
|
||||||
case 'q': return (4);
|
case 'q': return (5);
|
||||||
case 'r': return (2);
|
case 'r': return (2);
|
||||||
case 's': return (4);
|
case 's': return (4);
|
||||||
case 't': return (4);
|
case 't': return (4);
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,14 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
char *nname2; /* the second node's name */
|
char *nname2; /* the second node's name */
|
||||||
char *nname3; /* the third node's name */
|
char *nname3; /* the third node's name */
|
||||||
char *nname4; /* the fourth node's name */
|
char *nname4; /* the fourth node's name */
|
||||||
|
char *nname5; /* the fifth node's name */
|
||||||
void *node1; /* the first node's node pointer */
|
void *node1; /* the first node's node pointer */
|
||||||
void *node2; /* the second node's node pointer */
|
void *node2; /* the second node's node pointer */
|
||||||
void *node3; /* the third node's node pointer */
|
void *node3; /* the third node's node pointer */
|
||||||
void *node4; /* the fourth node's node pointer */
|
void *node4; /* the fourth node's node pointer */
|
||||||
|
void *node5; /* the fifth node's node pointer */
|
||||||
int error; /* error code temporary */
|
int error; /* error code temporary */
|
||||||
|
int nodeflag; /* flag indicating 4 or 5 nodes */
|
||||||
void *fast; /* pointer to the actual instance */
|
void *fast; /* pointer to the actual instance */
|
||||||
IFvalue ptemp; /* a value structure to package resistance into */
|
IFvalue ptemp; /* a value structure to package resistance into */
|
||||||
int waslead; /* flag to indicate that funny unlabeled number was found */
|
int waslead; /* flag to indicate that funny unlabeled number was found */
|
||||||
|
|
@ -45,6 +48,11 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
LITERR("Device type BJT not supported by this binary\n");
|
LITERR("Device type BJT not supported by this binary\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef TRACE
|
||||||
|
printf("INP2Q: Parsing '%s'\n",current->line);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
nodeflag = 0; /* initially specify a 4 terminal device */
|
||||||
line = current->line;
|
line = current->line;
|
||||||
INPgetTok(&line, &name, 1);
|
INPgetTok(&line, &name, 1);
|
||||||
INPinsert(&name, tab);
|
INPinsert(&name, tab);
|
||||||
|
|
@ -55,33 +63,66 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
INPgetNetTok(&line, &nname3, 1);
|
INPgetNetTok(&line, &nname3, 1);
|
||||||
INPtermInsert(ckt, &nname3, tab, &node3);
|
INPtermInsert(ckt, &nname3, tab, &node3);
|
||||||
INPgetTok(&line, &model, 1);
|
INPgetTok(&line, &model, 1);
|
||||||
|
|
||||||
|
/* See if 4th token after device specification is a model name */
|
||||||
if (INPlookMod(model)) {
|
if (INPlookMod(model)) {
|
||||||
/* do nothing for now */
|
/* 3-terminal device - substrate to ground */
|
||||||
node4 = gnode;
|
node4 = gnode;
|
||||||
/* no action required */
|
INPinsert(&model, tab);
|
||||||
} else {
|
} else {
|
||||||
nname4 = model;
|
nname4 = model;
|
||||||
INPtermInsert(ckt, &nname4, tab, &node4);
|
INPtermInsert(ckt, &nname4, tab, &node4);
|
||||||
INPgetTok(&line, &model, 1);
|
INPgetTok(&line, &model, 1);
|
||||||
}
|
/* See if 5th token after device specification is a model name */
|
||||||
|
#ifdef TRACE
|
||||||
|
printf("INP2Q: checking for 4 node device\n");
|
||||||
|
#endif
|
||||||
|
if (INPlookMod(model)) {
|
||||||
|
/* 4-terminal device - special case with tnodeout flag not handled */
|
||||||
INPinsert(&model, tab);
|
INPinsert(&model, tab);
|
||||||
|
#ifdef ADMS
|
||||||
|
} else {
|
||||||
|
/* 5-terminal device */
|
||||||
|
#ifdef TRACE
|
||||||
|
printf("INP2Q: checking for 5 node device\n");
|
||||||
|
#endif
|
||||||
|
nodeflag = 1; /* now specify a 5 node device */
|
||||||
|
nname5 = model;
|
||||||
|
INPtermInsert(ckt, &nname5, tab, &node5);
|
||||||
|
INPgetTok(&line, &model, 1);
|
||||||
|
INPinsert(&model, tab);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
current->error = INPgetMod(ckt, model, &thismodel, tab);
|
||||||
|
#ifdef TRACE
|
||||||
|
printf("INP2Q: Looking up model\n");
|
||||||
|
#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"))
|
||||||
&& (thismodel->INPmodType != INPtypelook("VBIC"))
|
&& (thismodel->INPmodType != INPtypelook("VBIC"))
|
||||||
#ifdef ADMS
|
|
||||||
&& (thismodel->INPmodType != INPtypelook("hicum0"))
|
|
||||||
&& (thismodel->INPmodType != INPtypelook("mextram"))
|
|
||||||
#endif
|
|
||||||
#ifdef CIDER
|
#ifdef CIDER
|
||||||
&& (thismodel->INPmodType != INPtypelook("NBJT"))
|
&& (thismodel->INPmodType != INPtypelook("NBJT"))
|
||||||
&& (thismodel->INPmodType != INPtypelook("NBJT2"))
|
&& (thismodel->INPmodType != INPtypelook("NBJT2"))
|
||||||
|
#endif
|
||||||
|
#ifdef ADMS
|
||||||
|
&& (thismodel->INPmodType != INPtypelook("hicum0"))
|
||||||
|
&& (thismodel->INPmodType != INPtypelook("hicum2"))
|
||||||
|
&& (thismodel->INPmodType != INPtypelook("mextram"))
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
LITERR("incorrect model type")
|
LITERR("incorrect model type")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef ADMS
|
||||||
|
if (nodeflag && (thismodel->INPmodType != INPtypelook("hicum2")))
|
||||||
|
{
|
||||||
|
LITERR("Too much nodes for this model type")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
type = (thismodel->INPmodType);
|
type = (thismodel->INPmodType);
|
||||||
mdfast = (thismodel->INPmodfast);
|
mdfast = (thismodel->INPmodfast);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -96,7 +137,7 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf ("In INP2Q, just about to dive into newInstance\n");
|
printf ("INP2Q: Just about to dive into newInstance\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
IFC(newInstance, (ckt, mdfast, &fast, name));
|
IFC(newInstance, (ckt, mdfast, &fast, name));
|
||||||
|
|
@ -104,11 +145,16 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode)
|
||||||
IFC(bindNode, (ckt, fast, 2, node2));
|
IFC(bindNode, (ckt, fast, 2, node2));
|
||||||
IFC(bindNode, (ckt, fast, 3, node3));
|
IFC(bindNode, (ckt, fast, 3, node3));
|
||||||
IFC(bindNode, (ckt, fast, 4, node4));
|
IFC(bindNode, (ckt, fast, 4, node4));
|
||||||
|
if (nodeflag) {
|
||||||
|
IFC(bindNode, (ckt, fast, 5, node5));
|
||||||
|
} else {
|
||||||
|
((GENinstance *) fast)->GENnode5 = -1;
|
||||||
|
}
|
||||||
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 unlabelled parameter permitted on NBJT2\n")
|
LITERR(" error: no unlabeled parameter permitted on NBJT2\n")
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
ptemp.rValue = leadval;
|
ptemp.rValue = leadval;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
|
||||||
line = image->line;
|
line = image->line;
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
/* SDB debug statement */
|
|
||||||
printf("In INPdomodel, examining line %s . . . \n", line);
|
printf("In INPdomodel, examining line %s . . . \n", line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -64,6 +63,7 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
|
||||||
"Device type VBIC not available in this binary\n");
|
"Device type VBIC not available in this binary\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef ADMS
|
||||||
case 6:
|
case 6:
|
||||||
type = INPtypelook("mextram");
|
type = INPtypelook("mextram");
|
||||||
if(type < 0) {
|
if(type < 0) {
|
||||||
|
|
@ -78,9 +78,17 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
|
||||||
"Device type HICUM0 not available in this binary\n");
|
"Device type HICUM0 not available in this binary\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
type = INPtypelook("hicum2");
|
||||||
|
if(type < 0) {
|
||||||
|
err = INPmkTemp(
|
||||||
|
"Device type HICUM2 not available in this binary\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default: /* placeholder; use level 4 for the next model */
|
default: /* placeholder; use level 4 for the next model */
|
||||||
err = INPmkTemp(
|
err = INPmkTemp(
|
||||||
"Only BJT levels 1-2, 4,7 are supported in this binary\n");
|
"Only BJT levels 1-2, 4,6,7,8 are supported in this binary\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -614,7 +622,6 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
|
||||||
/* gtri - modify - wbk - 10/23/90 - modify to look for code models */
|
/* gtri - modify - wbk - 10/23/90 - modify to look for code models */
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
/* SDB debug statement */
|
|
||||||
printf("In INPdomodel, found unknown model type, typename = %s . . .\n", typename);
|
printf("In INPdomodel, found unknown model type, typename = %s . . .\n", typename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -625,7 +632,6 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
|
||||||
sprintf(err,"Unknown model type %s - ignored\n",typename);
|
sprintf(err,"Unknown model type %s - ignored\n",typename);
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
/* SDB debug statement */
|
|
||||||
printf("In INPdomodel, ignoring unknown model typ typename = %s . . .\n", typename);
|
printf("In INPdomodel, ignoring unknown model typ typename = %s . . .\n", typename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -633,7 +639,6 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
|
||||||
else {
|
else {
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
/* SDB debug statement */
|
|
||||||
printf("In INPdomodel, adding unknown model typename = %s to model list. . .\n", typename);
|
printf("In INPdomodel, adding unknown model typename = %s to model list. . .\n", typename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue