From f94cc3a8a0cdef47fadd6dd8f5cce818e4b43636 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 29 May 2011 10:07:10 +0000 Subject: [PATCH] comp issues --- ChangeLog | 7 ++++++- src/frontend/inpcom.c | 8 ++++---- src/frontend/numparam/numparam.h | 4 ++-- src/frontend/numparam/spicenum.c | 2 +- src/frontend/numparam/xpressn.c | 16 ++++++++-------- src/include/compatmode.h | 2 +- src/main.c | 11 ++++++----- src/spicelib/devices/bsim3v1/b3v1.c | 2 +- 8 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index a51a2d032..cc73f5eef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,14 @@ +2011-05-29 Holger Vogt + * main.c, inpcom.c, numparam.h, spicenum.c, xpressn.c, compatmode.h, b3v1.c: + compatibility issues + 2011-05-28 Dietmar Warning * tests/hisim, tests/hisimhv: include the CMC test suite (Author: Colin McAndrew) provided by the model developer - Hiroshima University 2011-05-28 Holger Vogt - * update to prepare release 23 + * configure.ac, visualc/config.h, CPOYING, FAQ, INSTALL, NEWS: + update to prepare release 23 2011-05-28 Robert Larice * src/ngsconvert.c : diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 369c908ae..627a4bef2 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -17,8 +17,8 @@ Author: 1985 Wayne A. Christopher /* * SJB 21 April 2005 * Added support for end-of-line comments that begin with any of the following: - * ';' (for PSpice compatability) - * '$ ' (for HSpice compatability) + * ';' + * '$ ' * '//' (like in c++ and as per the numparam code) * '--' (as per the numparam code) * Any following text to the end of the line is ignored. @@ -3625,7 +3625,7 @@ inp_split_multi_param_lines( struct line *deck, int line_num ) -/* pspice compatibility: +/* ps compatibility: ECOMP 3 0 TABLE {V(1,2)} = (-1MV 0V) (1MV, 10V) --> ECOMP 3 0 int3 int0 1 @@ -3637,7 +3637,7 @@ inp_split_multi_param_lines( struct line *deck, int line_num ) BGD16 int_16 int_1 V = pwl (v(16,1) , -100V , -1pV , 0 , 0 , 1m , 1u , 2m , 1m ) */ -/* hspice compatibility: +/* hs compatibility: Exxx n1 n2 VCVS n3 n4 gain --> Exxx n1 n2 n3 n4 gain Gxxx n1 n2 VCCS n3 n4 tr --> Exxx n1 n2 n3 n4 tr diff --git a/src/frontend/numparam/numparam.h b/src/frontend/numparam/numparam.h index cc13d14b8..3794e9aa6 100644 --- a/src/frontend/numparam/numparam.h +++ b/src/frontend/numparam/numparam.h @@ -16,7 +16,7 @@ typedef enum {Nodekey='#'} _nNodekey; /* Introduces node symbol */ typedef enum {Intro='&'} _nIntro; /* Introduces preprocessor tokens */ typedef enum {Comment='*'} _nComment; /* Spice Comment lines*/ -typedef enum {Pspice='{'} _nPspice; /* Pspice expression */ +typedef enum {Psp='{'} _nPsp; /* Ps expression */ typedef enum {Defd=15} _nDefd; /* serial numb. of 'defined' keyword. The others are not used (yet) */ typedef char * auxtable; /* dummy */ @@ -57,7 +57,7 @@ typedef struct _ttdico { auxtable nodetab; char **dynrefptr; char *dyncategory; - int hspice_compatibility; /* allow hspice keywords */ + int hs_compatibility; /* allow extra keywords */ } tdico; void initdico(tdico * dico); diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 4e5b4c41d..6eb5d7b11 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -329,7 +329,7 @@ transform (tdico * dico, SPICE_DSTRINGPTR dstr_p, unsigned char nostripping, s = spice_dstring_value(dstr_p) ; if (s[0] == '.') { - /* check Pspice parameter format */ + /* check PS parameter format */ scopy_up (&tstr, spice_dstring_value(dstr_p) ) ; k = 1; diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index eac664330..c6edf48bc 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -228,10 +228,10 @@ initdico (tdico * dico) compat_mode = ngspice_compat_mode() ; - if( compat_mode == COMPATMODE_HSPICE ) - dico->hspice_compatibility = 1 ; + if( compat_mode == COMPATMODE_HS ) + dico->hs_compatibility = 1 ; else - dico->hspice_compatibility = 0 ; + dico->hs_compatibility = 0 ; } void dico_free_entry( entry *entry_p ) @@ -1431,9 +1431,9 @@ scanline (tdico * dico, char *s, char *r, bool err) { i++; c = s[i - 1]; - if (c == Pspice) + if (c == Psp) { - /* try pspice expression syntax */ + /* try ps expression syntax */ k = i; nnest = 1; do @@ -1453,7 +1453,7 @@ scanline (tdico * dico, char *s, char *r, bool err) else { pscopy (t, s, i + 1, k - i - 1); - if( dico->hspice_compatibility && (strcasecmp(t,"LAST")==0) ) + if( dico->hs_compatibility && (strcasecmp(t,"LAST")==0) ) { strcpy(q,"last") ; err=0; @@ -1629,9 +1629,9 @@ nupa_substitute (tdico * dico, char *s, char *r, bool err) i++; c = s[i - 1]; - if (c == Pspice) + if (c == Psp) { - /* try pspice expression syntax */ + /* try ps expression syntax */ k = i; nnest = 1; do diff --git a/src/include/compatmode.h b/src/include/compatmode.h index 40f5fd96b..d004644b9 100644 --- a/src/include/compatmode.h +++ b/src/include/compatmode.h @@ -5,7 +5,7 @@ typedef enum { COMPATMODE_NATIVE = 0, - COMPATMODE_HSPICE = 1, + COMPATMODE_HS = 1, COMPATMODE_SPICE3 = 2, COMPATMODE_ALL = 3, } COMPATMODE_T ; diff --git a/src/main.c b/src/main.c index 561a58638..5f96f58e5 100644 --- a/src/main.c +++ b/src/main.c @@ -420,9 +420,10 @@ int DEVmaxnum = 0; /* -------------------------------------------------------------------------- */ /* Set a compatibility flag. Currently available are flags for: - ngspice (standard) - HSPICE - Spice3 + - ngspice (standard) + - a commercial simulator + - Spice3 + - all compatibility staff */ COMPATMODE_T ngspice_compat_mode(void) { @@ -431,8 +432,8 @@ COMPATMODE_T ngspice_compat_mode(void) if( cp_getvar("ngbehavior", CP_STRING, behaviour)){ if (strcasecmp(behaviour,"all")==0) return( COMPATMODE_ALL ) ; - if (strcasecmp(behaviour,"hspice")==0) - return( COMPATMODE_HSPICE ) ; + if (strcasecmp(behaviour,"hs")==0) + return( COMPATMODE_HS ) ; if (strcasecmp(behaviour,"spice3")==0) return( COMPATMODE_SPICE3 ) ; } diff --git a/src/spicelib/devices/bsim3v1/b3v1.c b/src/spicelib/devices/bsim3v1/b3v1.c index d381eb185..7da119ba5 100644 --- a/src/spicelib/devices/bsim3v1/b3v1.c +++ b/src/spicelib/devices/bsim3v1/b3v1.c @@ -428,7 +428,7 @@ IOP( "kf", BSIM3v1_MOD_KF, IF_REAL, "Flicker noise coefficient"), IP( "nmos", BSIM3v1_MOD_NMOS, IF_FLAG, "Flag to indicate NMOS"), IP( "pmos", BSIM3v1_MOD_PMOS, IF_FLAG, "Flag to indicate PMOS"), /* serban */ -IOP( "hdif", BSIM3v1_MOD_HDIF, IF_REAL, "S/D junction extension (HSPICE style)"), +IOP( "hdif", BSIM3v1_MOD_HDIF, IF_REAL, "S/D junction extension"), }; char *BSIM3v1names[] = {