applied main changes

This commit is contained in:
Jim Holmes 2014-10-04 14:32:16 +02:00 committed by rlar
parent 87ccec0e30
commit 4b515eda14
17 changed files with 107 additions and 8 deletions

View File

@ -720,6 +720,13 @@ AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d],
[AC_DEFINE([HAVE_LIBFFTW3], [], [Have fft routines in libfftw3])
LIBS="$LIBS -lfftw3"])
AC_CHECK_LIB([z],[compress],
[LIBS="$LIBS -lz"],
[AC_MSG_ERROR([Couldn't find z compression libraries.])])
AC_MSG_RESULT([LXT2 waveform database included])
#AC_DEFINE([LXT2], [1], [The LXT2 waveform database])
AC_CHECK_HEADERS([zlibdefs.h zlib.h malloc.h alloca.h inttypes.h])
# Check for a few mathematical functions:
AC_CHECK_FUNCS([erfc logb scalb scalbn asinh acosh atanh finite])
# According POSIX we should look for macros first

View File

@ -116,6 +116,8 @@ char *ft_setkwords[] = {
"subend",
"subinvoke",
"substart",
"lxt2waves" /* holmes: adding switch to write lxt2 waveform database */
"swapendian" /* holmes: adding switch to write raw file in opposite endianness of OS */
"term",
"ticmarks",
"tnom",

View File

@ -209,15 +209,18 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
/* Pass 1. */
if (numsaves && !saveall) {
for (i = 0; i < numsaves; i++)
for (i = 0; i < numsaves; i++) {
printf("saves[%d].name(%s)\n",i,saves[i].name);
if (!savesused[i])
for (j = 0; j < numNames; j++)
if (name_eq(saves[i].name, dataNames[j])) {
printf("saves[%d].name(%s) dataNames[%d](%s)\n",i,saves[i].name,j,dataNames[j]); /* holmes: looking for missing digital signals */
addDataDesc(run, dataNames[j], dataType, j);
savesused[i] = TRUE;
saves[i].used = 1;
break;
}
}
} else {
for (i = 0; i < numNames; i++)
if (!refName || !name_eq(dataNames[i], refName))
@ -912,6 +915,9 @@ static void
fileEndPoint(FILE *fp, bool bin)
{
/* write row buffer to file */
printf("fileEndPoint: flushing binary data to raw file.\n"); /* holmes: Is this used in dctran? */
/* otherwise the data has already been written */
if (bin)

View File

@ -36,6 +36,7 @@ struct runDesc {
bool writeOut;
bool windowed;
bool binary;
bool swapendian;
struct plot *runPlot;
FILE *fp;
long pointPos; /* where to write pointCount */

View File

@ -137,7 +137,7 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart)
dy = isreal(v) ? v->v_realdata[i] :
realpart(v->v_compdata[i]);
if ((i == 0 || (dir > 0 ? lx > dx : dir < 0 ? lx < dx : 0)) &&
xs->v_plot && xs->v_plot->pl_scale == xs)
xs->v_plot && xs->v_plot->pl_scale && xs->v_plot->pl_scale == xs)
{
gr_point(v, dx, dy, lx, ly, 0);
} else {

View File

@ -474,14 +474,20 @@ com_write(wordlist *wl)
scalefound = FALSE;
for (d = newplot.pl_dvecs; d; d = d->v_next) {
if (d->v_scale) {
for (vv = newplot.pl_dvecs; vv; vv = vv->v_next)
if (vec_eq(vv, d->v_scale))
for (vv = newplot.pl_dvecs; vv; vv = vv->v_next) {
if (vec_eq(vv, d->v_scale)) {
break;
}
}
/* We have to grab it... */
if(vv && d->v_scale && vec_eq(vv, d->v_scale)) { /* holmes: */
} /* holmes: */
else { /* holmes: */
vv = vec_copy(d->v_scale);
vv->v_next = newplot.pl_dvecs;
newplot.pl_dvecs = vv;
scalefound = TRUE;
} /* holmes: */
}
}

View File

@ -16,6 +16,13 @@
#endif
/* gtri - evt - wbk - 5/20/91 - add event-driven and enhancements data */
/* holmes lxt2 */
#define LXT2
#ifdef LXT2
/* #define LXT2_DEBUG */
#define LXT2_TIME_RESOLUTION_EXPONENT -12
#include "ngspice/lxt2_write.h"
#endif
#define MAXNUMDEVS 64 /* Max number of possible devices PN:XXX may cause toubles*/
#define MAXNUMDEVNODES 4 /* Max No. of nodes per device */
@ -288,6 +295,12 @@ struct CKTcircuit {
NGHASHPTR DEVnameHash;
NGHASHPTR MODnameHash;
/* holmes: adding XLT2 waveforms 5/18/2011 */
#ifdef LXT2
lxt2_t lxt2;
#endif
};

View File

@ -48,6 +48,11 @@ NON-STANDARD FEATURES
#include "ngspice/miftypes.h"
/*
#ifdef LXT2
#include "ngspice/lxt2_write.h"
#endif
*/
/* ************** */
/* Info structure */

View File

@ -123,4 +123,11 @@ void EVTaccept(
struct dvec *EVTfindvec(char *node);
/*#ifdef LXT2*/
void EVTemitlxt2(
CKTcircuit *ckt, /* The circuit structure */
int node_index, /* The node index of lxt2 data stream */
Evt_Node_t *from); /* Location to event node data to emit to lxt2 */
/*#endif*/
#endif

View File

@ -48,4 +48,6 @@ typedef struct SPICEanalysis SPICEanalysis;
typedef struct runDesc runDesc;
typedef struct lxt2_s lxt2_t;
#endif

View File

@ -691,13 +691,21 @@ show_help(void)
static void
show_version(void)
{
printf("%s compiled from %s revision %s\n"
printf("%s compiled from %s revision(%s) branch(SMBV)\n"
"-----------------------------------------------------\n"
"Written originally by Berkeley University\n"
"Currently maintained by the NGSpice Project\n\n"
"Developed and maintained by the Ngspice Project\n"
"Enhanced by Sherlock Model-Based Verification, L.L.C.\n"
"-----------------------------------------------------\n"
"Copyright (C) 1985-1996,"
" The Regents of the University of California\n"
"Copyright (C) 1999-2011,"
" The NGSpice Project\n", cp_program, PACKAGE, VERSION);
" The NGSpice Project\n"
"Copyright (C) 2001-2012,"
" Tony Bybell\n"
"Copyright (C) 2011-2014,"
" Sherlock Model-Based Verification, L.L.C.\n",
cp_program, PACKAGE, VERSION);
}
#ifdef SIMULATOR

View File

@ -32,6 +32,7 @@ libckt_la_SOURCES = \
ckti2nod.c \
cktic.c \
cktlnkeq.c \
cktlxt2.c \
cktload.c \
cktmapn.c \
cktmask.c \
@ -79,6 +80,8 @@ libckt_la_SOURCES = \
dkerproc.c \
dloadfns.c \
dsetparm.c \
lxt2_init.c \
lxt2_write.c \
naskq.c \
nevalsrc.c \
ninteg.c \

View File

@ -24,9 +24,13 @@ CKTnames(CKTcircuit *ckt, int *numNames, IFuid **nameList)
*nameList = TMALLOC(IFuid, *numNames);
if ((*nameList) == NULL) return(E_NOMEM);
i=0;
printf("Analog Nodes:\n");/* holmes : tracking down node name origins. */
printf("-------------\n");/* holmes : tracking down node name origins. */
for (here = ckt->CKTnodes->next; here; here = here->next) {
printf("%s\n",here->name); /* holmes : tracking down node name origins. */
(*nameList) [i++] = here->name;
}
printf("-------------\n\n");/* holmes : tracking down node name origins. */
return(OK);
}

View File

@ -200,6 +200,13 @@ DCtran(CKTcircuit *ckt,
}
#ifdef XSPICE
#ifdef LXT2
#ifdef LXT2_DEBUG
printf("LXT2 dctran: calling lxt2_init.\n");
printf("job->JOBname(%s)\n", job->JOBname);
#endif
lxt2_init(job->TRANplot);
#endif
/* gtri - begin - wbk - set a breakpoint at end of supply ramping time */
/* must do this after CKTtime set to 0 above */
if(ckt->enh->ramp.ramptime > 0.0)
@ -474,8 +481,15 @@ DCtran(CKTcircuit *ckt,
#ifdef CLUSTER
CLUoutput(ckt);
#endif
if(ckt->CKTtime >= ckt->CKTinitTime)
if(ckt->CKTtime >= ckt->CKTinitTime) {
#ifdef LXT2_DEBUG
printf("dctran CKTdump TIME(%g)\n",ckt->CKTtime); /* holmes: this is where dctran actually saves data to an array or to ascii file. */
#endif
CKTdump(ckt, ckt->CKTtime, job->TRANplot);
#ifdef LXT2
CKTemitlxt2(job->TRANplot);
#endif
}
#ifdef XSPICE
/* gtri - begin - wbk - Update event queues/data for accepted timepoint */
/* Note: this must be done AFTER sending results to SI so it can't */
@ -492,6 +506,11 @@ DCtran(CKTcircuit *ckt,
printf(" done: time is %g, final time is %g, and tol is %g\n",
ckt->CKTtime, ckt->CKTfinalTime, ckt->CKTminBreak);
#endif
#ifdef LXT2
lxt2_end(job->TRANplot);
#endif
SPfrontEnd->OUTendPlot (job->TRANplot);
job->TRANplot = NULL;
UPDATE_STATS(0);

View File

@ -17,6 +17,7 @@ libevtxsp_la_SOURCES = \
evtdeque.c \
evtinit.c \
evtload.c \
evtlxt2.c \
evtnode_copy.c \
evtplot.c \
evtqueue.c \

View File

@ -207,14 +207,19 @@ static int EVTcheck_nodes(
CKTnode *analog_node;
Evt_Node_Info_t *event_node;
int evtNodeIsTested;
static char *err_prefix = "ERROR - node ";
static char *err_collide = " cannot be both analog and digital";
/* Report error if any analog node name matches any event node name */
event_node = ckt->evt->info.node_list;
printf("Event Driven Nodes:\n"); /* holmes : would like these listed a tran init with their types and values */
printf("-------------------\n"); /* holmes : would like these listed a tran init with their types and values */
while(event_node) {
analog_node = ckt->CKTnodes;
evtNodeIsTested = 0;
while(analog_node) {
if(strcmp(event_node->name, analog_node->name) == 0) {
errMsg = TMALLOC(char, strlen(err_prefix) + strlen(event_node->name) + strlen(err_collide) + 1);
@ -223,11 +228,15 @@ static int EVTcheck_nodes(
err_collide);
fprintf(stdout, "%s\n", errMsg);
return(E_PRIVATE);
evtNodeIsTested = 1;
}
analog_node = analog_node->next;
}
if (evtNodeIsTested == 0) printf("%s\n", event_node->name); /* holmes : would like these listed after DCOP/TRAN init with their types and values */
event_node = event_node->next;
}
printf("-------------------\n\n"); /* holmes : would like these listed a tran init with their types and values */
/* Return */
return(OK);

View File

@ -232,6 +232,12 @@ int EVTiter(
/* resolved node value has not changed */
if(g_mif_info.circuit.anal_type == MIF_TRAN) {
#ifdef LXT2
#ifdef LXT2_DEBUG
printf("LXT2 evtiter.c: EVTemitlxt2\n");
#endif
EVTemitlxt2(ckt,node_index,&(rhsold[node_index]));
#endif
node = *(node_data->tail[node_index]);
node_data->tail[node_index] = &(node->next);
EVTnode_copy(ckt, node_index, &(rhsold[node_index]), &(node->next));