From 00cf9ec22a8d82ba78c5b9dc36d8001e417becdb Mon Sep 17 00:00:00 2001 From: pnenzi Date: Sat, 20 Jan 2007 12:37:35 +0000 Subject: [PATCH] Fixed code for BJT devices with less than 5 nodes. --- ChangeLog | 5 +++++ src/spicelib/parser/inp2q.c | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0adef4fdd..22971c217 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-21 Paolo Nenzi + + * src/spicelib/parser/inp2q.c: Added patch from Hitoshi Tanaka to + fix error in old BJT devices (that do not have fifth node). + 2006-02-21 Paolo Nenzi * src/frontend/subckt.c, src/spicelib/parser/inp2q.c, diff --git a/src/spicelib/parser/inp2q.c b/src/spicelib/parser/inp2q.c index c7f54e92e..93333c7c1 100644 --- a/src/spicelib/parser/inp2q.c +++ b/src/spicelib/parser/inp2q.c @@ -145,11 +145,17 @@ void INP2Q(void *ckt, INPtables * tab, card * current, void *gnode) IFC(bindNode, (ckt, fast, 2, node2)); IFC(bindNode, (ckt, fast, 3, node3)); IFC(bindNode, (ckt, fast, 4, node4)); - if (nodeflag) { - IFC(bindNode, (ckt, fast, 5, node5)); - } else { - ((GENinstance *) fast)->GENnode5 = -1; - } + + if ((type == INPtypelook ("hicum0")) || + (type == INPtypelook ("hicum2")) || + (type == INPtypelook ("mextram")) ) + { + if (nodeflag) { + IFC(bindNode, (ckt, fast, 5, node5)); + } else { + ((GENinstance *) fast)->GENnode5 = -1; + } + } PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab)); if (waslead) { #ifdef CIDER