Browse Source

Improved current vectors output and added element for last analysis run

pre-master-46
pnenzi 19 years ago
parent
commit
56626999fc
  1. 5
      ChangeLog
  2. 30
      src/frontend/outitf.c
  3. 15
      src/frontend/rawfile.c
  4. 7
      src/frontend/runcoms.c
  5. 1
      src/include/ftedefs.h

5
ChangeLog

@ -1,3 +1,8 @@
2007-10-8 Paolo Nenzi <p.nenzi@ieee.org>
* src/frontend/{rawfile.c, outitf.c, runcoms.c}, src/include/ftedefs.h:
modified current vectors output amd added struct elements for holding the
name of the last analysis run (all from Phil Barker patch).
2007-10-8 Paolo Nenzi <p.nenzi@ieee.org> 2007-10-8 Paolo Nenzi <p.nenzi@ieee.org>
*src/frontend/{device.c, device.h}: modified 'show' command to match *src/frontend/{device.c, device.h}: modified 'show' command to match
SmartSpice syntax from Phil Barker patch. SmartSpice syntax from Phil Barker patch.

30
src/frontend/outitf.c

@ -146,6 +146,7 @@ beginPlot(void *analysisPtr, void *circuitPtr, char *cktName, char *analName, ch
run->numData = 0; run->numData = 0;
an_name = spice_analysis_get_name(((JOB *) analysisPtr)->JOBtype); an_name = spice_analysis_get_name(((JOB *) analysisPtr)->JOBtype);
ft_curckt->ci_last_an = an_name;
/* Now let's see which of these things we need. First toss in the /* Now let's see which of these things we need. First toss in the
* reference vector. Then toss in anything that getSaves() tells * reference vector. Then toss in anything that getSaves() tells
@ -725,10 +726,10 @@ fileInit(runDesc *run)
run->pointPos = i; run->pointPos = i;
fprintf(run->fp, "0 \n"); /* Save 8 spaces here. */ fprintf(run->fp, "0 \n"); /* Save 8 spaces here. */
fprintf(run->fp, "Command: version %s\n", ft_sim->version);
/*fprintf(run->fp, "Command: version %s\n", ft_sim->version);*/
fprintf(run->fp, "Variables:\n"); fprintf(run->fp, "Variables:\n");
fprintf(stderr, "No. of Data Columns : %d \n", run->numData);
printf("No. of Data Columns : %d \n", run->numData);
return; return;
} }
@ -737,12 +738,12 @@ static void
fileInit_pass2(runDesc *run) fileInit_pass2(runDesc *run)
{ {
int i, type; int i, type;
char *name, buf[BSIZE_SP];
char *name, buf[BSIZE_SP], *branch;
for (i = 0; i < run->numData; i++) { for (i = 0; i < run->numData; i++) {
if (isdigit(*run->data[i].name)) { if (isdigit(*run->data[i].name)) {
(void) sprintf(buf, "V(%s)", run->data[i].name);
(void) sprintf(buf, "v(%s)", run->data[i].name);
name = buf; name = buf;
} else { } else {
name = run->data[i].name; name = run->data[i].name;
@ -760,8 +761,18 @@ fileInit_pass2(runDesc *run)
else else
type = SV_VOLTAGE; type = SV_VOLTAGE;
fprintf(run->fp, "\t%d\t%s\t%s", i, name,
ft_typenames(type));
if ( type == SV_CURRENT ) {
branch = NULL;
if ( (branch = strstr( name, "#branch" )) ) {
*branch = '\0';
}
fprintf(run->fp, "\t%d\ti(%s)\t%s", i, name, ft_typenames(type));
if ( branch != NULL ) *branch = '#';
} else if ( type == SV_VOLTAGE ) {
fprintf(run->fp, "\t%d\tv(%s)\t%s", i, name, ft_typenames(type));
} else {
fprintf(run->fp, "\t%d\t%s\t%s", i, name, ft_typenames(type));
}
if (run->data[i].gtype == GRID_XLOG) if (run->data[i].gtype == GRID_XLOG)
fprintf(run->fp, "\tgrid=3"); fprintf(run->fp, "\tgrid=3");
fprintf(run->fp, "\n"); fprintf(run->fp, "\n");
@ -844,7 +855,7 @@ fileEnd(runDesc *run)
place = ftell(run->fp); place = ftell(run->fp);
fseek(run->fp, run->pointPos, 0); fseek(run->fp, run->pointPos, 0);
fprintf(run->fp, "%d", run->pointCount); fprintf(run->fp, "%d", run->pointCount);
fprintf(stderr, "\nNo. of Data Rows : %d\n", run->pointCount);
printf("\nNo. of Data Rows : %d\n", run->pointCount);
fseek(run->fp, place, 0); fseek(run->fp, place, 0);
} else { } else {
/* Yet another hack-around */ /* Yet another hack-around */
@ -966,8 +977,9 @@ plotAddComplexValue(dataDesc *desc, IFcomplex value)
static void static void
plotEnd(runDesc *run) plotEnd(runDesc *run)
{ {
fprintf(stderr, "\nNo. of Data Rows : %d\n", run->pointCount);
return;
fprintf(stderr,"\n");
printf("\nNo. of Data Rows : %d\n", run->pointCount);
return;
} }

15
src/frontend/rawfile.c

@ -45,6 +45,7 @@ raw_write(char *name, struct plot *pl, bool app, bool binary)
struct variable *vv; struct variable *vv;
double dd; double dd;
char buf[BSIZE_SP]; char buf[BSIZE_SP];
char *branch;
if (!cp_getvar("nopadding", VT_BOOL, (char *) &raw_padding)) if (!cp_getvar("nopadding", VT_BOOL, (char *) &raw_padding))
raw_padding = FALSE; raw_padding = FALSE;
@ -156,8 +157,18 @@ raw_write(char *name, struct plot *pl, bool app, bool binary)
fprintf(fp, "Variables:\n"); fprintf(fp, "Variables:\n");
for (i = 0, v = pl->pl_dvecs; v; v = v->v_next) { for (i = 0, v = pl->pl_dvecs; v; v = v->v_next) {
fprintf(fp, "\t%d\t%s\t%s", i++, v->v_name,
ft_typenames(v->v_type));
if ( strcmp( ft_typenames(v->v_type), "current" ) == 0 ) {
branch = NULL;
if ( (branch = strstr( v->v_name, "#branch" )) ) {
*branch = '\0';
}
fprintf(fp, "\t%d\ti(%s)\t%s", i++, v->v_name, ft_typenames(v->v_type));
if ( branch != NULL ) *branch = '#';
} else if ( strcmp( ft_typenames(v->v_type), "voltage" ) == 0 ) {
fprintf(fp, "\t%d\tv(%s)\t%s", i++, v->v_name, ft_typenames(v->v_type));
} else {
fprintf(fp, "\t%d\t%s\t%s", i++, v->v_name, ft_typenames(v->v_type));
}
if (v->v_flags & VF_MINGIVEN) if (v->v_flags & VF_MINGIVEN)
fprintf(fp, " min=%e", v->v_minsignal); fprintf(fp, " min=%e", v->v_minsignal);
if (v->v_flags & VF_MAXGIVEN) if (v->v_flags & VF_MAXGIVEN)

7
src/frontend/runcoms.c

@ -165,7 +165,6 @@ dosim(char *what, wordlist *wl)
struct circ *ct; struct circ *ct;
int err = 0; int err = 0;
bool ascii = AsciiRawFile; bool ascii = AsciiRawFile;
if (eq(what, "run") && wl) if (eq(what, "run") && wl)
dofile = TRUE; dofile = TRUE;
if (!dofile) { if (!dofile) {
@ -258,6 +257,7 @@ dosim(char *what, wordlist *wl)
} else { } else {
rawfileFp = NULL; rawfileFp = NULL;
} }
/*save rawfile name saj*/ /*save rawfile name saj*/
if(last_used_rawfile) if(last_used_rawfile)
tfree(last_used_rawfile); tfree(last_used_rawfile);
@ -304,6 +304,7 @@ dosim(char *what, wordlist *wl)
} else } else
ft_curckt->ci_inprogress = FALSE; ft_curckt->ci_inprogress = FALSE;
} }
if (rawfileFp){ if (rawfileFp){
if (ftell(rawfileFp)==0) { if (ftell(rawfileFp)==0) {
(void) fclose(rawfileFp); (void) fclose(rawfileFp);
@ -344,9 +345,9 @@ ft_dorun(char *file)
wl.wl_word = file; wl.wl_word = file;
if (file) if (file)
return dosim("run", &wl);
return dosim("run", &wl);
else else
return dosim("run", (wordlist *) NULL);
return dosim("run", (wordlist *) NULL);
} }
/* ARGSUSED */ /* until the else clause gets put back */ /* ARGSUSED */ /* until the else clause gets put back */

1
src/include/ftedefs.h

@ -45,6 +45,7 @@ struct circ {
char *ci_defOpt; /* the default options anal. for this circuit */ char *ci_defOpt; /* the default options anal. for this circuit */
char *ci_specOpt; /* the special options anal. for command line jobs */ char *ci_specOpt; /* the special options anal. for command line jobs */
char *ci_curOpt; /* the most recent options anal. for the circuit */ char *ci_curOpt; /* the most recent options anal. for the circuit */
char *ci_last_an; /* name of last analysis run */
} ; } ;

Loading…
Cancel
Save