Browse Source

various bug fixes

pre-master-46
h_vogt 16 years ago
parent
commit
76feebbbfa
  1. 10
      ChangeLog
  2. 1
      src/frontend/inp.c
  3. 14
      src/frontend/inpcom.c
  4. 104
      src/frontend/numparam/general.h
  5. 1033
      src/frontend/numparam/mystring.c
  6. 25
      src/frontend/numparam/numparam.h
  7. 513
      src/frontend/numparam/spicenum.c
  8. 802
      src/frontend/numparam/xpressn.c
  9. 11
      src/frontend/subckt.c
  10. 1
      src/include/Makefile.am
  11. 1
      src/include/inpptree.h
  12. 1
      src/misc/Makefile.am
  13. 19
      src/spicelib/parser/ifeval.c
  14. 93
      src/spicelib/parser/inpptree.c
  15. 8
      visualc/vngspice.sln
  16. 254
      visualc/vngspice.vcproj

10
ChangeLog

@ -1,3 +1,13 @@
2010-02-25 Holger Vogt
* inpcom.c, general.h, mystring.c, numparam.h, spicenum.c, xpressn.c,
include/makefile.am, misc/makefile.am, hash.c, hash.h:
major bug-fix on numparam by Bill Swartz
* subckt.c: bugfix on bxx_printf()
* inp.c memory leak, line 707 wl_free(wl); added
* ifeval.c, inpptree.c, inpptree.h: first try of ternary fcn in B source
by Robert Larice
* vngspice.sln, vngspice.vcproj: new files hash.c, .h added to project
2010-02-22 Dietmar Warning 2010-02-22 Dietmar Warning
* xpressn.c, spicenum.c: more characters for real number insertion (up to 15) by * xpressn.c, spicenum.c: more characters for real number insertion (up to 15) by
introducing a long long placeholder introducing a long long placeholder

1
src/frontend/inp.c

@ -704,6 +704,7 @@ inp_dodeck(
eev->va_next = cp_setparse(wl); eev->va_next = cp_setparse(wl);
else else
ct->ci_vars = eev = cp_setparse(wl); ct->ci_vars = eev = cp_setparse(wl);
wl_free(wl);
while (eev->va_next) while (eev->va_next)
eev = eev->va_next; eev = eev->va_next;
} }

14
src/frontend/inpcom.c

