diff --git a/src/spicelib/devices/bsim3v32/b3v32check.c b/src/spicelib/devices/bsim3v32/b3v32check.c index b0d3aa4f5..18eca0401 100644 --- a/src/spicelib/devices/bsim3v32/b3v32check.c +++ b/src/spicelib/devices/bsim3v32/b3v32check.c @@ -38,10 +38,10 @@ FILE *fplog; fprintf (fplog, "W = %g, L = %g, M = %g\n", here->BSIM3v32w, here->BSIM3v32l, here->BSIM3v32m); - if ((strcmp(model->BSIM3v32version, "3.2.4")) && (strcmp(model->BSIM3v32version, "3.24")) - && (strcmp(model->BSIM3v32version, "3.2.3")) && (strcmp(model->BSIM3v32version, "3.23")) - && (strcmp(model->BSIM3v32version, "3.2.2")) && (strcmp(model->BSIM3v32version, "3.22")) - && (strcmp(model->BSIM3v32version, "3.2")) && (strcmp(model->BSIM3v32version, "3.20"))) + if ((strcmp(model->BSIM3v32version, "3.2.4")) && (strncmp(model->BSIM3v32version, "3.24", 4)) + && (strcmp(model->BSIM3v32version, "3.2.3")) && (strncmp(model->BSIM3v32version, "3.23", 4)) + && (strcmp(model->BSIM3v32version, "3.2.2")) && (strncmp(model->BSIM3v32version, "3.22", 4)) + && (strncmp(model->BSIM3v32version, "3.2", 3)) && (strncmp(model->BSIM3v32version, "3.20", 4))) { fprintf (fplog, "Warning: This model supports BSIM3v3.2, BSIM3v3.2.2, BSIM3v3.2.3, BSIM3v3.2.4\n"); diff --git a/src/spicelib/devices/bsim3v32/b3v32set.c b/src/spicelib/devices/bsim3v32/b3v32set.c index 9be77e723..c03e72716 100644 --- a/src/spicelib/devices/bsim3v32/b3v32set.c +++ b/src/spicelib/devices/bsim3v32/b3v32set.c @@ -82,13 +82,13 @@ BSIM3v32instance **InstArray; * is faster than comparing strings. * Paolo Nenzi 2002 */ - if ((!strcmp(model->BSIM3v32version, "3.2.4"))||(!strcmp(model->BSIM3v32version, "3.24"))) + if ((!strcmp(model->BSIM3v32version, "3.2.4"))||(!strncmp(model->BSIM3v32version, "3.24", 4))) model->BSIM3v32intVersion = BSIM3v32V324; - else if ((!strcmp(model->BSIM3v32version, "3.2.3"))||(!strcmp(model->BSIM3v32version, "3.23"))) + else if ((!strcmp(model->BSIM3v32version, "3.2.3"))||(!strncmp(model->BSIM3v32version, "3.23", 4))) model->BSIM3v32intVersion = BSIM3v32V323; - else if ((!strcmp(model->BSIM3v32version, "3.2.2"))||(!strcmp(model->BSIM3v32version, "3.22"))) + else if ((!strcmp(model->BSIM3v32version, "3.2.2"))||(!strncmp(model->BSIM3v32version, "3.22", 4))) model->BSIM3v32intVersion = BSIM3v32V322; - else if ((!strcmp(model->BSIM3v32version, "3.2"))||(!strcmp(model->BSIM3v32version, "3.20"))) + else if ((!strncmp(model->BSIM3v32version, "3.2", 3))||(!strncmp(model->BSIM3v32version, "3.20", 4))) model->BSIM3v32intVersion = BSIM3v32V32; else model->BSIM3v32intVersion = BSIM3v32V3OLD; diff --git a/src/spicelib/devices/bsim4/b4check.c b/src/spicelib/devices/bsim4/b4check.c index cc92337a1..230951ce5 100644 --- a/src/spicelib/devices/bsim4/b4check.c +++ b/src/spicelib/devices/bsim4/b4check.c @@ -84,7 +84,7 @@ FILE *fplog; fprintf(fplog, "\n"); fprintf(fplog, "++++++++++ BSIM4 PARAMETER CHECKING BELOW ++++++++++\n"); - if ((strcmp(model->BSIM4version, "4.8.1")) && (strcmp(model->BSIM4version, "4.81")) && (strcmp(model->BSIM4version, "4.8"))) + if ((strcmp(model->BSIM4version, "4.8.1")) && (strncmp(model->BSIM4version, "4.81", 4)) && (strncmp(model->BSIM4version, "4.8", 3))) { fprintf(fplog, "Warning: This model is BSIM4.8.1; you specified a deviating version number.\n"); printf("Warning: This model is BSIM4.8.1; you specified a deviating version number.\n"); } @@ -812,7 +812,7 @@ FILE *fplog; printf("Warning: TNOIMOD=1 is not supported and may be removed from future version.\n"); } - if ((strcmp(model->BSIM4version, "4.8.1")) && (strcmp(model->BSIM4version, "4.81"))) { + if ((strcmp(model->BSIM4version, "4.8.1")) && (strncmp(model->BSIM4version, "4.81", 4))) { /* v4.7 */ if (model->BSIM4tnoiMod == 1 || model->BSIM4tnoiMod == 2) { if (model->BSIM4tnoia < 0.0) { diff --git a/src/spicelib/devices/bsim4/b4noi.c b/src/spicelib/devices/bsim4/b4noi.c index 9875ea8b8..5ef294244 100644 --- a/src/spicelib/devices/bsim4/b4noi.c +++ b/src/spicelib/devices/bsim4/b4noi.c @@ -410,7 +410,7 @@ double m; T8 = here->BSIM4Vgsteff / here->BSIM4EsatL; T8 *= T8; - if ((strcmp(model->BSIM4version, "4.8.1")) && (strcmp(model->BSIM4version, "4.81"))) { + if ((strcmp(model->BSIM4version, "4.8.1")) && (strncmp(model->BSIM4version, "4.81", 4))) { npart_c = model->BSIM4rnoic * (1.0 + T8 * model->BSIM4tnoic * Leff); ctnoi = epsilon / sqrt(gamma * delta) @@ -463,7 +463,7 @@ double m; switch(model->BSIM4tnoiMod) { case 0: - if ((strcmp(model->BSIM4version, "4.8.1")) && (strcmp(model->BSIM4version, "4.81"))) { + if ((strcmp(model->BSIM4version, "4.8.1")) && (strncmp(model->BSIM4version, "4.81", 4))) { T0 = here->BSIM4ueff * fabs(here->BSIM4qinv); T1 = T0 * tmp + pParam->BSIM4leff * pParam->BSIM4leff; @@ -489,7 +489,7 @@ double m; } break; case 1: - if ((strcmp(model->BSIM4version, "4.8.1")) && (strcmp(model->BSIM4version, "4.81"))) { + if ((strcmp(model->BSIM4version, "4.8.1")) && (strncmp(model->BSIM4version, "4.81", 4))) { T0 = here->BSIM4gm + here->BSIM4gmbs + here->BSIM4gds; T0 *= T0; igsquare = npart_theta * npart_theta * T0 / here->BSIM4IdovVds; diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index e23fbe341..4b5c90979 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -383,7 +383,7 @@ BSIM4instance **InstArray; model->BSIM4eu = (model->BSIM4type == NMOS) ? 1.67 : 1.0; if (!model->BSIM4ucsGiven) model->BSIM4ucs = (model->BSIM4type == NMOS) ? 1.67 : 1.0; - if ((strcmp(model->BSIM4version, "4.8.1")) && (strcmp(model->BSIM4version, "4.81"))) + if ((strcmp(model->BSIM4version, "4.8.1")) && (strncmp(model->BSIM4version, "4.81", 4))) { if (!model->BSIM4uaGiven) model->BSIM4ua = ((model->BSIM4mobMod == 2)) ? 1.0e-15 : 1.0e-9; /* unit m/V */ diff --git a/src/spicelib/devices/bsim4/b4temp.c b/src/spicelib/devices/bsim4/b4temp.c index 856bf476c..8d8ce3934 100644 --- a/src/spicelib/devices/bsim4/b4temp.c +++ b/src/spicelib/devices/bsim4/b4temp.c @@ -1385,7 +1385,7 @@ int Size_Not_Found, i; pParam->BSIM4Aechvb = (model->BSIM4type == NMOS) ? 4.97232e-7 : 3.42537e-7; pParam->BSIM4Bechvb = (model->BSIM4type == NMOS) ? 7.45669e11 : 1.16645e12; - if ((strcmp(model->BSIM4version, "4.8.1")) && (strcmp(model->BSIM4version, "4.81"))) + if ((strcmp(model->BSIM4version, "4.8.1")) && (strncmp(model->BSIM4version, "4.81", 4))) { pParam->BSIM4AechvbEdgeS = pParam->BSIM4Aechvb * pParam->BSIM4weff * model->BSIM4dlcig * pParam->BSIM4ToxRatioEdge; diff --git a/src/spicelib/devices/bsim4v5/b4v5check.c b/src/spicelib/devices/bsim4v5/b4v5check.c index 1882516e8..f4ea97cc4 100644 --- a/src/spicelib/devices/bsim4v5/b4v5check.c +++ b/src/spicelib/devices/bsim4v5/b4v5check.c @@ -40,7 +40,7 @@ FILE *fplog; fprintf(fplog, "\n"); fprintf(fplog, "++++++++++ BSIM4v5 PARAMETER CHECKING BELOW ++++++++++\n"); - if ((strcmp(model->BSIM4v5version, "4.5.0")) && (strcmp(model->BSIM4v5version, "4.50")) && (strcmp(model->BSIM4v5version, "4.5"))) + if ((strcmp(model->BSIM4v5version, "4.5.0")) && (strncmp(model->BSIM4v5version, "4.50", 4)) && (strncmp(model->BSIM4v5version, "4.5", 3))) { fprintf(fplog, "Warning: This model is BSIM4.5.0; you specified a wrong version number '%s'.\n", model->BSIM4v5version); printf("Warning: This model is BSIM4.5.0; you specified a wrong version number '%s'.\n", model->BSIM4v5version); } diff --git a/src/spicelib/devices/bsim4v7/b4v7check.c b/src/spicelib/devices/bsim4v7/b4v7check.c index 981022f2f..5b4d31f29 100644 --- a/src/spicelib/devices/bsim4v7/b4v7check.c +++ b/src/spicelib/devices/bsim4v7/b4v7check.c @@ -46,7 +46,7 @@ FILE *fplog; fprintf(fplog, "\n"); fprintf(fplog, "++++++++++ BSIM4v7 PARAMETER CHECKING BELOW ++++++++++\n"); - if ((strcmp(model->BSIM4v7version, "4.7.0")) && (strcmp(model->BSIM4v7version, "4.70")) && (strcmp(model->BSIM4v7version, "4.7"))) + if ((strcmp(model->BSIM4v7version, "4.7.0")) && (strncmp(model->BSIM4v7version, "4.70", 4)) && (strncmp(model->BSIM4v7version, "4.7", 3))) { fprintf(fplog, "Warning: This model is BSIM4.7.0; you specified a wrong version number.\n"); printf("Warning: This model is BSIM4.7.0; you specified a wrong version number.\n"); } diff --git a/src/spicelib/devices/hisimhv1/hsmhvset.c b/src/spicelib/devices/hisimhv1/hsmhvset.c index dc23db325..e8e13d6ad 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvset.c +++ b/src/spicelib/devices/hisimhv1/hsmhvset.c @@ -77,9 +77,8 @@ int HSMHVsetup( model->HSMHV_version = "1.24" ; printf(" 1.24 is selected for VERSION. (default) \n"); } else { - if (strcmp(model->HSMHV_version,"1.24") != 0 ) { + if (strncmp(model->HSMHV_version,"1.24", 4) != 0 ) { model->HSMHV_version = "1.24" ; -// printf(" 1.24 is only available for VERSION. \n"); printf(" 1.24 is selected for VERSION. (default) \n"); } else { printf(" %s is selected for VERSION \n", model->HSMHV_version); diff --git a/src/spicelib/devices/hisimhv2/hsmhv2set.c b/src/spicelib/devices/hisimhv2/hsmhv2set.c index 4b3a8cc77..a434f0b5e 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2set.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2set.c @@ -138,10 +138,10 @@ int HSMHV2setup( printf("HiSIM_HV(%s): 2.20 is selected for VERSION. (default) \n",model->HSMHV2modName); model->HSMHV2_subversion = 2 ; } else { - if (strcmp(model->HSMHV2_version,"2.20") == 0 ) { + if (strncmp(model->HSMHV2_version,"2.20", 4) == 0 ) { printf("HiSIM_HV(%s): 2.20 is selected for VERSION. (default) \n",model->HSMHV2modName); model->HSMHV2_subversion = 2 ; - } else if (strcmp(model->HSMHV2_version,"2.2") == 0 ) { + } else if (strncmp(model->HSMHV2_version,"2.2", 3) == 0 ) { printf("HiSIM_HV(%s): 2.20 is selected for VERSION. (default) \n",model->HSMHV2modName); model->HSMHV2_subversion = 2 ; } else {