fix max terminal count for vbic and hicum2 adms enabled

This commit is contained in:
dwarning 2020-12-25 15:40:08 +01:00 committed by Holger Vogt
parent a62b2a8ea0
commit 420d47cc75
1 changed files with 7 additions and 9 deletions

View File

@ -13,18 +13,16 @@ Modified: 2001 Paolo Nenzi (Cider Integration)
static int
model_numnodes(int type)
model_max_numnodes(int type)
{
if (type == INPtypelook("VBIC") ||
type == INPtypelook("hicum2"))
return 5;
#ifdef ADMS
if (type == INPtypelook("hicum0") ||
type == INPtypelook("bjt504t"))
return 5;
#else
if (type == INPtypelook("VBIC") ||
type == INPtypelook("hicum2"))
return 5;
#endif
return 4;
}
@ -78,14 +76,14 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, struct card *current, CKTnode *gnod
INPtermInsert(ckt, &token, tab, &node[i]);
}
int model_numnodes_ = model_numnodes(thismodel->INPmodType);
if (i > model_numnodes_) {
int model_numnodes = model_max_numnodes(thismodel->INPmodType);
if (i > model_numnodes) {
LITERR("Too many nodes for this model type");
return;
}
/* tie missing ports to ground, (substrate and thermal node) */
while (i < model_numnodes_)
while (i < model_numnodes)
node[i++] = gnode;
numnodes = i;