@ -1786,7 +1786,7 @@ inp_fix_subckt( char *s )
head = alloc(struct line); head = alloc(struct line);
/* create list of parameters that need to get sorted */ /* create list of parameters that need to get sorted */
while ( ( ptr1 = strstr( beg, "=" ) ) ) {
while ( *beg && (ptr1 = strstr( beg, "=" ) ) ) {
ptr2 = ptr1+1; ptr2 = ptr1+1;
ptr1--; ptr1--;
while ( isspace(*ptr1) ) ptr1--; while ( isspace(*ptr1) ) ptr1--;
@ -1797,8 +1797,16 @@ inp_fix_subckt( char *s )
while ( *ptr2 && !isspace(*ptr2) ) ptr2++; /* ptr2 points to end of parameter */ while ( *ptr2 && !isspace(*ptr2) ) ptr2++; /* ptr2 points to end of parameter */
keep = *ptr2; keep = *ptr2;
*ptr2 = '\0';
beg = ptr2+1;
if( keep == '\0' ){
/* End of string - don't go over end. This needed to change because
* strings don't store line size here anymore since we use dynamic
* strings. Previously, we could step on string size which was stored
* at string[length+2] and string[length+2] */
beg = ptr2 ;
} else {
*ptr2 = '\0' ;
beg = ptr2+1 ;
}
newcard = alloc(struct line); newcard = alloc(struct line);
str = strdup(ptr1); str = strdup(ptr1);

104
src/frontend/numparam/general.h

@ -9,40 +9,39 @@
#define Use(x) x=0;x=x #define Use(x) x=0;x=x
#define Uses(s) s=s #define Uses(s) s=s
#define Usep(x) x=x #define Usep(x) x=x
#define Hi(x) (((x) >> 8) & 0xff)
#define Lo(x) ((x) & 0xff)
//#define Strbig(n,a) char a[n+4]={0, (char)Hi(n), (char)Lo(n)}
#define Strbig(n,a) char*(a)=(char*)tmalloc((n+4)*sizeof(char)); \
(a)[0]=0; (a)[1]=(char)Hi(n); (a)[2]=(char)Lo(n)
#define Strdbig(n,a,b) char*(a); char*(b); \
(a)=(char*)tmalloc((n+4)*sizeof(char)); \
(a)[0]=0; (a)[1]=(char)Hi(n); (a)[2]=(char)Lo(n);\
(b)=(char*)tmalloc((n+4)*sizeof(char)); \
(b)[0]=0; (b)[1]=(char)Hi(n); (b)[2]=(char)Lo(n)
/* -----------------------------------------------------------------
* This structure is modified from Tcl. We do this to avoid a
* conflict and later add a conditional compile to just use the Tcl
* code if desired.
----------------------------------------------------------------- */
#define SPICE_DSTRING_STATIC_SIZE 200
typedef struct spice_dstring {
char *string ; /* Points to beginning of string: either
* staticSpace below or a malloced array. */
int length ; /* Number of non-NULL characters in the
* string. */
int spaceAvl ; /* Total number of bytes available for the
* string and its terminating NULL char. */
char staticSpace[SPICE_DSTRING_STATIC_SIZE] ;
/* Space to use in common case where string
* is small. */
} SPICE_DSTRING, *SPICE_DSTRINGPTR ;
#define Strfbig(n,a,b,c,d) char*(a); char*(b); char*(c); char*(d);\
(a)=(char*)tmalloc((n+4)*sizeof(char)); \
(a)[0]=0; (a)[1]=(char)Hi(n); (a)[2]=(char)Lo(n);\
(b)=(char*)tmalloc((n+4)*sizeof(char)); \
(b)[0]=0; (b)[1]=(char)Hi(n); (b)[2]=(char)Lo(n);\
(c)=(char*)tmalloc((n+4)*sizeof(char)); \
(c)[0]=0; (c)[1]=(char)Hi(n); (c)[2]=(char)Lo(n);\
(d)=(char*)tmalloc((n+4)*sizeof(char)); \
(d)[0]=0; (d)[1]=(char)Hi(n); (d)[2]=(char)Lo(n)
/* -----------------------------------------------------------------
* spice_dstring_xxxx routines. Used to manipulate dynamic strings.
----------------------------------------------------------------- */
extern void spice_dstring_init(SPICE_DSTRINGPTR dsPtr) ;
extern char *spice_dstring_append(SPICE_DSTRINGPTR dsPtr,char *string,int length) ;
extern char *spice_dstring_print(SPICE_DSTRINGPTR dsPtr,char *format, ... ) ;
extern char *spice_dstring_setlength(SPICE_DSTRINGPTR dsPtr,int length) ;
extern char *_spice_dstring_setlength(SPICE_DSTRINGPTR dsPtr,int length) ;
extern void spice_dstring_free(SPICE_DSTRINGPTR dsPtr) ;
#define spice_dstring_reinit(x_xz) spice_dstring_setlength(x_xz,0) ;
#define spice_dstring_value(x_xz) ((x_xz)->string)
#define spice_dstring_space(x_xz) ((x_xz)->spaceAvl)
#define spice_dstring_length(x_xz) ((x_xz)->length)
#define Strrem(a) tfree(a)
#define Strdrem(a,b) tfree(a); tfree(b)
#define Strfrem(a,b,c,d) tfree(a); tfree(b); tfree(c); tfree(d)
#define Str(n,a) char a[n+3]={0,0,(char)n} /* n<255 ! */
#define Sini(s) sini(s,sizeof(s)-4)
/* was 255, then 15000, string maxlen, 40000 to catch really big
macros in .model lines, now just a big number, a line length
which never should be exceeded, may be removed later*/
typedef enum {Maxstr=4000000} _nMaxstr;
typedef enum {Esc=27} _nEsc; typedef enum {Esc=27} _nEsc;
typedef enum {Tab=9} _nTab; typedef enum {Tab=9} _nTab;
typedef enum {Bs=8} _nBs; typedef enum {Bs=8} _nBs;
@ -52,22 +51,22 @@ typedef enum {Cr=13} _nCr;
typedef char string[258]; typedef char string[258];
void sini( char * s, int i);
void sfix(char * s, int i, int max);
int maxlen(char * s);
char * pscopy( char * s, char * a, int i,int j);
char * pscopy_up( char * s, char * a, int i,int j);
unsigned char scopy( char * a, char * b);
unsigned char scopy_up( char * a, char * b);
unsigned char ccopy( char * a, char c);
unsigned char sadd( char * s, char * t);
unsigned char nadd( char * s, long n);
unsigned char naddll( char * s, long long n);
unsigned char cadd( char * s, char c);
unsigned char sins( char * s, char * t);
unsigned char cins( char * s, char c);
int cpos( char c, char * s);
int spos( char * sub, char * s);
void sfix( SPICE_DSTRINGPTR dstr_p, int len) ;
char * pscopy( SPICE_DSTRINGPTR s, char * a, int i,int j);
char * pscopy_up( SPICE_DSTRINGPTR s, char * a, int i,int j);
unsigned char scopyd( SPICE_DSTRINGPTR a, SPICE_DSTRINGPTR b);
unsigned char scopys( SPICE_DSTRINGPTR a, char *b);
unsigned char scopy_up( SPICE_DSTRINGPTR a, char *str) ;
unsigned char scopy_lower( SPICE_DSTRINGPTR a, char *str) ;
unsigned char ccopy( SPICE_DSTRINGPTR a, char c);
unsigned char sadd( SPICE_DSTRINGPTR s, char * t);
unsigned char nadd( SPICE_DSTRINGPTR s, long n);
unsigned char cadd( SPICE_DSTRINGPTR s, char c);
unsigned char naddll( SPICE_DSTRINGPTR s, long long n);
unsigned char cins( SPICE_DSTRINGPTR s, char c);
unsigned char sins( SPICE_DSTRINGPTR s, char * t);
int cpos( char c, char *s);
int spos_( char * sub, char * s);
int ci_prefix( register char *p, register char *s ); int ci_prefix( register char *p, register char *s );
int length(char * s); int length(char * s);
unsigned char steq(char * s, char * t); unsigned char steq(char * s, char * t);
@ -76,9 +75,9 @@ int scompare(char * a, char * b);
int ord(char c); int ord(char c);
int pred(int i); int pred(int i);
int succ(int i); int succ(int i);
void stri(long n, char * s);
void strif(long n, int f, char * s);
void strf(double x, int a, int b, char * s); /* float -> string */
void stri(long n, SPICE_DSTRINGPTR s);
void strif(long n, int f, SPICE_DSTRINGPTR dstr_p);
void strf(double x, int a, int b, SPICE_DSTRINGPTR dstr_p); /* float -> string */
long ival(char * s, int *err); long ival(char * s, int *err);
double rval(char * s, int *err); double rval(char * s, int *err);
@ -97,10 +96,10 @@ void wc(char c);
void wln(void); void wln(void);
void ws( char * s); void ws( char * s);
void wi(long i); void wi(long i);
void rs( char * s);
void rs( SPICE_DSTRINGPTR s);
char rc(void); char rc(void);
int freadstr(FILE * f, char * s, int max);
int freadstr(FILE * f, SPICE_DSTRINGPTR dstr_p);
char freadc(FILE * f); char freadc(FILE * f);
long freadi(FILE * f); long freadi(FILE * f);
@ -116,4 +115,3 @@ unsigned char rewrite(FILE * f);
void rawcopy(void * a, void * b, int la, int lb); void rawcopy(void * a, void * b, int la, int lb);
void * new(long sz); void * new(long sz);
void dispose(void * p); void dispose(void * p);
char * newstring(int n);

1033
src/frontend/numparam/mystring.c
File diff suppressed because it is too large
View File

25
src/frontend/numparam/numparam.h

@ -6,6 +6,7 @@
/*** interface to spice frontend subckt.c ***/ /*** interface to spice frontend subckt.c ***/
#include "numpaif.h" #include "numpaif.h"
#include "hash.h"
/***** numparam internals ********/ /***** numparam internals ********/
@ -27,8 +28,6 @@ typedef enum {Defd=15} _nDefd; /* serial numb. of 'defined' keyword. The others
macros in .model lines. Will add 100k of memory compared to previous 25004*/ macros in .model lines. Will add 100k of memory compared to previous 25004*/
//typedef enum {Llen=40000} _nLlen; //typedef enum {Llen=40000} _nLlen;
typedef char str50 [54];
typedef char str80 [84];
//typedef enum {Maxline=70000} _nMaxline; /* Size of initial unexpanded circuit code */ //typedef enum {Maxline=70000} _nMaxline; /* Size of initial unexpanded circuit code */
//typedef enum {Maxckt=40000} _nMaxckt; /* Size of expanded circuit code */ //typedef enum {Maxckt=40000} _nMaxckt; /* Size of expanded circuit code */
@ -36,13 +35,17 @@ typedef char str80 [84];
typedef char * auxtable; /* dummy */ typedef char * auxtable; /* dummy */
/* -----------------------------------------------------------------
* I believe the entry should be a union of type but I need more info.
* ----------------------------------------------------------------- */
typedef struct _tentry { typedef struct _tentry {
char tp; /* type: I)nt R)eal S)tring F)unction M)acro P)ointer */ char tp; /* type: I)nt R)eal S)tring F)unction M)acro P)ointer */
char nom[100];
char *symbol ;
int level; /* subckt nesting level */ int level; /* subckt nesting level */
double vl; /* float value if defined */ double vl; /* float value if defined */
unsigned short ivl; /*int value or string buffer index*/ unsigned short ivl; /*int value or string buffer index*/
char * sbbase; /* string buffer base address if any */ char * sbbase; /* string buffer base address if any */
struct _tentry *pointer ; /* pointer chain */
} entry; } entry;
typedef struct _tfumas { /*function,macro,string*/ typedef struct _tfumas { /*function,macro,string*/
@ -51,19 +54,21 @@ typedef struct _tfumas { /*function,macro,string*/
typedef struct _ttdico { typedef struct _ttdico {
/* the input scanner data structure */ /* the input scanner data structure */
str80 srcfile; /* last piece of source file name */
SPICE_DSTRING srcfile; /* last piece of source file name */
SPICE_DSTRING option; /* one-character translator options */
SPICE_DSTRING lookup_buf ; /* useful temp buffer for quick symbol lookup */
int srcline; int srcline;
int oldline; int oldline;
int errcount; int errcount;
// entry dat[Maxdico+1];
entry* dyndat;
int nbd; /* number of data entries */
int num_symbols ; /* number of symbols in entry array */
entry **symbol_array ; /* symbol entries in array format for stack ops */
NGHASHPTR symbol_table ; /* hash table of symbols for quick lookup */
int nbd; /* number of data entries */
fumas fms[101]; fumas fms[101];
int nfms; /* number of functions & macros */ int nfms; /* number of functions & macros */
int stack[20]; int stack[20];
char *inst_name[20]; char *inst_name[20];
int tos; /* top of stack index for symbol mark/release mechanics */ int tos; /* top of stack index for symbol mark/release mechanics */
str80 option; /* one-character translator options */
auxtable nodetab; auxtable nodetab;
// char * refptr[Maxline]; /* pointers to source code lines */ // char * refptr[Maxline]; /* pointers to source code lines */
char **dynrefptr; char **dynrefptr;
@ -75,11 +80,11 @@ typedef struct _ttdico {
void initdico(tdico * dico); void initdico(tdico * dico);
int donedico(tdico * dico); int donedico(tdico * dico);
unsigned char defsubckt( tdico *dico, char * s, int w, char categ); unsigned char defsubckt( tdico *dico, char * s, int w, char categ);
int findsubckt( tdico *dico, char * s, char * subname);
int findsubckt( tdico *dico, char * s, SPICE_DSTRINGPTR subname);
unsigned char nupa_substitute( tdico *dico, char * s, char * r, unsigned char err); unsigned char nupa_substitute( tdico *dico, char * s, char * r, unsigned char err);
unsigned char nupa_assignment( tdico *dico, char * s, char mode); unsigned char nupa_assignment( tdico *dico, char * s, char mode);
unsigned char nupa_subcktcall( tdico *dico, char * s, char * x, unsigned char err); unsigned char nupa_subcktcall( tdico *dico, char * s, char * x, unsigned char err);
void nupa_subcktexit( tdico *dico); void nupa_subcktexit( tdico *dico);
tdico * nupa_fetchinstance(void); tdico * nupa_fetchinstance(void);
char getidtype( tdico *d, char * s); char getidtype( tdico *d, char * s);
int attrib( tdico *dico, char * t, char op );
entry *attrib( tdico *dico, char * t, char op );

513
src/frontend/numparam/spicenum.c

@ -32,7 +32,7 @@ Todo:
extern void txfree (void *ptr); extern void txfree (void *ptr);
char *nupa_inst_name; char *nupa_inst_name;
static tdico *inst_dico;
static tdico *inst_dicoS ;
/* number of parameter substitutions, available only after the substitution */ /* number of parameter substitutions, available only after the substitution */
extern long dynsubst; /* spicenum.c:144 */ extern long dynsubst; /* spicenum.c:144 */
@ -41,7 +41,7 @@ extern long dynsubst; /* spicenum.c:144 */
extern int dynmaxline; /* inpcom.c:1529 */ extern int dynmaxline; /* inpcom.c:1529 */
/* max. line length in input deck */ /* max. line length in input deck */
unsigned int dynLlen; /* inpcom.c:1531 */
/* unsigned int dynLlen; No longer needed with d strings */ /* inpcom.c:1531 */
/* Uncomment this line to allow debug tracing */ /* Uncomment this line to allow debug tracing */
/* #define TRACE_NUMPARAMS */ /* #define TRACE_NUMPARAMS */
@ -71,34 +71,43 @@ static long placeholder = 0;
static void static void
stripsomespace (char *s, unsigned char incontrol)
stripsomespace (SPICE_DSTRINGPTR dstr_p, unsigned char incontrol)
{ {
/* if s starts with one of some markers, strip leading space */ /* if s starts with one of some markers, strip leading space */
Str (12, markers);
int i, ls; int i, ls;
scopy (markers, "*.&+#$");
char *sstr ; /* string contained in s */
SPICE_DSTRING markers ;
spice_dstring_init( &markers ) ;
scopys( &markers, "*.&+#$") ;
if (!incontrol) if (!incontrol)
sadd (markers, "xX");
sadd ( &markers, "xX");
ls = length (s);
sstr = spice_dstring_value(dstr_p) ;
ls = spice_dstring_length (dstr_p);
i = 0; i = 0;
while ((i < ls) && (s[i] <= ' '))
while ((i < ls) && (sstr[i] <= ' '))
i++; i++;
if ((i > 0) && (i < ls) && (cpos (s[i], markers) > 0))
pscopy (s, s, i + 1, ls);
if ((i > 0) && (i < ls) && (cpos (sstr[i], spice_dstring_value(&markers)) >= 0))
pscopy (dstr_p, sstr, i, ls);
} }
static int static int
stripbraces (char *s)
stripbraces (SPICE_DSTRINGPTR dstr_p)
/* puts the funny placeholders. returns the number of {...} substitutions */ /* puts the funny placeholders. returns the number of {...} substitutions */
{ {
int n, i, nest, ls, j; int n, i, nest, ls, j;
Strbig (dynLlen, t);
char *s ; /* value of dynamic string */
char *t_p ; /* value of t dynamic string */
SPICE_DSTRING tstr ; /* temporary dynamic string */
n = 0; n = 0;
ls = length (s);
spice_dstring_init( &tstr ) ;
s = spice_dstring_value( dstr_p ) ;
ls = spice_dstring_length (dstr_p);
i = 0; i = 0;
while (i < ls) while (i < ls)
@ -117,47 +126,54 @@ stripbraces (char *s)
nest--; nest--;
j++; j++;
} }
pscopy (t, s, 1, i);
pscopy (&tstr, s, 0, i);
placeholder++; placeholder++;
if (t[i - 1] > ' ')
cadd (t, ' ');
t_p = spice_dstring_value(&tstr) ;
cadd (t, ' ');
naddll (t, PlaceHold + placeholder); /* placeholder has 15 digits */
cadd (t, ' ');
if (t_p[i - 1] > ' ')
cadd (&tstr, ' ');
if (s[j] >= ' ')
cadd (t, ' ');
cadd ( &tstr, ' ');
naddll( &tstr, PlaceHold + placeholder); /* placeholder has 15 digits */
cadd ( &tstr, ' ');
i = length (t);
pscopy (s, s, j + 1, ls);
sadd (t, s);
scopy (s, t);
if (s[j] >= ' ')
cadd ( &tstr, ' ');
i = spice_dstring_length (&tstr);
pscopy (dstr_p, s, j, ls);
sadd ( &tstr, s);
scopyd ( dstr_p, &tstr);
s = spice_dstring_value( dstr_p ) ;
ls = spice_dstring_length( dstr_p ) ;
} }
else else
i++; i++;
ls = length (s);
} }
dynsubst = placeholder; dynsubst = placeholder;
Strrem(t);
spice_dstring_free(&tstr);
return n; return n;
} }
static int static int
findsubname (tdico * dico, char *s)
findsubname (tdico * dico, SPICE_DSTRINGPTR dstr_p)
/* truncate the parameterized subckt call to regular old Spice */ /* truncate the parameterized subckt call to regular old Spice */
/* scan a string from the end, skipping non-idents and {expressions} */ /* scan a string from the end, skipping non-idents and {expressions} */
/* then truncate s after the last subckt(?) identifier */ /* then truncate s after the last subckt(?) identifier */
{ {
Str (80, name);
SPICE_DSTRING name ; /* extract a name */
char *s ; /* current dstring */
int h, j, k, nest, ls; int h, j, k, nest, ls;
unsigned char found; unsigned char found;
h = 0; h = 0;
ls = length (s);
k = ls;
ls = spice_dstring_length (dstr_p) ;
s = spice_dstring_value (dstr_p) ;
k = ls - 1 ; /* now a C - string */
found = 0; found = 0;
spice_dstring_init( &name ) ;
while ((k >= 0) && (!found)) while ((k >= 0) && (!found))
{ /* skip space, then non-space */ { /* skip space, then non-space */
@ -191,32 +207,37 @@ findsubname (tdico * dico, char *s)
found = (k >= 0) && alfanum (s[k + 1]); /* suppose an identifier */ found = (k >= 0) && alfanum (s[k + 1]); /* suppose an identifier */
if (found) if (found)
{ /* check for known subckt name */ { /* check for known subckt name */
scopy (name, "");
spice_dstring_reinit( &name ) ;
j = k + 1; j = k + 1;
while (alfanum (s[j])) while (alfanum (s[j]))
{ {
cadd (name, upcase (s[j]));
cadd ( &name, upcase (s[j]));
j++; j++;
} }
found = (getidtype (dico, name) == 'U');
found = (getidtype (dico, spice_dstring_value(&name) ) == 'U');
} }
} }
if (found && (h < ls)) if (found && (h < ls))
pscopy (s, s, 1, h);
pscopy (dstr_p, s, 0, h);
return h; return h;
} }
static void static void
modernizeex (char *s)
modernizeex (SPICE_DSTRINGPTR dstr_p)
/* old style expressions &(..) and &id --> new style with braces. */ /* old style expressions &(..) and &id --> new style with braces. */
{ {
int i, state, ls; int i, state, ls;
char c, d; char c, d;
Strbig (dynLlen, t);
char *s ; /* current string */
SPICE_DSTRING t ; /* temporary dyna string */
i = 0; i = 0;
state = 0; state = 0;
ls = length (s);
ls = spice_dstring_length (dstr_p);
s = spice_dstring_value( dstr_p ) ;
spice_dstring_init( &t ) ;
while (i < ls) while (i < ls)
{ {
@ -232,11 +253,11 @@ modernizeex (char *s)
} }
else if (alfa (d)) else if (alfa (d))
{ {
cadd (t, '{');
cadd (&t, '{');
i++; i++;
while (alfanum (s[i])) while (alfanum (s[i]))
{ {
cadd (t, s[i]);
cadd (&t, s[i]);
i++; i++;
} }
c = '}'; c = '}';
@ -255,15 +276,16 @@ modernizeex (char *s)
} }
cadd (t, c);
cadd (&t, c);
i++; i++;
} }
scopy (s, t);
Strrem(t);
scopyd (dstr_p, &t);
spice_dstring_free(&t) ;
} }
static char static char
transform (tdico * dico, char *s, unsigned char nostripping, char *u)
transform (tdico * dico, SPICE_DSTRINGPTR dstr_p, unsigned char nostripping,
SPICE_DSTRINGPTR u_p)
/* line s is categorized and crippled down to basic Spice /* line s is categorized and crippled down to basic Spice
* returns in u control word following dot, if any * returns in u control word following dot, if any
* *
@ -288,21 +310,27 @@ transform (tdico * dico, char *s, unsigned char nostripping, char *u)
* 'B' netlist (or .model ?) line that had Braces killed * 'B' netlist (or .model ?) line that had Braces killed
*/ */
{ {
char category;
int i, k, a, n; int i, k, a, n;
Strbig (dynLlen, t);
stripsomespace (s, nostripping);
modernizeex (s); /* required for stripbraces count */
scopy (u, "");
char *s ; /* dstring value of dstr_p */
char *t ; /* dstring value of tstr */
char category;
SPICE_DSTRING tstr ; /* temporary string */
spice_dstring_init(&tstr) ;
spice_dstring_reinit(u_p) ;
stripsomespace (dstr_p, nostripping);
modernizeex (dstr_p); /* required for stripbraces count */
s = spice_dstring_value(dstr_p) ;
if (s[0] == '.') if (s[0] == '.')
{ /* check Pspice parameter format */ { /* check Pspice parameter format */
scopy_up (t, s);
scopy_up (&tstr, spice_dstring_value(dstr_p) ) ;
k = 1; k = 1;
t = spice_dstring_value(&tstr) ;
while (t[k] > ' ') while (t[k] > ' ')
{ {
cadd (u, t[k]);
cadd (u_p, t[k]);
k++; k++;
} }
@ -313,9 +341,9 @@ transform (tdico * dico, char *s, unsigned char nostripping, char *u)
} }
else if (ci_prefix (".SUBCKT", t) == 1) else if (ci_prefix (".SUBCKT", t) == 1)
{ /* split off any "params" tail */ { /* split off any "params" tail */
a = spos ("PARAMS:", t);
if (a > 0)
pscopy (s, s, 1, a - 1);
a = spos_ ("PARAMS:", t);
if (a >= 0)
pscopy (dstr_p, s, 0, a );
category = 'S'; category = 'S';
} }
else if (ci_prefix (".CONTROL", t) == 1) else if (ci_prefix (".CONTROL", t) == 1)
@ -327,7 +355,7 @@ transform (tdico * dico, char *s, unsigned char nostripping, char *u)
else else
{ {
category = '.'; category = '.';
n = stripbraces (s);
n = stripbraces (dstr_p);
if (n > 0) if (n > 0)
category = 'B'; /* priority category ! */ category = 'B'; /* priority category ! */
} }
@ -339,14 +367,14 @@ transform (tdico * dico, char *s, unsigned char nostripping, char *u)
} }
else if (upcase (s[0]) == 'X') else if (upcase (s[0]) == 'X')
{ /* strip actual parameters */ { /* strip actual parameters */
i = findsubname (dico, s); /* i= index following last identifier in s */
i = findsubname (dico, dstr_p) ; /* i= index following last identifier in s */
category = 'X'; category = 'X';
} }
else if (s[0] == '+') /* continuation line */ else if (s[0] == '+') /* continuation line */
category = '+'; category = '+';
else if (cpos (s[0], "*$#") <= 0)
else if (cpos (s[0], "*$#") < 0)
{ /* not a comment line! */ { /* not a comment line! */
n = stripbraces (s);
n = stripbraces (dstr_p);
if (n > 0) if (n > 0)
category = 'B'; /* line that uses braces */ category = 'B'; /* line that uses braces */
else else
@ -355,7 +383,7 @@ transform (tdico * dico, char *s, unsigned char nostripping, char *u)
else else
category = '*'; category = '*';
Strrem(t);
spice_dstring_free(&tstr) ;
return category; return category;
} }
@ -363,21 +391,21 @@ transform (tdico * dico, char *s, unsigned char nostripping, char *u)
/* some day, all these nasty globals will go into the tdico structure /* some day, all these nasty globals will go into the tdico structure
and everything will get hidden behind some "handle" ... and everything will get hidden behind some "handle" ...
For the time being we will rename this variable to end in S so we know
they are statics within this file for easier reading of the code.
*/ */
static int linecount = 0; /* global: number of lines received via nupa_copy */
static int evalcount = 0; /* number of lines through nupa_eval() */
static int nblog = 0; /* serial number of (debug) logfile */
static unsigned char inexpansion = 0; /* flag subckt expansion phase */
static unsigned char incontrol = 0; /* flag control code sections */
static unsigned char dologfile = 0; /* for debugging */
static unsigned char firstsignal = 1;
static FILE *logfile = NULL;
static tdico *dico = NULL;
static int linecountS = 0; /* global: number of lines received via nupa_copy */
static int evalcountS = 0; /* number of lines through nupa_eval() */
static int nblogS = 0; /* serial number of (debug) logfile */
static unsigned char inexpansionS = 0; /* flag subckt expansion phase */
static unsigned char incontrolS = 0; /* flag control code sections */
static unsigned char dologfileS = 0; /* for debugging */
static unsigned char firstsignalS = 1;
static FILE *logfileS = NULL;
static tdico *dicoS = NULL;
/* already part of dico : */ /* already part of dico : */
/* Str(80, srcfile); source file */
/* /*
Open ouput to a log file. Open ouput to a log file.
takes no action if logging is disabled. takes no action if logging is disabled.
@ -386,30 +414,34 @@ static tdico *dico = NULL;
static void static void
putlogfile (char c, int num, char *t) putlogfile (char c, int num, char *t)
{ {
Str (20, fname);
Strbig (dynLlen, u);
if (dologfile)
SPICE_DSTRING fname ; /* file name */
SPICE_DSTRING u ; /* temp dynamic variable */
spice_dstring_init( &fname ) ;
spice_dstring_init( &u ) ;
if (dologfileS)
{ {
if ((logfile == NULL))
if ((logfileS == NULL))
{ {
scopy (fname, "logfile.");
nblog++;
nadd (fname, nblog);
logfile = fopen (fname, "w");
scopys(&fname, "logfile.") ;
nblogS++;
nadd (&fname, nblogS) ;
logfileS = fopen ( spice_dstring_value(&fname), "w");
} }
if ((logfile != NULL))
if ((logfileS != NULL))
{ {
cadd (u, c);
nadd (u, num);
cadd (u, ':');
cadd (u, ' ');
sadd (u, t);
cadd (u, '\n');
fputs (u, logfile);
cadd (&u, c);
nadd (&u, num);
cadd (&u, ':');
cadd (&u, ' ');
sadd (&u, t);
cadd (&u, '\n');
fputs ( spice_dstring_value(&u), logfileS);
} }
} }
Strrem(u);
spice_dstring_free(&u) ;
spice_dstring_free(&fname) ;
} }
static void static void
@ -417,42 +449,44 @@ nupa_init (char *srcfile)
{ {
int i; int i;
/* init the symbol table and so on, before the first nupa_copy. */ /* init the symbol table and so on, before the first nupa_copy. */
evalcount = 0;
linecount = 0;
incontrol = 0;
evalcountS = 0;
linecountS = 0;
incontrolS = 0;
placeholder = 0; placeholder = 0;
dico = (tdico *)new(sizeof(tdico));
inst_dico = (tdico *)new(sizeof(tdico));
initdico (dico);
initdico (inst_dico);
dicoS = (tdico *)new(sizeof(tdico));
inst_dicoS = (tdico *)new(sizeof(tdico));
initdico (dicoS);
initdico (inst_dicoS);
dico->dynrefptr = (char**)tmalloc((dynmaxline + 1)*sizeof(char*));
dico->dyncategory = (char*)tmalloc((dynmaxline + 1)*sizeof(char));
dicoS->dynrefptr = (char**)tmalloc((dynmaxline + 1)*sizeof(char*));
dicoS->dyncategory = (char*)tmalloc((dynmaxline + 1)*sizeof(char));
for (i = 0; i <= dynmaxline; i++) for (i = 0; i <= dynmaxline; i++)
{ {
dico->dynrefptr[i] = NULL;
dico->dyncategory[i] = '?';
dicoS->dynrefptr[i] = NULL;
dicoS->dyncategory[i] = '?';
} }
if (srcfile != NULL) if (srcfile != NULL)
scopy (dico->srcfile, srcfile);
scopys(&dicoS->srcfile, srcfile ) ;
} }
static void static void
nupa_done (void) nupa_done (void)
{ {
/* int i; not needed so far, see below */ /* int i; not needed so far, see below */
Str (80, rep);
char *reply ; /* user reply */
SPICE_DSTRING rep ; /* dynamic report */
int dictsize, nerrors; int dictsize, nerrors;
if (logfile != NULL)
spice_dstring_init(&rep) ;
if (logfileS != NULL)
{ {
fclose (logfile);
logfile = NULL;
fclose (logfileS);
logfileS = NULL;
} }
nerrors = dico->errcount;
dictsize = donedico (dico);
nerrors = dicoS->errcount;
dictsize = donedico (dicoS);
/* We cannot remove dico here because numparam is usedby /* We cannot remove dico here because numparam is usedby
the .measure statement, which is invoked only after the the .measure statement, which is invoked only after the
simulation has finished */ simulation has finished */
@ -472,26 +506,28 @@ nupa_done (void)
if (nerrors) if (nerrors)
{ {
/* debug: ask if spice run really wanted */ /* debug: ask if spice run really wanted */
scopy (rep, " Copies=");
nadd (rep, linecount);
sadd (rep, " Evals=");
nadd (rep, evalcount);
sadd (rep, " Placeholders=");
nadd (rep, placeholder);
sadd (rep, " Symbols=");
nadd (rep, dictsize);
sadd (rep, " Errors=");
nadd (rep, nerrors);
cadd (rep, '\n');
ws (rep);
sadd (&rep, " Copies=");
nadd (&rep, linecountS);
sadd (&rep, " Evals=");
nadd (&rep, evalcountS);
sadd (&rep, " Placeholders=");
nadd (&rep, placeholder);
sadd (&rep, " Symbols=");
nadd (&rep, dictsize);
sadd (&rep, " Errors=");
nadd (&rep, nerrors);
cadd (&rep, '\n');
ws ( spice_dstring_value(&rep) ) ;
ws ("Numparam expansion errors: Run Spice anyway? y/n ? \n"); ws ("Numparam expansion errors: Run Spice anyway? y/n ? \n");
rs (rep);
if (upcase (rep[0]) != 'Y')
spice_dstring_reinit(&rep) ;
rs (&rep);
reply = spice_dstring_value(&rep) ;
if (upcase (reply[0]) != 'Y')
controlled_exit(EXIT_FAILURE); controlled_exit(EXIT_FAILURE);
} }
linecount = 0;
evalcount = 0;
linecountS = 0;
evalcountS = 0;
placeholder = 0; placeholder = 0;
/* release symbol table data */ ; /* release symbol table data */ ;
} }
@ -502,110 +538,126 @@ nupa_scan (char *s, int linenum, int is_subckt)
{ {
if (is_subckt) if (is_subckt)
defsubckt (dico, s, linenum, 'U');
defsubckt (dicoS, s, linenum, 'U');
else else
defsubckt (dico, s, linenum, 'O');
}
defsubckt (dicoS, s, linenum, 'O');
static char *
lower_str (char *str)
{
char *s;
for (s = str; *s; s++)
*s = tolower (*s);
return str;
}
static char *
upper_str (char *str)
{
char *s;
for (s = str; *s; s++)
*s = toupper (*s);
return str;
} }
/* -----------------------------------------------------------------
* Dump the contents of the symbol table.
* ----------------------------------------------------------------- */
void void
nupa_list_params (FILE * cp_out) nupa_list_params (FILE * cp_out)
{ {
char *name;
int i;
char *name; /* current symbol */
entry *entry_p ; /* current entry */
tdico *dico_p ; /* local copy for speed */
NGHASHITER iter ; /* hash iterator - thread safe */
dico_p = dicoS ;
fprintf (cp_out, "\n\n"); fprintf (cp_out, "\n\n");
for (i = 1; i <= dico->nbd; i++)
for (entry_p = nghash_enumerateRE(dico_p->symbol_table,NGHASH_FIRST(&iter)) ;
entry_p ;
entry_p = nghash_enumerateRE(dico_p->symbol_table,&iter))
{ {
if (dico->dyndat[i].tp == 'R')
if (entry_p->tp == 'R')
{ {
name = lower_str (strdup (dico->dyndat[i].nom));
fprintf (cp_out, " ---> %s = %g\n", name, dico->dyndat[i].vl);
txfree (name);
spice_dstring_reinit( & dico_p->lookup_buf ) ;
scopy_lower( & dico_p->lookup_buf, entry_p->symbol ) ;
name = spice_dstring_value( & dico_p->lookup_buf ) ;
fprintf (cp_out, " ---> %s = %g\n", name, entry_p->vl) ;
spice_dstring_free( & dico_p->lookup_buf ) ;
} }
} }
} }
/* -----------------------------------------------------------------
* Lookup a parameter value in the symbol table.
* ----------------------------------------------------------------- */
double double
nupa_get_param (char *param_name, int *found) nupa_get_param (char *param_name, int *found)
{ {
char *name = upper_str (strdup (param_name));
double result = 0;
int i;
char *up_name; /* current parameter upper case */
entry *entry_p ; /* current entry */
tdico *dico_p ; /* local copy for speed */
double result = 0; /* parameter value */
*found = 0;
dico_p = dicoS ;
spice_dstring_reinit( & dico_p->lookup_buf ) ;
scopy_up( & dico_p->lookup_buf, param_name ) ;
up_name = spice_dstring_value( & dico_p->lookup_buf ) ;
for (i = 1; i <= dico->nbd + 1; i++)
{
if (strcmp (dico->dyndat[i].nom, name) == 0)
{
result = dico->dyndat[i].vl;
*found = 1;
break;
}
*found = 0;
entry_p = nghash_find( dico_p->symbol_table, up_name ) ;
if( entry_p ){
result = entry_p->vl ;
*found = 1;
} }
txfree (name);
spice_dstring_free( & dico_p->lookup_buf ) ;
return result; return result;
} }
void void
nupa_add_param (char *param_name, double value) nupa_add_param (char *param_name, double value)
{ {
char *up_name = upper_str (strdup (param_name));
int i = attrib (dico, up_name, 'N');
dico->dyndat[i].vl = value;
dico->dyndat[i].tp = 'R';
dico->dyndat[i].ivl = 0;
dico->dyndat[i].sbbase = NULL;
txfree (up_name);
char *up_name; /* current parameter upper case */
entry *entry_p ; /* current entry */
tdico *dico_p ; /* local copy for speed */
dico_p = dicoS ;
/* -----------------------------------------------------------------
* We use a dynamic string here because most of the time we will
* be using short names and no memory allocation will occur.
* ----------------------------------------------------------------- */
spice_dstring_reinit( & dico_p->lookup_buf ) ;
scopy_up( & dico_p->lookup_buf, param_name ) ;
up_name = spice_dstring_value( & dico_p->lookup_buf ) ;
entry_p = attrib (dicoS, up_name, 'N');
if( entry_p ){
entry_p->vl = value;
entry_p->tp = 'R';
entry_p->ivl = 0;
entry_p->sbbase = NULL;
}
spice_dstring_free( & dico_p->lookup_buf ) ;
} }
void void
nupa_add_inst_param (char *param_name, double value) nupa_add_inst_param (char *param_name, double value)
{ {
char *up_name = upper_str (strdup (param_name));
int i = attrib (inst_dico, up_name, 'N');
inst_dico->dyndat[i].vl = value;
inst_dico->dyndat[i].tp = 'R';
inst_dico->dyndat[i].ivl = 0;
inst_dico->dyndat[i].sbbase = NULL;
txfree (up_name);
char *up_name; /* current parameter upper case */
entry *entry_p ; /* current entry */
tdico *dico_p ; /* local copy for speed */
dico_p = inst_dicoS ;
spice_dstring_reinit( & dico_p->lookup_buf ) ;
scopy_up( & dico_p->lookup_buf, param_name ) ;
up_name = spice_dstring_value( & dico_p->lookup_buf ) ;
entry_p = attrib (dicoS, up_name, 'N');
if( entry_p ){
entry_p->vl = value;
entry_p->tp = 'R';
entry_p->ivl = 0;
entry_p->sbbase = NULL;
}
spice_dstring_free( & dico_p->lookup_buf ) ;
} }
void void
nupa_copy_inst_dico () nupa_copy_inst_dico ()
{ {
int i;
for (i = 1; i <= inst_dico->nbd; i++)
nupa_add_param (inst_dico->dyndat[i].nom, inst_dico->dyndat[i].vl);
tdico *idico_p ; /* local copy for speed */
entry *entry_p ; /* current entry */
NGHASHITER iter ; /* hash iterator - thread safe */
idico_p = inst_dicoS ;
for (entry_p = nghash_enumerateRE(idico_p->symbol_table,NGHASH_FIRST(&iter)) ;
entry_p ;
entry_p = nghash_enumerateRE(idico_p->symbol_table,&iter))
nupa_add_param ( entry_p->symbol, entry_p->vl) ;
} }
char * char *
@ -626,39 +678,43 @@ nupa_copy (char *s, int linenum)
char *t; char *t;
int ls; int ls;
char c, d; char c, d;
Strdbig (dynLlen, u, keywd);
SPICE_DSTRING u ;
SPICE_DSTRING keywd ;
spice_dstring_init(&u) ;
spice_dstring_init(&keywd) ;
ls = length (s); ls = length (s);
while ((ls > 0) && (s[ls - 1] <= ' ')) while ((ls > 0) && (s[ls - 1] <= ' '))
ls--; ls--;
pscopy (u, s, 1, ls); /* strip trailing space, CrLf and so on */
dico->srcline = linenum;
pscopy (&u, s, 0, ls); /* strip trailing space, CrLf and so on */
dicoS->srcline = linenum;
if ((!inexpansion) && (linenum >= 0) && (linenum <= dynmaxline))
if ((!inexpansionS) && (linenum >= 0) && (linenum <= dynmaxline))
{ {
linecount++;
dico->dynrefptr[linenum] = s;
c = transform (dico, u, incontrol, keywd);
linecountS++;
dicoS->dynrefptr[linenum] = s;
c = transform (dicoS, &u, incontrolS, &keywd);
if (c == 'C') if (c == 'C')
incontrol = 1;
incontrolS = 1;
else if (c == 'E') else if (c == 'E')
incontrol = 0;
incontrolS = 0;
if (incontrol)
if (incontrolS)
c = 'C'; /* force it */ c = 'C'; /* force it */
d = dico->dyncategory[linenum]; /* warning if already some strategic line! */
d = dicoS->dyncategory[linenum]; /* warning if already some strategic line! */
if ((d == 'P') || (d == 'S') || (d == 'X')) if ((d == 'P') || (d == 'S') || (d == 'X'))
fprintf (stderr, fprintf (stderr,
" Numparam warning: overwriting P,S or X line (linenum == %d).\n", " Numparam warning: overwriting P,S or X line (linenum == %d).\n",
linenum); linenum);
dico->dyncategory[linenum] = c;
dicoS->dyncategory[linenum] = c;
} /* keep a local copy and mangle the string */ } /* keep a local copy and mangle the string */
ls = length (u);
t = strdup (u);
ls = spice_dstring_length (&u);
t = strdup ( spice_dstring_value(&u) );
if (t == NULL) if (t == NULL)
{ {
@ -667,12 +723,12 @@ nupa_copy (char *s, int linenum)
} }
else else
{ {
if (!inexpansion)
if (!inexpansionS)
{ {
putlogfile (dico->dyncategory[linenum], linenum, t);
putlogfile (dicoS->dyncategory[linenum], linenum, t);
}; };
} }
Strdrem(u, keywd);
spice_dstring_free(&u) ;
return t; return t;
} }
@ -688,12 +744,13 @@ nupa_eval (char *s, int linenum, int orig_linenum)
int idef; /* subckt definition line */ int idef; /* subckt definition line */
char c, keep, *ptr; char c, keep, *ptr;
unsigned int i; unsigned int i;
Str (80, subname);
SPICE_DSTRING subname ; /* dynamic string for subcircuit name */
unsigned char err = 1; unsigned char err = 1;
dico->srcline = linenum;
dico->oldline = orig_linenum;
c = dico->dyncategory[linenum];
spice_dstring_init(&subname) ;
dicoS->srcline = linenum;
dicoS->oldline = orig_linenum;
c = dicoS->dyncategory[linenum];
#ifdef TRACE_NUMPARAMS #ifdef TRACE_NUMPARAMS
fprintf (stderr, "** SJB - in nupa_eval()\n"); fprintf (stderr, "** SJB - in nupa_eval()\n");
fprintf (stderr, "** SJB - processing line %3d: %s\n", linenum, s); fprintf (stderr, "** SJB - processing line %3d: %s\n", linenum, s);
@ -701,10 +758,10 @@ nupa_eval (char *s, int linenum, int orig_linenum)
#endif /* TRACE_NUMPARAMS */ #endif /* TRACE_NUMPARAMS */
if (c == 'P') { /* evaluate parameters */ if (c == 'P') { /* evaluate parameters */
// err = nupa_substitute (dico, dico->dynrefptr[linenum], s, 0); // err = nupa_substitute (dico, dico->dynrefptr[linenum], s, 0);
nupa_assignment (dico, dico->dynrefptr[linenum], 'N');
nupa_assignment (dicoS, dicoS->dynrefptr[linenum], 'N');
} }
else if (c == 'B') /* substitute braces line */ else if (c == 'B') /* substitute braces line */
err = nupa_substitute (dico, dico->dynrefptr[linenum], s, 0);
err = nupa_substitute (dicoS, dicoS->dynrefptr[linenum], s, 0);
else if (c == 'X') else if (c == 'X')
{ /* compute args of subcircuit, if required */ { /* compute args of subcircuit, if required */
ptr = s; ptr = s;
@ -719,17 +776,17 @@ nupa_eval (char *s, int linenum, int orig_linenum)
for (i = 0; i < strlen (nupa_inst_name); i++) for (i = 0; i < strlen (nupa_inst_name); i++)
nupa_inst_name[i] = toupper (nupa_inst_name[i]); nupa_inst_name[i] = toupper (nupa_inst_name[i]);
idef = findsubckt (dico, s, subname);
idef = findsubckt (dicoS, s, &subname);
if (idef > 0) if (idef > 0)
nupa_subcktcall (dico, dico->dynrefptr[idef], dico->dynrefptr[linenum], 0);
nupa_subcktcall (dicoS, dicoS->dynrefptr[idef], dicoS->dynrefptr[linenum], 0);
else else
putlogfile ('?', linenum, " illegal subckt call."); putlogfile ('?', linenum, " illegal subckt call.");
} }
else if (c == 'U') /* release local symbols = parameters */ else if (c == 'U') /* release local symbols = parameters */
nupa_subcktexit (dico);
nupa_subcktexit (dicoS);
putlogfile ('e', linenum, s); putlogfile ('e', linenum, s);
evalcount++;
evalcountS++;
#ifdef TRACE_NUMPARAMS #ifdef TRACE_NUMPARAMS
fprintf (stderr, "** SJB - leaving nupa_eval(): %s %d\n", s, err); fprintf (stderr, "** SJB - leaving nupa_eval(): %s %d\n", s, err);
ws ("** SJB - --> "); ws ("** SJB - --> ");
@ -753,23 +810,23 @@ nupa_signal (int sig, char *info)
putlogfile ('!', sig, " Nupa Signal"); putlogfile ('!', sig, " Nupa Signal");
if (sig == NUPADECKCOPY) if (sig == NUPADECKCOPY)
{ {
if (firstsignal)
if (firstsignalS)
{ {
nupa_init (info); nupa_init (info);
firstsignal = 0;
firstsignalS = 0;
} }
} }
else if (sig == NUPASUBSTART) else if (sig == NUPASUBSTART)
inexpansion = 1;
inexpansionS = 1;
else if (sig == NUPASUBDONE) else if (sig == NUPASUBDONE)
{ {
inexpansion = 0;
inexpansionS = 0;
nupa_inst_name = NULL; nupa_inst_name = NULL;
} }
else if (sig == NUPAEVALDONE) else if (sig == NUPAEVALDONE)
{ {
nupa_done (); nupa_done ();
firstsignal = 1;
firstsignalS = 1;
} }
return 1; return 1;
} }
@ -782,3 +839,19 @@ nupa_fetchinstance (void)
return dico; return dico;
} }
#endif /* USING_NUPATEST */ #endif /* USING_NUPATEST */
static void dump_symbols( tdico *dico_p )
{
char *name_p ; /* current symbol */
entry *entry_p ; /* current entry */
void *key ; /* return key */
NGHASHITER iter ; /* hash iterator - thread safe */
fprintf (stderr, "Symbol table\n");
for (entry_p = nghash_enumeratekRE(dico_p->symbol_table,&key,NGHASH_FIRST(&iter)) ;
entry_p ;
entry_p = nghash_enumeratekRE(dico_p->symbol_table,&key,&iter)) {
name_p = (char *) key ;
fprintf (stderr, " ---> %s = %g\n", name_p, entry_p->vl) ;
}
}

