convergence (output.net), add some comments

This commit is contained in:
h_vogt 2009-06-11 14:12:07 +00:00
parent ae0a8ab015
commit 9aad956864
5 changed files with 64 additions and 49 deletions

View File

@ -1,3 +1,9 @@
2009-06-11 Holger Vogt
* conf.c: editor notepad.exe also with MS Visual C++
* /examples/TransImpedanceAmp/output.net: change integration method
to 'gear' for achieving convergence
* cpitf.c, ivars.c: add some comments
2009-05-24 Dietmar Warning
* tcl-testbench4.tcl: correct path to codemodel
* FB14.cir: better breakthrough current in bas70

View File

@ -5,7 +5,8 @@
* Documentation at http://www.brorson.com/gEDA/SPICE/ *
*********************************************************
* Command stuff
.options gmin=1e-9 noacct
.options gmin=1e-9 noacct
.options method=gear
.options abstol=1e-11
* .ac dec 10 10MegHz 10 Ghz
* Remainder of file

View File

@ -18,7 +18,7 @@ char Spice_Build_Date[] = NGSPICEBUILDDATE;
char *Spice_Exec_Dir = NGSPICEBINDIR;
char *Spice_Lib_Dir = NGSPICEDATADIR;
#ifdef __MINGW32__
#if defined (__MINGW32__) || defined (_MSC_VER)
char *Def_Editor = "notepad.exe";
#else
char *Def_Editor = "vi";

View File

@ -206,47 +206,46 @@ ft_cpinit(void)
/* Reset this for the front end. */
cp_hash = '*';
/* NGSPICEDATADIR has been set to path "$dprefix/share/ngspice" in configure.in,
Spice_Lib_Dir has been set to NGSPICEDATADIR in conf.c,
Lib_Path has been set to Spice_Lib_Dir adding /scripts in ivars() */
if (Lib_Path && *Lib_Path) {
(void) sprintf(buf, "sourcepath = ( %s %s )", DIR_CWD, Lib_Path);
(void) sprintf(buf, "sourcepath = ( %s %s )", DIR_CWD, Lib_Path);
wl = cp_doglob(cp_lexer(buf));
cp_striplist(wl);
com_set(wl);
cp_striplist(wl);
com_set(wl);
wl_free(wl);
/* Now source the standard startup file. */
/* XXX strange */
/* Now source the standard startup file. */
for (copys=s=cp_tildexpand(Lib_Path); copys && *copys; ) {/*DG*/
while (isspace(*s))
s++;
for (r = buf; *s && !isspace(*s); r++, s++)
*r = *s;
tfree(copys); /* sjb - it's safe to free this here */
(void) strcpy(r, DIR_PATHSEP);
/* remove leading spaces */
for (copys=s=cp_tildexpand(Lib_Path); copys && *copys; ) {
while (isspace(*s))
s++;
/* copy s into buf until space is seen, r is the actual position */
for (r = buf; *s && !isspace(*s); r++, s++)
*r = *s;
tfree(copys); /* sjb - it's safe to free this here */
/* add a path separator to buf at actual position */
(void) strcpy(r, DIR_PATHSEP);
#ifdef TCL_MODULE
(void) strcat(r, "tclspinit");
/* add "tclspinit" to buf after actual position */
(void) strcat(r, "tclspinit");
#else
(void) strcat(r, "spinit");
/* add "spinit" to buf after actual position */
(void) strcat(r, "spinit");
#endif
if ((fp = fopen(buf, "r"))) {
cp_interactive = FALSE;
inp_spsource(fp, TRUE, buf);
cp_interactive = TRUE;
/* the following caused me SIGSEGV's since inp_spsource
already closes fp - A. Veliath 12/7/97
MW. Its really needed - I changed inp_spsource to
close fp always. */
/* (void) fclose(fp); */
found = TRUE;
break;
} else if (ft_controldb)
fprintf(cp_err, "Note: can't open \"%s\".\n", buf);
}
if (!found)
fprintf(cp_err, "Note: can't find init file.\n");
if ((fp = fopen(buf, "r"))) {
cp_interactive = FALSE;
inp_spsource(fp, TRUE, buf);
cp_interactive = TRUE;
found = TRUE;
break;
} else if (ft_controldb)
fprintf(cp_err, "Note: can't open \"%s\".\n", buf);
}
if (!found)
fprintf(cp_err, "Note: can't find init file.\n");
}
tcap_init( );

