From f345bb62d7cbc51c43b86edfa587f26d84e66ec0 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Mon, 22 Dec 2008 12:42:07 +0000 Subject: [PATCH] checks for BSIM3, BSIM4 modofied --- ChangeLog | 4 ++++ src/spicelib/parser/inpdomod.c | 31 ++++++++++++------------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81d011fa5..76dbe3b95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-12-22 Holger Vogt + * /spicelib/parser/inpdomod.c: checks for BSIM3 and BSIM4 look for + major versions 3.2, 3.3, 4.2 - 4.6 + 2008-12-22 Dietmar Warning * adms/admst/ngspiceMakefile.am.xml: switch to libtool (unfortunately!) diff --git a/src/spicelib/parser/inpdomod.c b/src/spicelib/parser/inpdomod.c index 96f24db54..d40e8c3b9 100644 --- a/src/spicelib/parser/inpdomod.c +++ b/src/spicelib/parser/inpdomod.c @@ -287,18 +287,16 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab) if ( strcmp(ver, "3.1a") == 0 ) { type = INPtypelook("BSIM3v1A"); } - if ( (strstr(ver, "3.2.2")) || (strstr(ver, "3.22")) || - (strstr(ver, "3.2.3")) || (strstr(ver, "3.23")) || - (strstr(ver, "3.2.4")) || (strstr(ver, "3.24")) || - (strstr("3.2", ver)) || (strstr(ver, "3.20"))) { + if ( prefix("3.2", ver)) { /* version string ver has to start with 3.2 */ type = INPtypelook("BSIM3v32"); } if ( (strstr(ver, "default")) - || (strstr(ver, "3.3")) || (strstr(ver, "3.3.0")) || (strstr(ver, "3.30")) ) { + || (prefix("3.3", ver)) ) { type = INPtypelook("BSIM3"); } if (type < 0) { - err = INPmkTemp("Device type BSIM3 not available in this binary\n"); + err = (char *) tmalloc(sizeof(char) * (60 + strlen(ver))); + sprintf(err,"Device type BSIM3 version %s not available in this binary\n",ver); } break; case 9: @@ -309,31 +307,26 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab) } break; case 14: case 54: - err = INPfindVer(line, ver); /* mapping of minor versions are only placeholder */ - if ( (strstr(ver, "4.2")) || (strstr(ver, "4.2.0")) || (strstr(ver, "4.20")) - || (strstr(ver, "4.2.1")) || (strstr(ver, "4.21")) ) { + err = INPfindVer(line, ver); /* mapping of minor versions are included */ + if (prefix("4.2", ver)) { type = INPtypelook("BSIM4v2"); } - if ( (strstr(ver, "4.3")) || (strstr(ver, "4.3.0")) || (strstr(ver, "4.30")) ) { + if (prefix("4.3", ver)) { type = INPtypelook("BSIM4v3"); } - if ( (strstr(ver, "4.4")) || (strstr(ver, "4.4.0")) || (strstr(ver, "4.40")) ) { + if (prefix("4.4", ver)) { type = INPtypelook("BSIM4v4"); } - if ( (strstr(ver, "4.5")) || (strstr(ver, "4.5.0")) || (strstr(ver, "4.50")) ) { + if (prefix("4.5", ver)) { type = INPtypelook("BSIM4v5"); } if ( (strstr(ver, "default")) - || (strstr(ver, "4.6")) || (strstr(ver, "4.6.0")) || (strstr(ver, "4.60")) - || (strstr(ver, "4.6.1")) || (strstr(ver, "4.61")) - || (strstr(ver, "4.6.2")) || (strstr(ver, "4.62")) - || (strstr(ver, "4.6.3")) || (strstr(ver, "4.63")) ) { + || (prefix("4.6", ver)) ) { type = INPtypelook("BSIM4"); } if (type < 0) { - err = - INPmkTemp - ("Device type BSIM4 not available in this binary\n"); + err = (char *) tmalloc(sizeof(char) * (60 + strlen(ver))); + sprintf(err,"Device type BSIM4 version %s not available in this binary\n",ver); } break; case 15: