From 097e534ad2401c0b22f734ee122d5763e442636f Mon Sep 17 00:00:00 2001 From: Jim Monte Date: Mon, 24 Feb 2020 02:38:32 -0500 Subject: [PATCH 01/19] Added featurest to com_let to allow default low and high indices and to allow the last dimension to default to its full range --- src/frontend/com_let.c | 242 +++++++++++++++++++++++++---------------- 1 file changed, 149 insertions(+), 93 deletions(-) diff --git a/src/frontend/com_let.c b/src/frontend/com_let.c index 150f13788..af91f8339 100644 --- a/src/frontend/com_let.c +++ b/src/frontend/com_let.c @@ -23,9 +23,11 @@ static void copy_vector_data(struct dvec *vec_dst, static void copy_vector_data_with_stride(struct dvec *vec_dst, const struct dvec *vec_src, int n_dst_index, const index_range_t *p_dst_index); -static int find_indices(char *s, index_range_t *p_index, int *p_n_index); -static int get_index_values(char *s, index_range_t *p_range); -int get_one_index_value(char *s, int *p_index); +static int find_indices(char *s, const struct dvec *vec_dst, + index_range_t *p_index); +static int get_index_values(char *s, int n_elem_this_dim, + index_range_t *p_range); +int get_one_index_value(const char *s, int *p_index); /* let = * let [] = @@ -44,6 +46,9 @@ void com_let(wordlist *wl) struct dvec *vec_src = (struct dvec *) NULL; char *rhs; + /* Start of index NULL is a flag for no index */ + char *p_index_start = (char *) NULL; + /* let with no arguments is equivalent to display */ if (!wl) { @@ -66,15 +71,15 @@ void com_let(wordlist *wl) * p = leftmost part of orig p up to first '['. So p always * becomes the vector name, possibly with some spaces at the end. */ if ((s = strchr(p, '[')) != NULL) { + /* This null makes the dest vector name a null-terminated string */ *s = '\0'; - if (find_indices(s + 1, p_dst_index, &n_dst_index) != 0) { - txfree(p); - return; - } - } /* end of case that an indexing bracket '[' was found */ + p_index_start = s + 1; + } - - /* "Remove" any spaces at the end of the vector name at p */ + /* "Remove" any spaces at the end of the vector name at p by stepping + * from the end of the word to the first charatcter that is not + * whitespace and then overwriting the next character (which will be + * the original NULL if there was no whitespace) with a NULL. */ { char *q; for (q = p + strlen(p) - 1; *q <= ' ' && p <= q; q--) { @@ -89,14 +94,45 @@ void com_let(wordlist *wl) goto quit; } + /* Locate the vector being assigned values. If NULL, the vector + * does not exist */ + struct dvec *vec_dst = vec_get(p); + if (vec_dst != (struct dvec *) NULL) { + /* Fix-up dimension count and limit. Sometimes these are + * not set properly. If not set, give the vector 1 dimension and + * ensure the right length */ + if (vec_dst->v_numdims < 1) { + vec_dst->v_numdims = 1; + } + if (vec_dst->v_numdims == 1) { + vec_dst->v_dims[0] = vec_dst->v_length; + } + } + + /* If the vector was indexed, find the indices */ + if (p_index_start != (char *) NULL) { + /* Test for an attempt to index an undefined vector */ + if (vec_dst == (struct dvec *) NULL) { + fprintf(cp_err, + "When creating a new vector, it cannot be indexed.\n"); + goto quit; + } + + if (find_indices(p_index_start, vec_dst, p_dst_index) != 0) { + txfree(p); + return; + } + n_dst_index = vec_dst->v_numdims; + } /* end of case that an indexing bracket '[' was found */ + + /* Evaluate rhs */ - names = ft_getpnames_from_string(rhs, TRUE); - if (names == (struct pnode *) NULL) { + if ((names = ft_getpnames_from_string( + rhs, TRUE)) == (struct pnode *) NULL) { fprintf(cp_err, "Error: RHS \"%s\" invalid\n", rhs); goto quit; } - vec_src = ft_evaluate(names); - if (!vec_src) { + if ((vec_src = ft_evaluate(names)) == (struct dvec *) NULL) { fprintf(cp_err, "Error: Can't evaluate \"%s\"\n", rhs); goto quit; } @@ -106,7 +142,7 @@ void com_let(wordlist *wl) } /* Fix-up dimension count and limit. Sometimes these are - * not set properly. If not set, make 1-d vector and ensure + * not set properly. If not set, give the vector 1 dimension and ensure * the right length */ if (vec_src->v_numdims < 1) { vec_src->v_numdims = 1; @@ -115,20 +151,9 @@ void com_let(wordlist *wl) vec_src->v_dims[0] = vec_src->v_length; } - /* Locate the vector being assigned values. If NULL, the vector - * does not exist */ - struct dvec * vec_dst = vec_get(p); - if (vec_dst == (struct dvec *) NULL) { /* p is not an existing vector. So make a new one equal to vec_src * in all ways, except enforce that it is a permanent vector. */ - if (n_dst_index > 0) { - fprintf(cp_err, - "When creating a new vector, it cannot be indexed.\n"); - goto quit; - } - - /* Create and assign a new vector */ vec_dst = dvec_alloc(copy(p), vec_src->v_type, vec_src->v_flags | VF_PERMANENT, @@ -140,15 +165,6 @@ void com_let(wordlist *wl) } /* end of case of new vector */ else { /* Existing vector.*/ - /* Fix-up dimension count and limit. Sometimes these are - * not set properly. If not set, make 1-d vector and ensure - * the right length */ - if (vec_dst->v_numdims < 1) { - vec_dst->v_numdims = 1; - } - if (vec_dst->v_numdims == 1) { - vec_dst->v_dims[0] = vec_dst->v_length; - } if (n_dst_index == 0) { /* Not indexed, so make equal to source vector as if it @@ -219,29 +235,6 @@ void com_let(wordlist *wl) goto quit; } - /* Check dimension numbers */ - if (n_dst_index != vec_dst->v_numdims) { - fprintf(cp_err, "Number of vector indices given (%d) " - "does not match the dimension of the vector (%d).\n", - n_dst_index, vec_dst->v_numdims); - goto quit; - } - - /* Check dimension ranges */ - { - int i; - int *vec_dst_dims = vec_dst->v_dims; - for (i = 0; i < n_dst_index; ++i) { - const int n_dst_cur = vec_dst_dims[i]; - if (p_dst_index[i].high >= n_dst_cur) { - fprintf(cp_err, - "Vector index %d out of range (%d).\n", - i + 1, n_dst_cur); - goto quit; - } - } /* end of loop over dimensions */ - } - /* OK to copy, so copy */ copy_vector_data_with_stride(vec_dst, vec_src, n_dst_index, p_dst_index); @@ -269,20 +262,25 @@ quit: /* Process indexing portion of a let command. On entry, s is the address * of the first byte after the first opening index bracket */ -static int find_indices(char *s, index_range_t *p_index, int *p_n_index) +static int find_indices(char *s, const struct dvec *vec_dst, + index_range_t *p_index) { + const int v_numdims_dst = vec_dst->v_numdims; + const int * const v_dims_dst = vec_dst->v_dims; + int dim_cur = 0; /* current dimension being set */ + + /* Can be either comma-separated or individual dimensions */ if (strchr(s, ',') != 0) { /* has commas */ char *p_end; - int dim_cur = 0; - const int dim_max = MAXDIMS - 1; while ((p_end = strchr(s, ',')) != (char *) NULL) { *p_end = '\0'; - if (dim_cur == dim_max) { + if (dim_cur == v_numdims_dst) { (void) fprintf(cp_err, "Too many dimensions given.\n"); return -1; } - if (get_index_values(s, p_index + dim_cur) != 0) { + if (get_index_values(s, v_dims_dst[dim_cur], + p_index + dim_cur) != 0) { (void) fprintf(cp_err, "Dimension ranges " "for dimension %d could not be found.\n", dim_cur + 1); @@ -300,12 +298,13 @@ static int find_indices(char *s, index_range_t *p_index, int *p_n_index) } *p_end = '\0'; - if (dim_cur == dim_max) { + if (dim_cur == v_numdims_dst) { (void) fprintf(cp_err, "Final dimension exceded maximum number.\n"); return -1; } - if (get_index_values(s, p_index + dim_cur) != 0) { + if (get_index_values(s, v_dims_dst[dim_cur], + p_index + dim_cur) != 0) { (void) fprintf(cp_err, "Dimension ranges " "for last dimension (%d) could not be found.\n", dim_cur + 1); @@ -321,21 +320,18 @@ static int find_indices(char *s, index_range_t *p_index, int *p_n_index) s); return -1; } - - *p_n_index = dim_cur; - return 0; } /* end of case x[ , , ] */ else { /* x[][][] */ char *p_end; - int dim_cur = 0; - const int dim_max = MAXDIMS - 1; while ((p_end = strchr(s, ']')) != (char *) NULL) { *p_end = '\0'; - if (dim_cur == dim_max) { - (void) fprintf(cp_err, "Too many dimensions given.\n"); + if (dim_cur == v_numdims_dst) { + (void) fprintf(cp_err, "Too many dimensions given. " + "Only %d are present.\n", v_numdims_dst); return -1; } - if (get_index_values(s, p_index + dim_cur) != 0) { + if (get_index_values(s, v_dims_dst[dim_cur], + p_index + dim_cur) != 0) { (void) fprintf(cp_err, "Dimension ranges " "for dimension %d could not be found.\n", dim_cur + 1); @@ -344,8 +340,7 @@ static int find_indices(char *s, index_range_t *p_index, int *p_n_index) ++dim_cur; s = p_end + 1; /* after (former) ']' */ if (*(s = skip_ws(s)) == '\0') { /* reached end */ - *p_n_index = dim_cur; - return 0; + break; } /* Not end of expression, so must be '[' */ @@ -358,11 +353,35 @@ static int find_indices(char *s, index_range_t *p_index, int *p_n_index) s++; /* past '[' */ } /* end of loop over individual bracketed entries */ - /* Did not find a single ']' in the string */ - (void) fprintf(cp_err, "The ']' for dimension 1 " - "could not be found.\n"); - return -1; + if (dim_cur == 0) { + /* Did not find a single ']' in the string */ + (void) fprintf(cp_err, "The ']' for dimension 1 " + "could not be found.\n"); + return -1; + } } /* end of case x[][][][] */ + + /* Finalize dimensions. There must be the same number or one less than + * the number of dimensions of the vector. For the special case of one + * less, the final dimension is set to the full range of the last + * dimension. Note that checks for too many dimensions have already + * been performed while the index information was found. */ + if (dim_cur != v_numdims_dst) { /* special case or error */ + if (dim_cur == v_numdims_dst - 1) { /* special case */ + index_range_t * const p_index_last = p_index + dim_cur; + p_index_last->low = 0; + p_index_last->high = vec_dst->v_dims[dim_cur] - 1; + } + else { + (void) fprintf(cp_err, "Error: Only %d dimensions " + "were supplied, but %d are needed. The last dimension " + "may be omitted, in which case it will defalt to the " + "full range of that dimension.\n", + dim_cur, v_numdims_dst); + } + } + + return 0; } /* end of function find_indices */ @@ -370,9 +389,13 @@ static int find_indices(char *s, index_range_t *p_index, int *p_n_index) /* Convert expresion expr -> low and high ranges equal or * expression expr1 : epr2 -> low = expr1 and high = expr2. * Values are tested to ensure they are positive and that the low - * value does not exceed the high value. Since the extent of the index - * is not known, that cannot be checked. */ -static int get_index_values(char *s, index_range_t *p_range) + * value does not exceed the high value. + * + * If expr1 is whitespace or empty, it defaults to 0. For high, the + * largest possible values is used. + */ +static int get_index_values(char *s, int n_elem_this_dim, + index_range_t *p_range) { char *p_colon; if ((p_colon = strchr(s, ':')) == (char *) NULL) { /* One expression */ @@ -382,32 +405,65 @@ static int get_index_values(char *s, index_range_t *p_range) } p_range->high = p_range->low; } - else { /* l:h */ + else { /* l:h. If l defaults to 0 and h to dim size - 1 */ *p_colon = '\0'; - if (get_one_index_value(s, &p_range->low) != 0) { - (void) fprintf(cp_err, "Error geting low range.\n"); - return -1; + { + const int rc = get_one_index_value(s, &p_range->low); + if (rc != 0) { + if (rc < 0) { /* error */ + (void) fprintf(cp_err, "Error geting low range.\n"); + return -1; + } + /* +1 -> Else use defalt */ + p_range->low = 0; + } } s = p_colon + 1; /* past (former) colon */ - if (get_one_index_value(s, &p_range->high) != 0) { - (void) fprintf(cp_err, "Error geting high range.\n"); - return -1; + { + const int rc = get_one_index_value(s, &p_range->high); + if (rc != 0) { + if (rc < 0) { /* error */ + (void) fprintf(cp_err, "Error geting high range.\n"); + return -1; + } + /* +1 -> Else use defalt */ + p_range->high = n_elem_this_dim - 1; + } } + + /* Ensure ranges given were valid */ if (p_range->low > p_range->high) { - (void) fprintf(cp_err, "Error low range (%d) is greater " + (void) fprintf(cp_err, "Error: low range (%d) is greater " "than high range (%d).\n", p_range->low, p_range->high); return -1; } + if (p_range->high >= n_elem_this_dim) { + (void) fprintf(cp_err, "Error: high range (%d) exceeds " + "the maximum value (%d).\n", + p_range->high, n_elem_this_dim - 1); + return -1; + } } return 0; } /* end of function get_index_values */ -/* Get an index value */ -int get_one_index_value(char *s, int *p_index) +/* Get an index value + * + * Return codes + * +1: String empty or all whitespace + * 0: Normal + * -1: Error + */ +int get_one_index_value(const char *s, int *p_index) { + /* Test for a string of whitespace */ + if (*(s = skip_ws(s)) == '\0') { + return +1; + } + /* Parse the expression */ struct pnode * const names = ft_getpnames_from_string(s, TRUE); if (names == (struct pnode *) NULL) { @@ -447,7 +503,7 @@ int get_one_index_value(char *s, int *p_index) free_pnode_x(names); return xrc; - } /* end of function get_one_index_value */ +} /* end of function get_one_index_value */ From 2c8f59d77a324003ec175582771274700466ff5a Mon Sep 17 00:00:00 2001 From: dwarning Date: Mon, 24 Feb 2020 15:09:39 +0100 Subject: [PATCH 02/19] add wincolor --- visualc/vngspice-fftw.vcxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/visualc/vngspice-fftw.vcxproj b/visualc/vngspice-fftw.vcxproj index e197090a0..3df7199ad 100644 --- a/visualc/vngspice-fftw.vcxproj +++ b/visualc/vngspice-fftw.vcxproj @@ -914,6 +914,7 @@ lib /machine:x64 /def:..\..\fftw-3.3-dll64\libfftw3-3.def /out:$(IntDir)libfftw3 + @@ -931,6 +932,7 @@ lib /machine:x64 /def:..\..\fftw-3.3-dll64\libfftw3-3.def /out:$(IntDir)libfftw3 + @@ -1522,6 +1524,7 @@ lib /machine:x64 /def:..\..\fftw-3.3-dll64\libfftw3-3.def /out:$(IntDir)libfftw3 + From 26730ba102927a4d07bd7c5779f787f69c8e4bf5 Mon Sep 17 00:00:00 2001 From: dwarning Date: Mon, 24 Feb 2020 18:49:19 +0100 Subject: [PATCH 03/19] change vdmos flag to thermal, not to confuse with b4soi --- examples/vdmos/100W.sp | 4 ++-- examples/vdmos/self-heating.sp | 2 +- src/frontend/inpcom.c | 8 ++++---- src/spicelib/devices/vdmos/vdmos.c | 2 +- src/spicelib/devices/vdmos/vdmosacld.c | 2 +- src/spicelib/devices/vdmos/vdmosask.c | 4 ++-- src/spicelib/devices/vdmos/vdmosdefs.h | 6 +++--- src/spicelib/devices/vdmos/vdmosload.c | 2 +- src/spicelib/devices/vdmos/vdmosnoi.c | 2 +- src/spicelib/devices/vdmos/vdmospar.c | 6 +++--- src/spicelib/devices/vdmos/vdmosset.c | 6 +++--- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/vdmos/100W.sp b/examples/vdmos/100W.sp index 403436643..5a898f9c9 100644 --- a/examples/vdmos/100W.sp +++ b/examples/vdmos/100W.sp @@ -5,9 +5,9 @@ *R24 & R25 are optional output offset trimming * VTamb tamb 0 25 -MQ1 +V N010 N012 tn tcn IRFP240 tnodeout +MQ1 +V N010 N012 tn tcn IRFP240 thermal X1 tcn tamb case-ambient -MQ2 -V N020 N017 tp tcp IRFP9240 tnodeout +MQ2 -V N020 N017 tp tcp IRFP9240 thermal X2 tcp tamb case-ambient R1 OUT N017 .33 R2 N012 OUT .33 diff --git a/examples/vdmos/self-heating.sp b/examples/vdmos/self-heating.sp index 535a3eb8d..463d3072d 100644 --- a/examples/vdmos/self-heating.sp +++ b/examples/vdmos/self-heating.sp @@ -1,5 +1,5 @@ VDMOS self heating test -M1 D G 0 tj tc IRFP240 tnodeout +M1 D G 0 tj tc IRFP240 thermal rthk tc 0 0.05 VG G 0 5V Pulse 0 10 0 1m 1m 100m 200m *RD D D1 4 diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index fdc7393fe..ea3ff8174 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -6964,16 +6964,16 @@ static int inp_vdmos_model(struct card *deck) card->line = new_line; wl_free(wlb); } - /* we have a VDMOS instance line with 'tnodeout' and thus need exactly 5 nodes + /* we have a VDMOS instance line with 'thermal' flag and thus need exactly 5 nodes */ - else if (strstr(curr_line, "tnodeout")) { + else if (strstr(curr_line, "thermal")) { for (i = 0; i < 7; i++) curr_line = nexttok(curr_line); - if (!ciprefix("tnodeout", curr_line)) { + if (!ciprefix("thermal", curr_line)) { fprintf(cp_err, "Error: We need exactly 5 nodes\n" " drain, gate, source, tjunction, tcase\n" - " in VDMOS instance line\n" + " in VDMOS instance line with thermal model\n" " %s\n", card->line); return 1; } diff --git a/src/spicelib/devices/vdmos/vdmos.c b/src/spicelib/devices/vdmos/vdmos.c index d6802652b..12dfd1b45 100644 --- a/src/spicelib/devices/vdmos/vdmos.c +++ b/src/spicelib/devices/vdmos/vdmos.c @@ -22,7 +22,7 @@ IFparm VDMOSpTable[] = { /* parameters */ IOPU("dtemp", VDMOS_DTEMP, IF_REAL, "Instance temperature difference"), IP( "ic", VDMOS_IC, IF_REALVEC, "Vector of D-S, G-S voltages"), - IOP("tnodeout", VDMOS_TNODEOUT, IF_FLAG, "Thermal model switch on/off"), + IOP("thermal", VDMOS_THERMAL, IF_FLAG, "Thermal model switch on/off"), OP( "id", VDMOS_CD, IF_REAL, "Drain current"), OP( "is", VDMOS_CS, IF_REAL, "Source current"), diff --git a/src/spicelib/devices/vdmos/vdmosacld.c b/src/spicelib/devices/vdmos/vdmosacld.c index 2a95a90e2..9e20e29ad 100644 --- a/src/spicelib/devices/vdmos/vdmosacld.c +++ b/src/spicelib/devices/vdmos/vdmosacld.c @@ -35,7 +35,7 @@ VDMOSacLoad(GENmodel *inModel, CKTcircuit *ckt) for(here = VDMOSinstances(model); here!= NULL; here = VDMOSnextInstance(here)) { - selfheat = (here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven); + selfheat = (here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven); if (here->VDMOSmode < 0) { xnrm=0; xrev=1; diff --git a/src/spicelib/devices/vdmos/vdmosask.c b/src/spicelib/devices/vdmos/vdmosask.c index 597192fc3..4db205518 100644 --- a/src/spicelib/devices/vdmos/vdmosask.c +++ b/src/spicelib/devices/vdmos/vdmosask.c @@ -50,8 +50,8 @@ VDMOSask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case VDMOS_OFF: value->iValue = here->VDMOSoff; return(OK); - case VDMOS_TNODEOUT: - value->iValue = here->VDMOStnodeout; + case VDMOS_THERMAL: + value->iValue = here->VDMOSthermal; return(OK); case VDMOS_IC_VDS: value->rValue = here->VDMOSicVDS; diff --git a/src/spicelib/devices/vdmos/vdmosdefs.h b/src/spicelib/devices/vdmos/vdmosdefs.h index 5e227f90b..ffdae728b 100644 --- a/src/spicelib/devices/vdmos/vdmosdefs.h +++ b/src/spicelib/devices/vdmos/vdmosdefs.h @@ -64,7 +64,7 @@ typedef struct sVDMOSinstance { double VDMOSdsConductance; /*conductance of drain to source:set in setup*/ double VDMOStemp; /* operating temperature of this instance */ double VDMOSdtemp; /* operating temperature of the instance relative to circuit temperature*/ - int VDMOStnodeout; /* flag indicate self heating on */ + int VDMOSthermal; /* flag indicate self heating on */ double VDMOStTransconductance; /* temperature corrected transconductance*/ double VDMOStPhi; /* temperature corrected Phi */ @@ -157,7 +157,7 @@ typedef struct sVDMOSinstance { unsigned VDMOSsNodePrimeSet :1; unsigned VDMOSicVDSGiven :1; unsigned VDMOSicVGSGiven :1; - unsigned VDMOStnodeoutGiven : 1; /* flag indicate self heating on */ + unsigned VDMOSthermalGiven : 1; /* flag indicate self heating on */ unsigned VDMOSvonGiven : 1; unsigned VDMOSvdsatGiven :1; unsigned VDMOSmodeGiven :1; @@ -440,7 +440,7 @@ enum { VDMOS_TEMP, VDMOS_M, VDMOS_DTEMP, - VDMOS_TNODEOUT, + VDMOS_THERMAL, }; /* model parameters */ diff --git a/src/spicelib/devices/vdmos/vdmosload.c b/src/spicelib/devices/vdmos/vdmosload.c index 042a31178..f0b6d4578 100644 --- a/src/spicelib/devices/vdmos/vdmosload.c +++ b/src/spicelib/devices/vdmos/vdmosload.c @@ -104,7 +104,7 @@ VDMOSload(GENmodel *inModel, CKTcircuit *ckt) for (here = VDMOSinstances(model); here != NULL; here = VDMOSnextInstance(here)) { - selfheat = (here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven); + selfheat = (here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven); if (selfheat) Check_mos = 1; else diff --git a/src/spicelib/devices/vdmos/vdmosnoi.c b/src/spicelib/devices/vdmos/vdmosnoi.c index 48fe0dda8..3d96af5bb 100644 --- a/src/spicelib/devices/vdmos/vdmosnoi.c +++ b/src/spicelib/devices/vdmos/vdmosnoi.c @@ -91,7 +91,7 @@ VDMOSnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, switch (mode) { case N_DENS: - if ((inst->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) + if ((inst->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) tempRatioSH = inst->VDMOSTempSH / ckt->CKTtemp; else tempRatioSH = 1.0; diff --git a/src/spicelib/devices/vdmos/vdmospar.c b/src/spicelib/devices/vdmos/vdmospar.c index ad57b8c09..fef9de1bf 100644 --- a/src/spicelib/devices/vdmos/vdmospar.c +++ b/src/spicelib/devices/vdmos/vdmospar.c @@ -61,9 +61,9 @@ VDMOSparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select) here->VDMOSicVGS = value->rValue; here->VDMOSicVGSGiven = TRUE; break; - case VDMOS_TNODEOUT: - here->VDMOStnodeout = (value->iValue != 0); - here->VDMOStnodeoutGiven = TRUE; + case VDMOS_THERMAL: + here->VDMOSthermal = (value->iValue != 0); + here->VDMOSthermalGiven = TRUE; break; case VDMOS_IC: switch(value->v.numValue){ diff --git a/src/spicelib/devices/vdmos/vdmosset.c b/src/spicelib/devices/vdmos/vdmosset.c index 1bd415a91..37050c500 100644 --- a/src/spicelib/devices/vdmos/vdmosset.c +++ b/src/spicelib/devices/vdmos/vdmosset.c @@ -342,7 +342,7 @@ VDMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, here->VDIOposPrimeNode = here->VDMOSsNode; } - if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) { + if ((here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) { if (here->VDMOStempNode == -1) { error = CKTmkVolt(ckt,&tmp,here->VDMOSname,"Tj"); if (error) return(error); @@ -374,7 +374,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ return(E_NOMEM);\ } } while(0) - if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) { + if ((here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) { TSTALLOC(VDMOSTemptempPtr, VDMOStempNode, VDMOStempNode); TSTALLOC(VDMOSTempdpPtr, VDMOStempNode, VDMOSdNodePrime); TSTALLOC(VDMOSTempspPtr, VDMOStempNode, VDMOSsNodePrime); @@ -458,7 +458,7 @@ VDMOSunsetup(GENmodel *inModel, CKTcircuit *ckt) CKTdltNNum(ckt, here->VDIOposPrimeNode); here->VDIOposPrimeNode = 0; - if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) { + if ((here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) { if (here->VDMOStNodePrime > 0) CKTdltNNum(ckt, here->VDMOStNodePrime); here->VDMOStNodePrime = 0; From b2e377031ae0542790d2a128a064a04ccac536f8 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 24 Feb 2020 23:01:05 +0100 Subject: [PATCH 04/19] plug some memory leaks --- src/frontend/plotting/plotit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index 6e91694fd..6951e3730 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -344,7 +344,7 @@ bool plotit(wordlist *wl, const char *hcopy, const char *devname) } if (nylabel) { rc_ds |= ds_cat_printf(&ds_cline, " ylabel '%s'", nylabel); - tfree(nxlabel); + tfree(nylabel); } if (ntitle) { rc_ds |= ds_cat_printf(&ds_cline, " title '%s'", ntitle); @@ -1136,6 +1136,8 @@ quit: ds_free(&ds_cline); /* free dstring resources, if any */ free_pnode(names); FREE(title); + FREE(xlabel); + FREE(ylabel); quit1: /* Free any vectors left behing while parsing the plot arguments. These From 25e2eb3374537383c8e3bca5c1cd561fa491de7d Mon Sep 17 00:00:00 2001 From: dwarning Date: Tue, 25 Feb 2020 09:51:39 +0100 Subject: [PATCH 05/19] filter only mos instances with thermal switch --- src/frontend/inpcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index ea3ff8174..5deb57545 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -6966,7 +6966,7 @@ static int inp_vdmos_model(struct card *deck) } /* we have a VDMOS instance line with 'thermal' flag and thus need exactly 5 nodes */ - else if (strstr(curr_line, "thermal")) { + else if (curr_line[0] == 'm' && strstr(curr_line, "thermal")) { for (i = 0; i < 7; i++) curr_line = nexttok(curr_line); if (!ciprefix("thermal", curr_line)) { From 94894e437764ac088c91451bfeee122f6d106363 Mon Sep 17 00:00:00 2001 From: dwarning Date: Tue, 25 Feb 2020 12:43:10 +0100 Subject: [PATCH 06/19] change vdmos flag to thermal, not to confuse with b4soi --- src/frontend/inpcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5deb57545..31b5a4f6e 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -4088,7 +4088,7 @@ static int get_number_terminals(char *c) char *inst = gettok_instance(&c); strncpy(nam_buf, inst, sizeof(nam_buf) - 1); txfree(inst); - if (strstr(nam_buf, "off") || strchr(nam_buf, '=') || strstr(nam_buf, "tnodeout")) + if (strstr(nam_buf, "off") || strchr(nam_buf, '=') || strstr(nam_buf, "tnodeout") || strstr(nam_buf, "thermal")) break; i++; } From cfbae5c297ee53bab9ac9e6d7e14acf1b0069a58 Mon Sep 17 00:00:00 2001 From: dwarning Date: Tue, 25 Feb 2020 15:31:00 +0100 Subject: [PATCH 07/19] specific ngbehavior by .spiceinit --- examples/p-to-n-examples/.spiceinit | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/p-to-n-examples/.spiceinit diff --git a/examples/p-to-n-examples/.spiceinit b/examples/p-to-n-examples/.spiceinit new file mode 100644 index 000000000..b78bb0201 --- /dev/null +++ b/examples/p-to-n-examples/.spiceinit @@ -0,0 +1 @@ +set ngbehavior=psa From 63da441bac0a5e491e04f721de1f696d4aa8a3f5 Mon Sep 17 00:00:00 2001 From: dwarning Date: Tue, 25 Feb 2020 20:57:08 +0100 Subject: [PATCH 08/19] update .gitignore and make clean --- .gitignore | 4 ++++ Makefile.am | 2 +- src/xspice/icm/GNUmakefile.in | 2 ++ src/xspice/icm/analog/.gitignore | 2 ++ src/xspice/icm/digital/.gitignore | 2 ++ src/xspice/icm/spice2poly/.gitignore | 2 ++ src/xspice/icm/table/.gitignore | 11 +++++++++++ src/xspice/icm/xtradev/.gitignore | 2 ++ src/xspice/icm/xtraevt/.gitignore | 2 ++ 9 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/xspice/icm/table/.gitignore diff --git a/.gitignore b/.gitignore index fdcecdeb4..10731e4f7 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,10 @@ Makefile.in /missing /ylwrap /ar-lib +/ngspice.pc + +/src/frontend/parse-bison.* +/src/spicelib/parser/inpptree-parser.* /src/include/ngspice/config.h.in /src/include/ngspice/config.h diff --git a/Makefile.am b/Makefile.am index 1d204fd58..3a7b0d186 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ EXTRA_DIST = FAQ autogen.sh Stuarts_Poly_Notes \ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 ar-lib compile config.guess \ src/include/ngspice/config.h.in config.sub configure install-sh \ missing mkinstalldirs stamp-h.in ltconfig \ - ltmain.sh depcomp ylwrap + ltmain.sh depcomp ylwrap ngspice.pc ACLOCAL_AMFLAGS = -I m4 diff --git a/src/xspice/icm/GNUmakefile.in b/src/xspice/icm/GNUmakefile.in index 29eb60d94..632c4d140 100644 --- a/src/xspice/icm/GNUmakefile.in +++ b/src/xspice/icm/GNUmakefile.in @@ -77,8 +77,10 @@ cm-deps := \ cm-descr := \ $(cm)/cmextrn.h \ $(cm)/cminfo.h \ + $(cm)/cminfo2.h \ $(cm)/udnextrn.h \ $(cm)/udninfo.h \ + $(cm)/udninfo2.h \ $(cm)/objects.inc diff --git a/src/xspice/icm/analog/.gitignore b/src/xspice/icm/analog/.gitignore index abef3a30c..fda83b3e8 100644 --- a/src/xspice/icm/analog/.gitignore +++ b/src/xspice/icm/analog/.gitignore @@ -2,10 +2,12 @@ /cmextrn.h /cminfo.h +/cminfo2.h /dlmain.c /objects.inc /udnextrn.h /udninfo.h +/udninfo2.h /*/*.c diff --git a/src/xspice/icm/digital/.gitignore b/src/xspice/icm/digital/.gitignore index a766619af..758076c5d 100644 --- a/src/xspice/icm/digital/.gitignore +++ b/src/xspice/icm/digital/.gitignore @@ -2,10 +2,12 @@ /cmextrn.h /cminfo.h +/cminfo2.h /dlmain.c /objects.inc /udnextrn.h /udninfo.h +/udninfo2.h /*/*.c diff --git a/src/xspice/icm/spice2poly/.gitignore b/src/xspice/icm/spice2poly/.gitignore index 27b44acbe..9b60b041f 100644 --- a/src/xspice/icm/spice2poly/.gitignore +++ b/src/xspice/icm/spice2poly/.gitignore @@ -2,10 +2,12 @@ /cmextrn.h /cminfo.h +/cminfo2.h /dlmain.c /objects.inc /udnextrn.h /udninfo.h +/udninfo2.h /*/*.c diff --git a/src/xspice/icm/table/.gitignore b/src/xspice/icm/table/.gitignore new file mode 100644 index 000000000..00a3641ed --- /dev/null +++ b/src/xspice/icm/table/.gitignore @@ -0,0 +1,11 @@ +/table.cm + +/cmextrn.h +/cminfo.h +/cminfo2.h +/objects.inc +/udnextrn.h +/udninfo.h +/udninfo2.h + +/*/*.c diff --git a/src/xspice/icm/xtradev/.gitignore b/src/xspice/icm/xtradev/.gitignore index efea9c1c9..b803004ac 100644 --- a/src/xspice/icm/xtradev/.gitignore +++ b/src/xspice/icm/xtradev/.gitignore @@ -2,10 +2,12 @@ /cmextrn.h /cminfo.h +/cminfo2.h /dlmain.c /objects.inc /udnextrn.h /udninfo.h +/udninfo2.h /*/*.c diff --git a/src/xspice/icm/xtraevt/.gitignore b/src/xspice/icm/xtraevt/.gitignore index a27aace1d..352f6580d 100644 --- a/src/xspice/icm/xtraevt/.gitignore +++ b/src/xspice/icm/xtraevt/.gitignore @@ -2,10 +2,12 @@ /cmextrn.h /cminfo.h +/cminfo2.h /dlmain.c /objects.inc /udnextrn.h /udninfo.h +/udninfo2.h /*/*.c From 2a7f186c0a29487dca13890f34fde20798114cb4 Mon Sep 17 00:00:00 2001 From: dwarning Date: Fri, 28 Feb 2020 10:05:34 +0100 Subject: [PATCH 09/19] add aliases for temp coeffs --- src/spicelib/devices/bjt/bjt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/spicelib/devices/bjt/bjt.c b/src/spicelib/devices/bjt/bjt.c index fc86aa6c3..33374b14f 100644 --- a/src/spicelib/devices/bjt/bjt.c +++ b/src/spicelib/devices/bjt/bjt.c @@ -175,10 +175,13 @@ IFparm BJTmPTable[] = { /* model parameters */ IOP("tnr1", BJT_MOD_TNR1, IF_REAL, "NR 1. temperature coefficient"), IOP("tnr2", BJT_MOD_TNR2, IF_REAL, "NR 2. temperature coefficient"), IOP("trb1", BJT_MOD_TRB1, IF_REAL, "RB 1. temperature coefficient"), + IOPR("trb", BJT_MOD_TRB1, IF_REAL, "RB 1. temperature coefficient"), IOP("trb2", BJT_MOD_TRB2, IF_REAL, "RB 2. temperature coefficient"), IOP("trc1", BJT_MOD_TRC1, IF_REAL, "RC 1. temperature coefficient"), + IOPR("trc", BJT_MOD_TRC1, IF_REAL, "RC 1. temperature coefficient"), IOP("trc2", BJT_MOD_TRC2, IF_REAL, "RC 2. temperature coefficient"), IOP("tre1", BJT_MOD_TRE1, IF_REAL, "RE 1. temperature coefficient"), + IOPR("tre", BJT_MOD_TRE1, IF_REAL, "RE 1. temperature coefficient"), IOP("tre2", BJT_MOD_TRE2, IF_REAL, "RE 2. temperature coefficient"), IOP("trm1", BJT_MOD_TRM1, IF_REAL, "RBM 1. temperature coefficient"), IOP("trm2", BJT_MOD_TRM2, IF_REAL, "RBM 2. temperature coefficient"), From 4e1fd884665a4960131e8b53bdfb274f4f62de29 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 28 Feb 2020 18:08:44 +0100 Subject: [PATCH 10/19] some tiny updates to the plot commands --- examples/Monte_Carlo/MC_ring_ts.sp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/Monte_Carlo/MC_ring_ts.sp b/examples/Monte_Carlo/MC_ring_ts.sp index ee88c3296..b23dcf9b4 100644 --- a/examples/Monte_Carlo/MC_ring_ts.sp +++ b/examples/Monte_Carlo/MC_ring_ts.sp @@ -124,16 +124,17 @@ if $?batchmode rusage quit else + set nolegend if $?sharedmode or $?win_console - gnuplot xnp_pl1 {$plot_out}.vout0 $ just plot the tran output with nominal parameters + gnuplot xnp_pl1 {$plot_out}.vout0 ylabel vout0 $ just plot the tran output with nominal parameters else - plot {$plot_out}.vout0 $ just plot the tran output with nominal parameters + plot {$plot_out}.vout0 ylabel vout0 $ just plot the tran output with nominal parameters end setplot $plot_fft if $?sharedmode or $?win_console - gnuplot xnp_pl2 db(mag(ally)) xlimit 0 1G ylimit -80 10 + gnuplot xnp_pl2 db(mag(ally)) ylabel 'output voltage versus frequency' xlimit 0 1G ylimit -80 10 else - plot db(mag(ally)) xlimit 0 1G ylimit -80 10 + plot db(mag(ally)) xlimit 0 1G ylimit -80 10 ylabel 'output voltage versus frequency' end * * create a histogram from vector maxffts @@ -166,9 +167,10 @@ else * plot the histogram let count = yvec - 1 $ subtract 1 because we started with unitvec containing ones if $?sharedmode or $?win_console - gnuplot np_pl3 count vs osc_frequ combplot + gnuplot np_pl3 count vs osc_frequ combplot ylabel 'counts per bin' else - plot count vs osc_frequ combplot + set xbrushwidth=5 + plot count vs osc_frequ combplot ylabel 'counts per bin' end * calculate jitter let diff40 = (vecmax(halfffts) - vecmin(halfffts))*1e-6 From 8c9c1230fe623acd6a398564a514909ffcc4caf9 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 28 Feb 2020 18:10:31 +0100 Subject: [PATCH 11/19] plug a memory leak (IXTH80N20L-IXTH48P20P-quasisat.sp) --- src/frontend/device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frontend/device.c b/src/frontend/device.c index 809d9f24a..608fcbbea 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -1095,6 +1095,7 @@ if_set_binned_model(CKTcircuit *ckt, char *devname, char *param, struct dvec *va return; } w = v->va_V.vV_real; + free_struct_variable(v); v = if_getparam(ckt, &devname, "l", 0, 0); if (!v) { @@ -1102,6 +1103,7 @@ if_set_binned_model(CKTcircuit *ckt, char *devname, char *param, struct dvec *va return; } l = v->va_V.vV_real; + free_struct_variable(v); if (param[0] == 'w') w = *val->v_realdata; /* overwrite the width with the alter param */ From e3aa834bd493805b9465ecb4a8e7c8610db9300e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 28 Feb 2020 18:11:58 +0100 Subject: [PATCH 12/19] plug a memory leak (pll-xspice.cir) --- src/frontend/runcoms2.c | 4 ++++ src/include/ngspice/evtproto.h | 1 + src/xspice/evt/evtsetup.c | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/src/frontend/runcoms2.c b/src/frontend/runcoms2.c index 7229749e1..a275b3148 100644 --- a/src/frontend/runcoms2.c +++ b/src/frontend/runcoms2.c @@ -26,6 +26,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "numparam/numpaif.h" #include "ngspice/inpdefs.h" +#include "ngspice/evtproto.h" extern void line_free_x(struct card *deck, bool recurse); extern INPmodel *modtab; @@ -237,6 +238,9 @@ com_remcirc(wordlist *wl) /* The next lines stem from com_rset */ INPkillMods(); + /* remove event queues */ + EVTunsetup(ft_curckt->ci_ckt); + if_cktfree(ft_curckt->ci_ckt, ft_curckt->ci_symtab); for (v = ft_curckt->ci_vars; v; v = next) { next = v->va_next; diff --git a/src/include/ngspice/evtproto.h b/src/include/ngspice/evtproto.h index d1569061b..a961db1da 100644 --- a/src/include/ngspice/evtproto.h +++ b/src/include/ngspice/evtproto.h @@ -65,6 +65,7 @@ void EVTtermInsert( char **err_msg); int EVTsetup(CKTcircuit *ckt); +int EVTunsetup(CKTcircuit* ckt); int EVTdest(Evt_Ckt_Data_t *evt); diff --git a/src/xspice/evt/evtsetup.c b/src/xspice/evt/evtsetup.c index d078ad549..4414b66bc 100644 --- a/src/xspice/evt/evtsetup.c +++ b/src/xspice/evt/evtsetup.c @@ -135,6 +135,29 @@ int EVTsetup( } +int EVTunsetup( + CKTcircuit* ckt) /* The circuit structure */ +{ + int err; + + /* Exit immediately if no event-driven instances in circuit */ + if (ckt->evt->counts.num_insts == 0) + return(OK); + + /* Clear the inst, node, and output queues, and initialize the to_call */ + /* elements in the instance queue to call all event-driven instances */ + err = EVTsetup_queues(ckt); + if (err) + return(err); + + /* Initialize additional event data */ + g_mif_info.circuit.evt_step = 0.0; + + /* Return OK */ + return(OK); +} + + /* From f7705de2c7887e37974a8c70a0be84a185e5de6b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 28 Feb 2020 18:12:55 +0100 Subject: [PATCH 13/19] plug a memory leak (in case of failing op for tran calculation) --- src/spicelib/analysis/dctran.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index 5515b149d..6e6a03f77 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -275,7 +275,10 @@ DCtran(CKTcircuit *ckt, fflush(stdout); } - if(converged != 0) return(converged); + if (converged != 0) { + SPfrontEnd->OUTendPlot(job->TRANplot); + return(converged); + } #ifdef XSPICE /* gtri - add - wbk - 12/19/90 - Add IPC stuff */ From 69ec5e46afec658d2930370c6eb00b597fac301c Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 28 Feb 2020 19:44:32 +0100 Subject: [PATCH 14/19] re-enable making nutmeg --- src/frontend/runcoms2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend/runcoms2.c b/src/frontend/runcoms2.c index a275b3148..cb42e38ab 100644 --- a/src/frontend/runcoms2.c +++ b/src/frontend/runcoms2.c @@ -26,7 +26,10 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "numparam/numpaif.h" #include "ngspice/inpdefs.h" + +#if defined(XSPICE) && defined(SIMULATOR) #include "ngspice/evtproto.h" +#endif extern void line_free_x(struct card *deck, bool recurse); extern INPmodel *modtab; @@ -238,8 +241,10 @@ com_remcirc(wordlist *wl) /* The next lines stem from com_rset */ INPkillMods(); - /* remove event queues */ +#if defined(XSPICE) && defined(SIMULATOR) + /* remove event queues, if XSPICE and not nutmeg */ EVTunsetup(ft_curckt->ci_ckt); +#endif if_cktfree(ft_curckt->ci_ckt, ft_curckt->ci_symtab); for (v = ft_curckt->ci_vars; v; v = next) { From d8af86117f25bff785378d8af4ceb059b651e3ec Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 28 Feb 2020 19:55:25 +0100 Subject: [PATCH 15/19] ngsconvert.c: add const to cp_enqvar --- src/ngsconvert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngsconvert.c b/src/ngsconvert.c index 88bfcfb91..b9fb529b5 100644 --- a/src/ngsconvert.c +++ b/src/ngsconvert.c @@ -436,7 +436,7 @@ void cp_ccon(bool o) { NG_IGNORE(o); } char*if_errstring(int c) { NG_IGNORE(c); return copy("error"); } void out_printf(char *fmt, ...) { NG_IGNORE(fmt); } void out_send(char *string) { NG_IGNORE(string); } -struct variable * cp_enqvar(char *word, int *tbfreed) { NG_IGNORE(word); NG_IGNORE(*tbfreed); return (NULL); } +struct variable * cp_enqvar(const char *word, int *tbfreed) { NG_IGNORE(word); NG_IGNORE(*tbfreed); return (NULL); } struct dvec *vec_get(const char *word) { NG_IGNORE(word); return (NULL); } void cp_ccom(wordlist *w, char *b, bool e) { NG_IGNORE(e); From 7a372437a2c82f6afaa2c3678ff4f0bf15d1b5f3 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 28 Feb 2020 23:29:19 +0100 Subject: [PATCH 16/19] re-enable making old apps with --enable-oldapps --- src/Makefile.am | 9 +++++++++ src/ngproc2mod.c | 3 +++ src/ngsconvert.c | 1 + 3 files changed, 13 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index c3ecdf00c..17a07420a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -260,6 +260,7 @@ endif !NO_HELP ngsconvert_SOURCES = ngsconvert.c ngsconvert_LDADD = \ + frontend/com_history.lo \ frontend/libfte.la \ frontend/parser/libparser.la \ maths/misc/libmathmisc.la \ @@ -271,6 +272,7 @@ ngsconvert_LDADD = \ ngproc2mod_SOURCES = ngproc2mod.c ngproc2mod_LDADD = \ + frontend/libfte.la \ frontend/parser/libparser.la \ spicelib/parser/libinp.la \ misc/libmisc.la @@ -281,6 +283,8 @@ ngproc2mod_LDADD = \ ngmultidec_SOURCES = ngmultidec.c ngmultidec_LDADD = \ + frontend/libfte.la \ + frontend/parser/libparser.la \ maths/sparse/libsparse.la \ misc/libmisc.la @@ -289,6 +293,11 @@ ngmultidec_LDADD = \ ngmakeidx_SOURCES = makeidx.c +ngmakeidx_LDADD = \ + frontend/libfte.la \ + frontend/parser/libparser.la \ + misc/libmisc.la + ## create index for online help: ngspice.idx: ngmakeidx$(EXEEXT) $(srcdir)/ngspice.txt diff --git a/src/ngproc2mod.c b/src/ngproc2mod.c index 4321801bf..e7d2688f1 100644 --- a/src/ngproc2mod.c +++ b/src/ngproc2mod.c @@ -329,3 +329,6 @@ retry: } } } + +void +controlled_exit(int status) { exit(status); } diff --git a/src/ngsconvert.c b/src/ngsconvert.c index b9fb529b5..f8a7a5176 100644 --- a/src/ngsconvert.c +++ b/src/ngsconvert.c @@ -445,6 +445,7 @@ void cp_ccom(wordlist *w, char *b, bool e) { int cp_usrset(struct variable *v, bool i) { NG_IGNORE(i); NG_IGNORE(v); return(US_OK); } +wordlist * cp_doalias(wordlist *wlist) {NG_IGNORE(wlist); return NULL;} int disptype; From a7f63796773530be974839db3c7578968caf6742 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 29 Feb 2020 18:11:03 +0100 Subject: [PATCH 17/19] make declaration inline --- src/frontend/parser/glob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/parser/glob.c b/src/frontend/parser/glob.c index caddc6784..ecdbd2075 100644 --- a/src/frontend/parser/glob.c +++ b/src/frontend/parser/glob.c @@ -66,7 +66,7 @@ static wordlist_l *brac1(size_t offset_ocurl1, const char *p_str_cur); static wordlist_l *brac2(const char *string, size_t *p_n_char_processed); static wordlist *bracexpand(const wordlist *w_exp); -static void merge_home_with_rest(wordlist *wl_node, +static inline void merge_home_with_rest(wordlist *wl_node, size_t n_char_home, const char *sz_home, size_t n_char_skip); static inline void strip_1st_char(wordlist *wl_node); static void tilde_expand_word(wordlist *wl_node); From 262d74bb4d8d4e4d52f91932f3fdc3ccbe57c33d Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 29 Feb 2020 18:13:05 +0100 Subject: [PATCH 18/19] measure compile time elapsed --- compile_linux.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compile_linux.sh b/compile_linux.sh index b9ded540e..093ba3995 100644 --- a/compile_linux.sh +++ b/compile_linux.sh @@ -19,6 +19,8 @@ # Add (optionally) --enable-relpath to avoid absolute paths when searching for code models. # It might be necessary to uncomment and run ./autogen.sh . +SECONDS=0 + if test "$1" = "32"; then if [ ! -d "release32" ]; then mkdir release32 @@ -75,5 +77,8 @@ make install 2>&1 | tee make_install.log exitcode=${PIPESTATUS[0]} if [ $exitcode -ne 0 ]; then echo "make install failed"; exit 1 ; fi +ELAPSED="Elapsed compile time: $(($SECONDS / 3600))hrs $((($SECONDS / 60) % 60))min $(($SECONDS % 60))sec" +echo +echo $ELAPSED echo "success" exit 0 From ab12ad574edf80d65d82b2d625589e93f808eb8b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 2 Mar 2020 18:13:35 +0100 Subject: [PATCH 19/19] remove xgraph in ngspice shared lib --- visualc/sharedspice.vcxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/visualc/sharedspice.vcxproj b/visualc/sharedspice.vcxproj index 212541ec4..65b24589f 100644 --- a/visualc/sharedspice.vcxproj +++ b/visualc/sharedspice.vcxproj @@ -456,7 +456,6 @@ - @@ -1062,7 +1061,6 @@ -