From c49ad41b6b025e10622d31ddb2303bf724b0ee6c Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 26 Feb 2017 11:43:18 +0100 Subject: [PATCH] bxxcheck.c, enable output path selection --- src/spicelib/devices/bsim3/b3check.c | 8 +++++--- src/spicelib/devices/bsim3soi_dd/b3soiddcheck.c | 8 +++++--- src/spicelib/devices/bsim3soi_fd/b3soifdcheck.c | 7 +++++-- src/spicelib/devices/bsim3soi_pd/b3soipdcheck.c | 8 +++++--- src/spicelib/devices/bsim3v1/b3v1check.c | 8 +++++--- src/spicelib/devices/bsim3v32/b3v32check.c | 8 +++++--- src/spicelib/devices/bsim4/b4check.c | 8 +++++--- src/spicelib/devices/bsim4v5/b4v5check.c | 8 +++++--- src/spicelib/devices/bsim4v6/b4v6check.c | 8 +++++--- src/spicelib/devices/bsim4v7/b4v7check.c | 8 +++++--- src/spicelib/devices/bsimsoi/b4soicheck.c | 8 +++++--- 11 files changed, 55 insertions(+), 32 deletions(-) diff --git a/src/spicelib/devices/bsim3/b3check.c b/src/spicelib/devices/bsim3/b3check.c index eb00bc5ad..f62d93ade 100644 --- a/src/spicelib/devices/bsim3/b3check.c +++ b/src/spicelib/devices/bsim3/b3check.c @@ -18,6 +18,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int BSIM3checkModel( @@ -30,8 +31,9 @@ int Fatal_Flag = 0; FILE *fplog; NG_IGNORE(ckt); - - if ((fplog = fopen("b3v33check.log", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("b3v33check.log"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "BSIM3v3.3.0 Parameter Checking.\n"); if ((strncmp(model->BSIM3version, "3.3.0", 5)) && (strncmp(model->BSIM3version, "3.30", 4)) && (strncmp(model->BSIM3version, "3.3", 3))) @@ -449,7 +451,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddcheck.c b/src/spicelib/devices/bsim3soi_dd/b3soiddcheck.c index 74e51d240..c698f1eea 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddcheck.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddcheck.c @@ -18,6 +18,7 @@ Modified by Paolo Nenzi 2002 #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int B3SOIDDcheckModel(B3SOIDDmodel *model, B3SOIDDinstance *here, CKTcircuit *ckt) @@ -27,8 +28,9 @@ int Fatal_Flag = 0; FILE *fplog; NG_IGNORE(ckt); - - if ((fplog = fopen("b3soiddv2check.log", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("b3soiddv2check.log"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "B3SOI(DD)V2.1 Parameter Check\n"); fprintf(fplog, "Model = %s\n", model->B3SOIDDmodName); @@ -501,7 +503,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdcheck.c b/src/spicelib/devices/bsim3soi_fd/b3soifdcheck.c index 797557274..ae2dd3d7f 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdcheck.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdcheck.c @@ -18,6 +18,7 @@ File: b3soifdcheck.c 98/5/01 #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int B3SOIFDcheckModel(B3SOIFDmodel *model, B3SOIFDinstance *here, CKTcircuit *ckt) @@ -28,7 +29,9 @@ FILE *fplog; NG_IGNORE(ckt); - if ((fplog = fopen("b3soifdv2check.log", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("b3soifdv2check.log"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "B3SOI (FD) Version 2.1 Parameter Check\n"); fprintf(fplog, "Model = %s\n", model->B3SOIFDmodName); @@ -501,7 +504,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdcheck.c b/src/spicelib/devices/bsim3soi_pd/b3soipdcheck.c index 66721e7d0..2f1fa509f 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdcheck.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdcheck.c @@ -22,6 +22,7 @@ Modifies by Paolo Nenzi 2002 #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int B3SOIPDcheckModel(B3SOIPDmodel *model, B3SOIPDinstance *here, CKTcircuit *ckt) @@ -31,8 +32,9 @@ int Fatal_Flag = 0; FILE *fplog; NG_IGNORE(ckt); - - if ((fplog = fopen("b3soipdv223check.log", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("b3soipdv223check.log"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "B3SOIPDV223 Parameter Check\n"); fprintf(fplog, "Model = %s\n", model->B3SOIPDmodName); @@ -736,7 +738,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim3v1/b3v1check.c b/src/spicelib/devices/bsim3v1/b3v1check.c index 8e87c914f..a5f716825 100644 --- a/src/spicelib/devices/bsim3v1/b3v1check.c +++ b/src/spicelib/devices/bsim3v1/b3v1check.c @@ -19,6 +19,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int BSIM3v1checkModel(BSIM3v1model *model, BSIM3v1instance *here, CKTcircuit *ckt) @@ -28,8 +29,9 @@ int Fatal_Flag = 0; FILE *fplog; NG_IGNORE(ckt); - - if ((fplog = fopen("b3v3_1check.log", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("b3v3_1check.log"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "BSIM3V3.1 Parameter Check\n"); fprintf(fplog, "Model = %s\n", model->BSIM3v1modName); @@ -360,7 +362,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim3v32/b3v32check.c b/src/spicelib/devices/bsim3v32/b3v32check.c index b0d3aa4f5..4fb0179fd 100644 --- a/src/spicelib/devices/bsim3v32/b3v32check.c +++ b/src/spicelib/devices/bsim3v32/b3v32check.c @@ -18,6 +18,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int BSIM3v32checkModel (BSIM3v32model *model, BSIM3v32instance *here, CKTcircuit *ckt) @@ -27,8 +28,9 @@ int Fatal_Flag = 0; FILE *fplog; NG_IGNORE(ckt); - - if ((fplog = fopen("b3v32check.log", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("b3v32check.log"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf (fplog, @@ -452,7 +454,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim4/b4check.c b/src/spicelib/devices/bsim4/b4check.c index cc92337a1..518ddc118 100644 --- a/src/spicelib/devices/bsim4/b4check.c +++ b/src/spicelib/devices/bsim4/b4check.c @@ -66,6 +66,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int BSIM4checkModel( @@ -76,8 +77,9 @@ CKTcircuit *ckt) struct bsim4SizeDependParam *pParam; int Fatal_Flag = 0; FILE *fplog; - - if ((fplog = fopen("bsim4.out", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("bsim4.out"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "BSIM4: Berkeley Short Channel IGFET Model-4\n"); fprintf(fplog, "Developed by Xuemei (Jane) Xi, Mohan Dunga, Prof. Ali Niknejad and Prof. Chenming Hu in 2003.\n"); @@ -1011,7 +1013,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim4v5/b4v5check.c b/src/spicelib/devices/bsim4v5/b4v5check.c index 1882516e8..d648b5cd5 100644 --- a/src/spicelib/devices/bsim4v5/b4v5check.c +++ b/src/spicelib/devices/bsim4v5/b4v5check.c @@ -22,6 +22,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int BSIM4v5checkModel( @@ -32,8 +33,9 @@ CKTcircuit *ckt) struct bsim4v5SizeDependParam *pParam; int Fatal_Flag = 0; FILE *fplog; - - if ((fplog = fopen("bsim4v5.out", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("bsim4v5.out"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "BSIM4v5: Berkeley Short Channel IGFET Model-4\n"); fprintf(fplog, "Developed by Xuemei (Jane) Xi, Mohan Dunga, Prof. Ali Niknejad and Prof. Chenming Hu in 2003.\n"); @@ -810,7 +812,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim4v6/b4v6check.c b/src/spicelib/devices/bsim4v6/b4v6check.c index 6181eed1a..468d049b2 100644 --- a/src/spicelib/devices/bsim4v6/b4v6check.c +++ b/src/spicelib/devices/bsim4v6/b4v6check.c @@ -27,6 +27,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int BSIM4v6checkModel( @@ -37,8 +38,9 @@ CKTcircuit *ckt) struct bsim4v6SizeDependParam *pParam; int Fatal_Flag = 0; FILE *fplog; - - if ((fplog = fopen("bsim4v6.out", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("bsim4v6.out"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "BSIM4v6: Berkeley Short Channel IGFET Model-4\n"); fprintf(fplog, "Developed by Xuemei (Jane) Xi, Mohan Dunga, Prof. Ali Niknejad and Prof. Chenming Hu in 2003.\n"); @@ -870,7 +872,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsim4v7/b4v7check.c b/src/spicelib/devices/bsim4v7/b4v7check.c index 981022f2f..9532fb5f9 100644 --- a/src/spicelib/devices/bsim4v7/b4v7check.c +++ b/src/spicelib/devices/bsim4v7/b4v7check.c @@ -28,6 +28,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int BSIM4v7checkModel( @@ -38,8 +39,9 @@ CKTcircuit *ckt) struct bsim4SizeDependParam *pParam; int Fatal_Flag = 0; FILE *fplog; - - if ((fplog = fopen("bsim4.out", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("bsim4v7.out"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "BSIM4v7: Berkeley Short Channel IGFET Model-4\n"); fprintf(fplog, "Developed by Xuemei (Jane) Xi, Mohan Dunga, Prof. Ali Niknejad and Prof. Chenming Hu in 2003.\n"); @@ -893,7 +895,7 @@ FILE *fplog; else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); } diff --git a/src/spicelib/devices/bsimsoi/b4soicheck.c b/src/spicelib/devices/bsimsoi/b4soicheck.c index 15d97ed2d..f0dfdc8bb 100644 --- a/src/spicelib/devices/bsimsoi/b4soicheck.c +++ b/src/spicelib/devices/bsimsoi/b4soicheck.c @@ -24,6 +24,7 @@ #include "ngspice/sperror.h" #include "ngspice/devdefs.h" #include "ngspice/suffix.h" +#include "ngspice/fteext.h" int B4SOIcheckModel( @@ -36,8 +37,9 @@ int Fatal_Flag = 0; FILE *fplog; NG_IGNORE(ckt); - - if ((fplog = fopen("b4soiv1check.log", "w")) != NULL) + /* add user defined path (nname has to be freed after usage) */ + char *nname = set_output_path("b4soiv1check.log"); + if ((fplog = fopen(nname, "w")) != NULL) { pParam = here->pParam; fprintf(fplog, "B4SOIV3 Parameter Check\n"); fprintf(fplog, "Model = %s\n", model->B4SOImodName); @@ -1018,7 +1020,7 @@ if (model->B4SOInpeak > 1.0e20) else { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n"); } - + tfree(nname); return(Fatal_Flag); }