802
src/frontend/numparam/xpressn.c
File diff suppressed because it is too large
View File

11
src/frontend/subckt.c

@ -781,12 +781,13 @@ bxx_printf(struct bxx_buffer *t, const char *fmt, ...)
{ {
va_list ap; va_list ap;
va_start(ap, fmt);
while(1) { while(1) {
int size = t->limit - t->buffer;
int ret = vsnprintf(t->dst, size, fmt, ap);
if(ret == -1) {
int ret;
int size = t->limit - t->dst;
va_start(ap, fmt);
ret = vsnprintf(t->dst, size, fmt, ap);
va_end(ap);
if(ret == -1) {
bxx_extend(t, bxx_chunksize); bxx_extend(t, bxx_chunksize);
} else if(ret >= size) { } else if(ret >= size) {
bxx_extend(t, ret - size + 1); bxx_extend(t, ret - size + 1);

1
src/include/Makefile.am

@ -46,6 +46,7 @@ noinst_HEADERS = \
gendev.h \ gendev.h \
graph.h \ graph.h \
grid.h \ grid.h \
hash.h \
hlpdefs.h \ hlpdefs.h \
iferrmsg.h \ iferrmsg.h \
ifsim.h \ ifsim.h \

1
src/include/inpptree.h

@ -69,6 +69,7 @@ typedef struct INPparseNode {
#define PT_CONSTANT 7 #define PT_CONSTANT 7
#define PT_VAR 8 #define PT_VAR 8
#define PT_COMMA 10 #define PT_COMMA 10
#define PT_TERN 11
/* These are the functions that we support. */ /* These are the functions that we support. */

1
src/misc/Makefile.am

@ -11,6 +11,7 @@ libmisc_la_SOURCES = \
alloc.h \ alloc.h \
dup2.c \ dup2.c \
dup2.h \ dup2.h \
hash.c \
ivars.c \ ivars.c \
ivars.h \ ivars.h \
mktemp.c \ mktemp.c \

19
src/spicelib/parser/ifeval.c

@ -85,6 +85,25 @@ PTeval(INPparseNode * tree, double gmin, double *res, double *vals)
} }
break; break;
case PT_TERN:
{
INPparseNode *arg1 = tree->left;
INPparseNode *arg2 = tree->right->left;
INPparseNode *arg3 = tree->right->right;
err = PTeval(arg1, gmin, &r1, vals);
if (err != OK)
return (err);
/*FIXME > 0.0, >= 0.5, != 0.0 or what ? */
err = PTeval((r1 != 0.0) ? arg2 : arg3, gmin, &r2, vals);
if (err != OK)
return (err);
*res = r2;
break;
}
case PT_PLUS: case PT_PLUS:
case PT_MINUS: case PT_MINUS:
case PT_TIMES: case PT_TIMES:

93
src/spicelib/parser/inpptree.c

@ -2,6 +2,7 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1987 Wayne A. Christopher, U. C. Berkeley CAD Group Author: 1987 Wayne A. Christopher, U. C. Berkeley CAD Group
**********/ **********/
// #define TRACE
#include "ngspice.h" #include "ngspice.h"
#include "ifsim.h" #include "ifsim.h"
@ -227,6 +228,31 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum)
} }
break; break;
case PT_TERN: /* ternary_fcn(cond,exp1,exp2) */
// naive:
// d/d ternary_fcn(cond,exp1,exp2) --> ternary_fcn(cond, d/d exp1, d/d exp2)
{
INPparseNode *arg1 = p->left;
INPparseNode *arg2 = p->right->left;
INPparseNode *arg3 = p->right->right;
// extern void printTree(INPparseNode *);
//
// printf("debug: %s, PT_TERN: ", __func__);
// printTree(p);
// printf("\n");
newp = mkb(PT_TERN, arg1, mkb(PT_COMMA,
PTdifferentiate(arg2, varnum),
PTdifferentiate(arg3, varnum)));
// printf("debug, %s, returns; ", __func__);
// printTree(newp);
// printf("\n");
return (newp);
}
case PT_FUNCTION: case PT_FUNCTION:
/* Many cases. Set arg1 to the derivative of the function, /* Many cases. Set arg1 to the derivative of the function,
@ -491,11 +517,28 @@ static INPparseNode *mkb(int type, INPparseNode * left,
return (left); return (left);
} }
break; break;
case PT_TERN:
if (left->type == PT_CONSTANT)
/*FIXME > 0.0, >= 0.5, != 0.0 or what ? */
return ((left->constant != 0.0) ? right->left : right->right);
if((right->left->type == PT_CONSTANT) &&
(right->right->type == PT_CONSTANT) &&
(right->left->constant == right->right->constant))
return (right->left);
break;
}
p->type = type;
p->left = left;
p->right = right;
if(type == PT_TERN) {
p->function = NULL;
p->funcname = NULL;
return (p);
} }
p->type = type;
p->left = left;
p->right = right;
for (i = 0; i < NUM_OPS; i++) for (i = 0; i < NUM_OPS; i++)
if (ops[i].number == type) if (ops[i].number == type)
@ -563,6 +606,8 @@ static int PTcheck(INPparseNode * p)
case PT_POWER: case PT_POWER:
case PT_COMMA: case PT_COMMA:
return (PTcheck(p->left) && PTcheck(p->right)); return (PTcheck(p->left) && PTcheck(p->right));
case PT_TERN:
return (PTcheck(p->left) && PTcheck(p->right->left) && PTcheck(p->right->right));
default: default:
fprintf(stderr, "Internal error: bad node type %d\n", p->type); fprintf(stderr, "Internal error: bad node type %d\n", p->type);
@ -925,6 +970,29 @@ static INPparseNode *mkfnode(char *fname, INPparseNode * arg)
} }
p->valueIndex = i; p->valueIndex = i;
p->type = PT_VAR; p->type = PT_VAR;
} else if(!strcmp("ternary_fcn", buf)) {
// extern void printTree(INPparseNode *);
//
// printf("debug: %s ternary_fcn: ", __func__);
// printTree(arg);
// printf("\n");
if(arg->type != PT_COMMA || arg->left->type != PT_COMMA) {
fprintf(stderr, "Error: bogus ternary_fcn form\n");
return (NULL);
} else {
INPparseNode *arg1 = arg->left->left;
INPparseNode *arg2 = arg->left->right;
INPparseNode *arg3 = arg->right;
p->type = PT_TERN;
p->left = arg1;
p->right = mkb(PT_COMMA, arg2, arg3);
}
} else { } else {
for (i = 0; i < NUM_FUNCS; i++) for (i = 0; i < NUM_FUNCS; i++)
if (!strcmp(funcs[i].name, buf)) if (!strcmp(funcs[i].name, buf))
@ -1127,7 +1195,7 @@ static PTelement *PTlexer(char **line)
#ifdef TRACE #ifdef TRACE
printf("PTlexer: token = %d, type = %d, left = '%s'\n", printf("PTlexer: token = %d, type = %d, left = '%s'\n",
el.token, el.type, sbuf); */
el.token, el.type, sbuf);
#endif #endif
return (&el); return (&el);
} }
@ -1204,11 +1272,28 @@ void printTree(INPparseNode * pt)
printf(")"); printf(")");
break; break;
case PT_COMMA:
printf("(");
printTree(pt->left);
printf(") , (");
printTree(pt->right);
printf(")");
break;
case PT_FUNCTION: case PT_FUNCTION:
printf("%s (", pt->funcname); printf("%s (", pt->funcname);
printTree(pt->left); printTree(pt->left);
printf(")"); printf(")");
break; break;
case PT_TERN:
printf("ternary_fcn (");
printTree(pt->left);
printf(") , (");
printTree(pt->right);
printf(")");
break;
default: default:
printf("oops"); printf("oops");

