Browse Source

inp2m.c, #3/9c, abstraction, introduce model_numnodes()

Note:
  This commit does not change behaviour in any way,
    yet one can instantly see some sickness now.
  Some of the models definitely do not have 7 nodes,
  Actually we would like to fetch the number of terminals from
    struct IFdevice, slot terms or slot numNames
  But it turns out several models publish bogus values.
  For example "B4SOI", which has 7 nodes, but claims to have 8
pre-master-46
rlar 9 years ago
parent
commit
396441e1ea
  1. 26
      src/spicelib/parser/inp2m.c

26
src/spicelib/parser/inp2m.c

@ -13,6 +13,24 @@ Modified: 2001 Paolo Nenzi (Cider Integration)
#include "inpxx.h"
static int
model_numnodes(int type)
{
if (type == INPtypelook("B4SOI") ||
type == INPtypelook("B3SOIPD") ||
type == INPtypelook("B3SOIFD") ||
type == INPtypelook("B3SOIDD") ||
type == INPtypelook("HiSIMHV1") ||
type == INPtypelook("HiSIMHV2") ||
type == INPtypelook("SOI3"))
{
return 7;
}
return 4;
}
static bool
valid_numnodes(int numnodes, INPmodel *thismodel, card *current)
{
@ -220,13 +238,7 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
IFC (bindNode, (ckt, fast, 4, node[3]));
/* use type - not thismodel->INPmodType as it might not exist! */
if (type == INPtypelook("B4SOI") ||
type == INPtypelook("B3SOIPD") ||
type == INPtypelook("B3SOIFD") ||
type == INPtypelook("B3SOIDD") ||
type == INPtypelook("HiSIMHV1") ||
type == INPtypelook("HiSIMHV2") ||
type == INPtypelook("SOI3"))
if (model_numnodes(type) > 4)
{
switch (numnodes) {
case 4:

Loading…
Cancel
Save