View File

@ -21,7 +21,7 @@ env_overr(char **v, char *e)
{
char *p;
if (v && e && (p = getenv(e)))
*v = p;
*v = p;
}
static void
@ -39,15 +39,15 @@ mkvar(char **p, char *path_prefix, char *var_dir, char *env_var)
asprintf(p, "%s%s%s", path_prefix, DIR_PATHSEP, var_dir);
#else /* ~ HAVE_ASPRINTF */
if (buffer){
*p = (char *) tmalloc(strlen(buffer)+1);
sprintf(*p,"%s",buffer);
/* asprintf(p, "%s", buffer); */
*p = (char *) tmalloc(strlen(buffer)+1);
sprintf(*p,"%s",buffer);
/* asprintf(p, "%s", buffer); */
}
else{
*p = (char *) tmalloc(strlen(path_prefix) +
strlen(DIR_PATHSEP) + strlen(var_dir) + 1);
sprintf(*p, "%s%s%s", path_prefix, DIR_PATHSEP, var_dir);
/* asprintf(p, "%s%s%s", path_prefix, DIR_PATHSEP, var_dir); */
*p = (char *) tmalloc(strlen(path_prefix) +
strlen(DIR_PATHSEP) + strlen(var_dir) + 1);
sprintf(*p, "%s%s%s", path_prefix, DIR_PATHSEP, var_dir);
/* asprintf(p, "%s%s%s", path_prefix, DIR_PATHSEP, var_dir); */
}
#endif /* HAVE_ASPRINTF */
}
@ -55,24 +55,33 @@ mkvar(char **p, char *path_prefix, char *var_dir, char *env_var)
void
ivars(void)
{
char *temp=NULL;
/* $dprefix has been set to /usr/local or C:/Spice (Windows) in configure.in,
NGSPICEBINDIR has been set to $dprefix/bin in configure.in,
Spice_Exec_Dir has been set to NGSPICEBINDIR in conf.c,
may be overridden here by environmental variable SPICE_EXEC_DIR */
env_overr(&Spice_Exec_Dir, "SPICE_EXEC_DIR");
env_overr(&Spice_Lib_Dir, "SPICE_LIB_DIR");
/* for printing a news file */
mkvar(&News_File, Spice_Lib_Dir, "news", "SPICE_NEWS");
/* not used in ngspice */
mkvar(&Default_MFB_Cap, Spice_Lib_Dir, "mfbcap", "SPICE_MFBCAP");
/* help directory, not used in Windows mode */
mkvar(&Help_Path, Spice_Lib_Dir, "helpdir", "SPICE_HELP_DIR");
/* where spinit is found */
mkvar(&Lib_Path, Spice_Lib_Dir, "scripts", "SPICE_SCRIPTS");
/* used to call ngspice with aspice command, not used in Windows mode */
mkvar(&Spice_Path, Spice_Exec_Dir, "ngspice", "SPICE_PATH");
env_overr(&Spice_Host, "SPICE_HOST");
env_overr(&Spice_Host, "SPICE_HOST"); /* aspice */
env_overr(&Bug_Addr, "SPICE_BUGADDR");
env_overr(&Def_Editor, "SPICE_EDITOR");
env_overr(&temp, "SPICE_ASCIIRAWFILE");
/* Set raw file mode, 0 by default (binary) set in conf.c,
may be overridden by environmental
variable, not sure if acknowledged everywhere in ngspice */
env_overr(&temp, "SPICE_ASCIIRAWFILE");
if(temp)
AsciiRawFile = atoi(temp);