8
visualc/vngspice.sln

@ -29,12 +29,12 @@ Global
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Debug|Win32.Build.0 = Debug|Win32 {83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Debug|Win32.Build.0 = Debug|Win32
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Debug|x64.ActiveCfg = Debug|x64 {83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Debug|x64.ActiveCfg = Debug|x64
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Debug|x64.Build.0 = Debug|x64 {83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Debug|x64.Build.0 = Debug|x64
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|Win32.ActiveCfg = Debug|Win32
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|Win32.Build.0 = Debug|Win32
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|Win32.ActiveCfg = Release|Win32
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|Win32.Build.0 = Release|Win32
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|x64.ActiveCfg = Release|x64 {83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|x64.ActiveCfg = Release|x64
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|x64.Build.0 = Release|x64 {83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.Release|x64.Build.0 = Release|x64
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|Win32.ActiveCfg = release64|Win32
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|Win32.Build.0 = release64|Win32
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|Win32.ActiveCfg = release64|x64
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|Win32.Build.0 = release64|x64
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|x64.ActiveCfg = release64|x64 {83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|x64.ActiveCfg = release64|x64
{83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|x64.Build.0 = release64|x64 {83E315C7-EDD3-4F6B-AF28-87A92A4FA49A}.release64|x64.Build.0 = release64|x64
EndGlobalSection EndGlobalSection

254
visualc/vngspice.vcproj

@ -48,7 +48,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;;&quot;C:\Program Files (x86)\Visual Leak Detector\include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG"
MinimalRebuild="true" MinimalRebuild="true"
ExceptionHandling="0" ExceptionHandling="0"
@ -75,6 +75,7 @@
AdditionalDependencies="psapi.lib" AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\vngspice_d.exe" OutputFile="$(OutDir)\bin\vngspice_d.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="&quot;C:\Program Files (x86)\Visual Leak Detector\lib&quot;"
GenerateManifest="false" GenerateManifest="false"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
@ -109,14 +110,15 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine=""
ExcludedFromBuild="false"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -132,22 +134,20 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR"
MinimalRebuild="false"
ExceptionHandling="1"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG"
MinimalRebuild="true"
ExceptionHandling="0"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3"
WarningLevel="4"
Detect64BitPortabilityProblems="false" Detect64BitPortabilityProblems="false"
DebugInformationFormat="3" DebugInformationFormat="3"
CompileAs="1" CompileAs="1"
@ -163,22 +163,19 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
UseUnicodeResponseFiles="false"
AdditionalDependencies="psapi.lib" AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\$(ProjectName).exe"
OutputFile="$(OutDir)\bin\vngspice_d.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateDebugInformation="false"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
HeapReserveSize="0" HeapReserveSize="0"
HeapCommitSize="0" HeapCommitSize="0"
StackReserveSize="0" StackReserveSize="0"
StackCommitSize="0" StackCommitSize="0"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkTimeCodeGeneration="1"
RandomizedBaseAddress="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="1"
TargetMachine="17"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -203,15 +200,14 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="console_debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1" ConfigurationType="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine=""
ExcludedFromBuild="false"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -230,18 +226,21 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG;CONSOLE"
MinimalRebuild="true"
ExceptionHandling="0"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR"
MinimalRebuild="false"
ExceptionHandling="1"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="4"
WarningLevel="3"
Detect64BitPortabilityProblems="false" Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
DebugInformationFormat="3"
CompileAs="1" CompileAs="1"
/> />
<Tool <Tool
@ -255,17 +254,20 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
UseUnicodeResponseFiles="false"
AdditionalDependencies="psapi.lib" AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\vngspice_dc.exe"
OutputFile="$(OutDir)\bin\$(ProjectName).exe"
LinkIncremental="1" LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
GenerateDebugInformation="false"
SubSystem="2"
HeapReserveSize="0" HeapReserveSize="0"
HeapCommitSize="0" HeapCommitSize="0"
StackReserveSize="0" StackReserveSize="0"
StackCommitSize="0" StackCommitSize="0"
RandomizedBaseAddress="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkTimeCodeGeneration="1"
RandomizedBaseAddress="2"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="1" TargetMachine="1"
/> />
@ -292,9 +294,9 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="console_release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
WholeProgramOptimization="1" WholeProgramOptimization="1"
> >
@ -315,6 +317,7 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
@ -323,7 +326,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;CONSOLE"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR"
MinimalRebuild="false" MinimalRebuild="false"
ExceptionHandling="1" ExceptionHandling="1"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
@ -348,10 +351,10 @@
Name="VCLinkerTool" Name="VCLinkerTool"
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="psapi.lib" AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\$(ProjectName)c.exe"
OutputFile="$(OutDir)\bin\$(ProjectName).exe"
LinkIncremental="1" LinkIncremental="1"
GenerateDebugInformation="false" GenerateDebugInformation="false"
SubSystem="1"
SubSystem="2"
HeapReserveSize="0" HeapReserveSize="0"
HeapCommitSize="0" HeapCommitSize="0"
StackReserveSize="0" StackReserveSize="0"
@ -361,7 +364,7 @@
LinkTimeCodeGeneration="1" LinkTimeCodeGeneration="1"
RandomizedBaseAddress="2" RandomizedBaseAddress="2"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="1"
TargetMachine="17"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -386,14 +389,21 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="release64|Win32"
Name="console_debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine=""
ExcludedFromBuild="false"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Custom defined Build: Recompile conf.c with actual date"
CommandLine="del $(IntDir)\conf.obj&#x0D;&#x0A;"
Outputs="$(IntDir)\conf.obj"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -406,6 +416,19 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG;CONSOLE"
MinimalRebuild="true"
ExceptionHandling="0"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
CompileAs="1"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
@ -418,6 +441,19 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\vngspice_dc.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
HeapReserveSize="0"
HeapCommitSize="0"
StackReserveSize="0"
StackCommitSize="0"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -442,7 +478,7 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|x64"
Name="console_debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)" OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
@ -472,7 +508,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG;CONSOLE"
MinimalRebuild="true" MinimalRebuild="true"
ExceptionHandling="0" ExceptionHandling="0"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
@ -496,11 +532,11 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="psapi.lib" AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\vngspice_d.exe"
OutputFile="$(OutDir)\bin\vngspice_dc.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateManifest="false" GenerateManifest="false"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2"
SubSystem="1"
HeapReserveSize="0" HeapReserveSize="0"
HeapCommitSize="0" HeapCommitSize="0"
StackReserveSize="0" StackReserveSize="0"
@ -532,9 +568,9 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
Name="console_release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
WholeProgramOptimization="1" WholeProgramOptimization="1"
> >
@ -555,7 +591,6 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
@ -564,7 +599,7 @@
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;CONSOLE"
MinimalRebuild="false" MinimalRebuild="false"
ExceptionHandling="1" ExceptionHandling="1"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
@ -589,10 +624,10 @@
Name="VCLinkerTool" Name="VCLinkerTool"
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="psapi.lib" AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\$(ProjectName).exe"
OutputFile="$(OutDir)\bin\$(ProjectName)c.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateDebugInformation="false" GenerateDebugInformation="false"
SubSystem="2"
SubSystem="1"
HeapReserveSize="0" HeapReserveSize="0"
HeapCommitSize="0" HeapCommitSize="0"
StackReserveSize="0" StackReserveSize="0"
@ -602,7 +637,7 @@
LinkTimeCodeGeneration="1" LinkTimeCodeGeneration="1"
RandomizedBaseAddress="2" RandomizedBaseAddress="2"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="17"
TargetMachine="1"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -627,15 +662,14 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="console_debug|x64"
Name="console_release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)" OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine=""
ExcludedFromBuild="false"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
@ -655,16 +689,19 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;" AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;NGDEBUG;CONSOLE"
MinimalRebuild="true"
ExceptionHandling="0"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;CONSOLE"
MinimalRebuild="false"
ExceptionHandling="1"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="4"
WarningLevel="3"
Detect64BitPortabilityProblems="false" Detect64BitPortabilityProblems="false"
DebugInformationFormat="3" DebugInformationFormat="3"
CompileAs="1" CompileAs="1"
@ -680,17 +717,20 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
UseUnicodeResponseFiles="false"
AdditionalDependencies="psapi.lib" AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\vngspice_dc.exe"
OutputFile="$(OutDir)\bin\$(ProjectName)c.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
GenerateDebugInformation="false"
SubSystem="1" SubSystem="1"
HeapReserveSize="0" HeapReserveSize="0"
HeapCommitSize="0" HeapCommitSize="0"
StackReserveSize="0" StackReserveSize="0"
StackCommitSize="0" StackCommitSize="0"
RandomizedBaseAddress="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkTimeCodeGeneration="1"
RandomizedBaseAddress="2"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="17" TargetMachine="17"
/> />
@ -717,20 +757,16 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="console_release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
Name="release64|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Custom defined Build: Recompile conf.c with actual date"
CommandLine="del $(IntDir)\conf.obj&#x0D;&#x0A;"
Outputs="$(IntDir)\conf.obj"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -740,26 +776,9 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR;CONSOLE"
MinimalRebuild="false"
ExceptionHandling="1"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CompileAs="1"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
@ -772,22 +791,6 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
UseUnicodeResponseFiles="false"
AdditionalDependencies="psapi.lib"
OutputFile="$(OutDir)\bin\$(ProjectName)c.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
HeapReserveSize="0"
HeapCommitSize="0"
StackReserveSize="0"
StackCommitSize="0"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkTimeCodeGeneration="1"
RandomizedBaseAddress="2"
DataExecutionPrevention="0"
TargetMachine="17"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -835,6 +838,13 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="3"
FavorSizeOrSpeed="1"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)..\src\maths\poly&quot;;&quot;$(ProjectDir)..\src\frontend&quot;;&quot;$(ProjectDir)..\src\spicelib\devices&quot;;&quot;$(ProjectDir)..\src\include&quot;;&quot;$(ProjectDir)include&quot;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;SIMULATOR"
WarningLevel="3"
CompileAs="1"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
@ -1789,15 +1799,15 @@
> >
</File> </File>
<File <File
RelativePath="..\src\frontend\plotting\grid.h"
RelativePath="..\src\include\grid.h"
> >
</File> </File>
<File <File
RelativePath="..\src\include\grid.h"
RelativePath="..\src\frontend\plotting\grid.h"
> >
</File> </File>
<File <File
RelativePath="..\src\misc\hash.h"
RelativePath="..\src\include\hash.h"
> >
</File> </File>
<File <File
@ -1901,11 +1911,11 @@
> >
</File> </File>
<File <File
RelativePath="..\src\spicelib\parser\inp.h"
RelativePath="..\src\frontend\inp.h"
> >
</File> </File>
<File <File
RelativePath="..\src\frontend\inp.h"
RelativePath="..\src\spicelib\parser\inp.h"
> >
</File> </File>
<File <File
@ -5696,6 +5706,10 @@
RelativePath="..\src\frontend\plotting\grid.c" RelativePath="..\src\frontend\plotting\grid.c"
> >
</File> </File>
<File
RelativePath="..\src\misc\hash.c"
>
</File>
<File <File
RelativePath="..\src\frontend\hcomp.c" RelativePath="..\src\frontend\hcomp.c"
> >

Loading…
Cancel
Save