From 08c4ffca8d5e75644c667a04d80ca9e8d9af12b5 Mon Sep 17 00:00:00 2001 From: Jim Holmes Date: Sat, 4 Oct 2014 14:32:16 +0200 Subject: [PATCH] no changes, comment only etc --- src/frontend/outitf.c | 46 ++++++++++++++++++++------------ src/frontend/postcoms.c | 20 +++++++++++++- src/spicelib/analysis/cktdump.c | 1 + src/spicelib/analysis/dctran.c | 12 ++++++--- src/xspice/evt/evtbackup.c | 1 + src/xspice/evt/evtcall_hybrids.c | 1 + src/xspice/evt/evtdeque.c | 1 + src/xspice/evt/evtdump.c | 1 + src/xspice/evt/evtload.c | 2 ++ src/xspice/evt/evtnext_time.c | 1 + src/xspice/evt/evtnode_copy.c | 7 +++++ src/xspice/evt/evtqueue.c | 2 ++ src/xspice/evt/evtsetup.c | 3 +++ src/xspice/evt/evttermi.c | 7 +++++ 14 files changed, 84 insertions(+), 21 deletions(-) diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index ba4355ecf..6fba8119a 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -133,6 +133,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam /*to resume a run saj *All it does is reassign the file pointer and return (requires *runp to be NULL if this is not needed) */ + /* printf("From outitf.c: BEGIN PLOT --------------------------------------------\n"); holmes: find out when this function call is made relative to lxt2 creation. */ if (dataType == 666 && numNames == 666) { run = *runp; run->writeOut = ft_getOutReq(&run->fp, &run->runPlot, &run->binary, @@ -155,7 +156,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam run->windowed = windowed; run->numData = 0; - an_name = spice_analysis_get_name(analysisPtr->JOBtype); + an_name = spice_analysis_get_name(analysisPtr->JOBtype); /* holmes: get the analysis name */ ft_curckt->ci_last_an = an_name; /* Now let's see which of these things we need. First toss in the @@ -163,12 +164,12 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam * us to save that we can find in the name list. Finally unpack * the remaining saves into parameters. */ - numsaves = ft_getSaves(&saves); + numsaves = ft_getSaves(&saves); /* holmes: retrieve the "saveable" information. Each saveable thing can come from one or more analyses. */ if (numsaves) { - savesused = TMALLOC(bool, numsaves); - saveall = FALSE; + savesused = TMALLOC(bool, numsaves); /* holmes: looks like an index for tagging which things the user wants saved. */ + saveall = FALSE; /* holmes: Start with the lowest cost assumption, not saving anything */ for (i = 0; i < numsaves; i++) { - if (saves[i].analysis && !cieq(saves[i].analysis, an_name)) { + if (saves[i].analysis && !cieq(saves[i].analysis, an_name)) { /* holmes: if the saveable things match the current analysis tag it as usable for this analysis. */ /* ignore this one this time around */ savesused[i] = TRUE; continue; @@ -176,7 +177,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam /* Check for ".save all" and new synonym ".save allv" */ - if (cieq(saves[i].name, "all") || cieq(saves[i].name, "allv")) { + if (cieq(saves[i].name, "all") || cieq(saves[i].name, "allv")) { /* holmes: tag all voltages */ saveall = TRUE; savesused[i] = TRUE; saves[i].used = 1; @@ -185,7 +186,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam /* And now for the new ".save alli" option */ - if (cieq(saves[i].name, "alli")) { + if (cieq(saves[i].name, "alli")) { /* holmes: tag all voltages */ savealli = TRUE; savesused[i] = TRUE; saves[i].used = 1; @@ -196,9 +197,9 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam /* Pass 0. */ if (refName) { - addDataDesc(run, refName, refType, -1); + addDataDesc(run, refName, refType, -1); /* Adding a data description to a particular analysis run */ for (i = 0; i < numsaves; i++) - if (!savesused[i] && name_eq(saves[i].name, refName)) { + if (!savesused[i] && name_eq(saves[i].name, refName)) { /* holmes: not sure what refName is, simulator reference node, (time?) ac/xfer analysis */ savesused[i] = TRUE; saves[i].used = 1; } @@ -209,17 +210,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++) { /* holmes: dataName is from Ngspice process, does not include Xspice process */ printf("saves[%d].name(%s)\n",i,saves[i].name); - if (!savesused[i]) + if (!savesused[i]) { for (j = 0; j < numNames; j++) - if (name_eq(saves[i].name, dataNames[j])) { + if (name_eq(saves[i].name, dataNames[j])) { /* holmes: if user specifies XSPICE nodes they are ignored */ 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++) @@ -335,7 +337,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam addSpecialDesc(run, saves[i].name, namebuf, parambuf, depind); } - if (numsaves) { + if (numsaves) { /* holmes: all data descriptions are now attached to the run, so free up scratch pad. */ for (i = 0; i < numsaves; i++) { tfree(saves[i].analysis); tfree(saves[i].name); @@ -385,7 +387,7 @@ addDataDesc(runDesc *run, char *name, int type, int ind) dataDesc *data; if (!run->numData) - run->data = TMALLOC(dataDesc, 1); + run->data = TMALLOC(dataDesc, 1); /* holmes: a data descriptions is added to the run */ else run->data = TREALLOC(dataDesc, run->data, run->numData + 1); @@ -459,12 +461,14 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) if (run->writeOut) { + /* printf("OUTpData run->writeout is true\n"); holmes */ if (run->pointCount == 1) fileInit_pass2(run); fileStartPoint(run->fp, run->binary, run->pointCount); if (run->refIndex != -1) { + /* printf("OUTpData run->refIndex = -1\n"); holmes */ if (run->isComplex) { fileAddComplexValue(run->fp, run->binary, refValue->cValue); @@ -484,6 +488,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) } else { /* And the same for a non-complex value */ + /* printf("OUTpData non-complex fileAddRealValue\n"); holmes */ fileAddRealValue(run->fp, run->binary, refValue->rValue); #ifndef HAS_WINGUI @@ -509,9 +514,11 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) #endif if (run->data[i].regular) { - if (run->data[i].type == IF_REAL) + if (run->data[i].type == IF_REAL) { + /* printf("OUTpData non-complex fileAddRealValue regular IF_REAL.\n"); holmes */ fileAddRealValue(run->fp, run->binary, valuePtr->v.vec.rVec [run->data[i].outIndex]); + } else if (run->data[i].type == IF_COMPLEX) fileAddComplexValue(run->fp, run->binary, valuePtr->v.vec.cVec [run->data[i].outIndex]); @@ -555,6 +562,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) } + /* printf("OUTpData fileEndPoint.\n"); holmes */ fileEndPoint(run->fp, run->binary); /* Check that the write to disk completed successfully, otherwise abort */ @@ -890,10 +898,14 @@ fileStartPoint(FILE *fp, bool bin, int num) static void fileAddRealValue(FILE *fp, bool bin, double value) { - if (bin) + if (bin) { rowbuf[column++] = value; - else + /* printf("writing data to binary file\n"); holmes: Is this used in dctran? */ + } + else { + /* printf("writing data to ascii file\n"); holmes: Is this used in dctran? */ fprintf(fp, "\t%.*e\n", DOUBLE_PRECISION, value); + } } diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index e2698c282..8f22a9ed6 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -404,12 +404,13 @@ com_write(wordlist *wl) if (wl) names = ft_getpnames(wl, TRUE); else - names = ft_getpnames(&all, TRUE); + names = ft_getpnames(&all, TRUE); /* holmes: ft_getnames-all not getting event driven names */ if (names == NULL) return; for (pn = names; pn; pn = pn->pn_next) { + /* printf("n->pn_name(%s)\n", n->pn_name); holmes: print the node name */ d = ft_evaluate(pn); if (!d) goto done; @@ -453,6 +454,7 @@ com_write(wordlist *wl) if (vec_eq(d, tpl->pl_scale)) { newplot.pl_scale = vv; scalefound = TRUE; + /* printf("scalefound = TRUE\n"); holmes: */ } } } @@ -472,21 +474,37 @@ com_write(wordlist *wl) */ for (;;) { scalefound = FALSE; + /* printf("--------for;;----------------\n"); holmes: */ for (d = newplot.pl_dvecs; d; d = d->v_next) { + /* printf("----------------------------\n"); holmes: + printf("d(%p)\n", d); + printf("d->v_name(%s)\n", d->v_name); + printf("d->v_type(%i)\n", d->v_type); + printf("d->v_length(%i)\n", d->v_length); + printf("d->v_next(%p)\n", d->v_next); + printf("d->v_link2(%p)\n", d->v_link2); + printf("d->v_scale(%p)\n", d->v_scale);*/ + /* if ((d->v_type<2) && d->v_scale) { */ if (d->v_scale) { for (vv = newplot.pl_dvecs; vv; vv = vv->v_next) { + /* printf("vv(%p)\n", vv); holmes: */ if (vec_eq(vv, d->v_scale)) { + /* printf("data equivalent vv(%p) d->v_scale(%p)\n", vv, d->v_scale); holmes: */ break; } } /* We have to grab it... */ if(vv && d->v_scale && vec_eq(vv, d->v_scale)) { /* holmes: */ + /* printf("2nd data equivalent vv(%p) d->v_scale(%p)\n", vv, d->v_scale); holmes: */ } /* holmes: */ else { /* holmes: */ vv = vec_copy(d->v_scale); + /* printf("copy vv(%p) from d->v_scale(%p)\n", vv, d->v_scale); holmes: */ vv->v_next = newplot.pl_dvecs; + /* printf("move to vv->v_next(%p)\n", vv); holmes: */ newplot.pl_dvecs = vv; scalefound = TRUE; + /* printf("scalefound\n"); */ } /* holmes: */ } } diff --git a/src/spicelib/analysis/cktdump.c b/src/spicelib/analysis/cktdump.c index 2c689331f..880dd5ae6 100644 --- a/src/spicelib/analysis/cktdump.c +++ b/src/spicelib/analysis/cktdump.c @@ -41,6 +41,7 @@ CKTdump(CKTcircuit *ckt, double ref, void *plot) refData.rValue = ref; valData.v.numValue = ckt->CKTmaxEqNum-1; valData.v.vec.rVec = ckt->CKTrhsOld+1; + /* printf("CKTdump SPfrontEnd->OUTpData(plot,&refData,&valData)\n"); holmes how often is it called? At each break point*/ SPfrontEnd->OUTpData (plot, &refData, &valData); #ifdef CIDER diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index efe6b7715..75bfd2d1e 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -162,14 +162,17 @@ DCtran(CKTcircuit *ckt, g_mif_info.circuit.anal_init = MIF_TRUE; /* gtri - end - wbk */ #endif - error = CKTnames(ckt,&numNames,&nameList); + error = CKTnames(ckt,&numNames,&nameList); /* holmes: returns a list of all analog signal names */ + /* holmes: can make function to get list of evt names here */ + if(error) return(error); SPfrontEnd->IFnewUid (ckt, &timeUid, NULL, "time", UID_OTHER, NULL); + /* printf("dctran1 SPfrontEnd->OUTpBeginPlo(t)\n"); holmes: looking at calls */ error = SPfrontEnd->OUTpBeginPlot (ckt, ckt->CKTcurJob, ckt->CKTcurJob->JOBname, timeUid, IF_REAL, numNames, nameList, IF_REAL, - &(job->TRANplot)); + &(job->TRANplot)); /* holmes: checks what user typed in to save against what is in the circuit */ tfree(nameList); if(error) return(error); @@ -494,8 +497,10 @@ DCtran(CKTcircuit *ckt, /* gtri - begin - wbk - Update event queues/data for accepted timepoint */ /* Note: this must be done AFTER sending results to SI so it can't */ /* go next to CKTaccept() above */ - if(ckt->evt->counts.num_insts > 0) + if(ckt->evt->counts.num_insts > 0) { + /* printf("dctran XSPICE EVTaccept is called;\n"); holmes: looking at calls */ EVTaccept(ckt, ckt->CKTtime); + } /* gtri - end - wbk - Update event queues/data for accepted timepoint */ #endif ckt->CKTstat->STAToldIter = ckt->CKTstat->STATnumIter; @@ -511,6 +516,7 @@ DCtran(CKTcircuit *ckt, lxt2_end(job->TRANplot); #endif + /* printf("dctran XSPICE SPfrontEnd->OUTendPlot(((TRANan*)ckt->CKTcurJob)->TRANplot);\n"); holmes: looking at calls */ SPfrontEnd->OUTendPlot (job->TRANplot); job->TRANplot = NULL; UPDATE_STATS(0); diff --git a/src/xspice/evt/evtbackup.c b/src/xspice/evt/evtbackup.c index fbe2988ea..9d6b59c67 100644 --- a/src/xspice/evt/evtbackup.c +++ b/src/xspice/evt/evtbackup.c @@ -95,6 +95,7 @@ void EVTbackup( double new_time) /* the time to backup to */ { + /* printf("From EVTbackup\n"); holmes */ /* Backup the node data */ EVTbackup_node_data(ckt, new_time); diff --git a/src/xspice/evt/evtcall_hybrids.c b/src/xspice/evt/evtcall_hybrids.c index 8cdb2c9db..744fa7733 100644 --- a/src/xspice/evt/evtcall_hybrids.c +++ b/src/xspice/evt/evtcall_hybrids.c @@ -66,6 +66,7 @@ void EVTcall_hybrids( int *hybrid_index; + /* printf("From EVTcall_hybrids\n"); holmes */ /* Get needed data for fast access */ num_hybrids = ckt->evt->counts.num_hybrids; diff --git a/src/xspice/evt/evtdeque.c b/src/xspice/evt/evtdeque.c index 450e10ae4..199768496 100644 --- a/src/xspice/evt/evtdeque.c +++ b/src/xspice/evt/evtdeque.c @@ -76,6 +76,7 @@ void EVTdequeue( /* Take all items on output queue with matching time */ /* and set changed flags in output queue */ + /* printf("From EVTdequeue\n"); holmes */ EVTdequeue_output(ckt, time); /* Take all items on inst queue with matching time */ diff --git a/src/xspice/evt/evtdump.c b/src/xspice/evt/evtdump.c index b271e3131..f33f089c8 100644 --- a/src/xspice/evt/evtdump.c +++ b/src/xspice/evt/evtdump.c @@ -136,6 +136,7 @@ void EVTdump( Mif_Boolean_t equal; + /* printf("From EVTdump\n"); holmes */ /* Return immediately if IPC is not enabled */ if(! g_ipc.enabled) diff --git a/src/xspice/evt/evtload.c b/src/xspice/evt/evtload.c index d4ace6f19..c3d3a2065 100644 --- a/src/xspice/evt/evtload.c +++ b/src/xspice/evt/evtload.c @@ -112,6 +112,8 @@ int EVTload( void *value_ptr; + /* printf("From EVTload\n"); holmes */ + /* ***************************** */ /* Prepare the code model inputs */ /* ***************************** */ diff --git a/src/xspice/evt/evtnext_time.c b/src/xspice/evt/evtnext_time.c index e2ba382e8..5389306d7 100644 --- a/src/xspice/evt/evtnext_time.c +++ b/src/xspice/evt/evtnext_time.c @@ -67,6 +67,7 @@ double EVTnext_time( Evt_Inst_Queue_t *inst_queue; Evt_Output_Queue_t *output_queue; + /* printf("From EVTnext_time\n"); holmes */ /* Initialize next time to machine infinity */ next_time = 1e30; diff --git a/src/xspice/evt/evtnode_copy.c b/src/xspice/evt/evtnode_copy.c index ec5b13ea0..643b99bb5 100644 --- a/src/xspice/evt/evtnode_copy.c +++ b/src/xspice/evt/evtnode_copy.c @@ -156,4 +156,11 @@ void EVTnode_copy( g_evt_udn_info[udn_index]->copy (from->inverted_value, here->inverted_value); } + /* holmes + if(node_table[node_index]->udn_index == 0) { + printf("From EVTnode_copy Name(%s) time(%g) step(%g) value(%d)\n",node_table[node_index]->name,ckt->CKTtime,from->step,*((int *)(from->node_value))); + } + else { + printf("From EVTnode_copy Name(%s) time(%g) step(%g) value(%g)\n",node_table[node_index]->name,ckt->CKTtime,from->step,*((double *)(from->node_value))); + }*/ } diff --git a/src/xspice/evt/evtqueue.c b/src/xspice/evt/evtqueue.c index c3725e005..b7bd6dbf9 100644 --- a/src/xspice/evt/evtqueue.c +++ b/src/xspice/evt/evtqueue.c @@ -97,6 +97,8 @@ void EVTqueue_output( NG_IGNORE(udn_index); + /* printf("From EVTqueue_output\n"); holmes */ + /* Get pointers for fast access */ output_queue = &(ckt->evt->queue.output); diff --git a/src/xspice/evt/evtsetup.c b/src/xspice/evt/evtsetup.c index d078ad549..5b29ab014 100644 --- a/src/xspice/evt/evtsetup.c +++ b/src/xspice/evt/evtsetup.c @@ -99,6 +99,7 @@ int EVTsetup( int err; + /* printf("From EVTsetup\n"); holmes */ /* Exit immediately if no event-driven instances in circuit */ if(ckt->evt->counts.num_insts == 0) @@ -459,6 +460,8 @@ static int EVTsetup_jobs( jobs->msg_data[i] = data->msg; jobs->statistics[i] = data->statistics; + /* printf("From evtsetup.c jobs->job_name[num_jobs(%d)](%s)\n",i,jobs->job_name[i]); holmes: looking at jobs */ + return(OK); } diff --git a/src/xspice/evt/evttermi.c b/src/xspice/evt/evttermi.c index ab7429b8e..e5b9cd438 100644 --- a/src/xspice/evt/evttermi.c +++ b/src/xspice/evt/evttermi.c @@ -132,6 +132,7 @@ void EVTtermInsert( int output_subindex; + /* printf("From EVTtermInsert\n"); holmes */ /* Get the instance index and create new entry in inst */ /* info list if this is a new instance. */ @@ -188,6 +189,7 @@ static void EVTinst_insert( NG_IGNORE(err_msg); + /* printf("From EVTinst_insert M(%s) I(%s)\n",fast->MIFmodPtr->MIFmodName,fast->MIFname); holmes: Might be the way in for SDF annotation */ /* Scan list of instances in event structure to see if already there */ /* and get the index */ @@ -260,6 +262,7 @@ static void EVTnode_insert( Evt_Inst_Index_t *inst; Evt_Inst_Index_t **inst_ptr; + /* printf("From EVTnode_insert M(%s) I(%s) N(%s) Type(%s)\n",fast->MIFmodPtr->MIFmodName,fast->MIFname,node_name,type_name); holmes: Might be the way in for SDF annotation */ /* *************************************** */ /* Get and check the node type information */ @@ -417,6 +420,8 @@ static void EVTport_insert( NG_IGNORE(err_msg); + /* printf("From EVTnode_insert M(%s) I(%s) P(%s)\n",fast->MIFmodPtr->MIFmodName,fast->MIFname,node_name); holmes: Might be the way in for SDF annotation */ + /* Find the end of the port info list */ port = ckt->evt->info.port_list; port_ptr = &(ckt->evt->info.port_list); @@ -481,6 +486,8 @@ static void EVToutput_insert( NG_IGNORE(err_msg); + /* printf("From EVTport_insert I(%s)\n",fast->MIFname); holmes: Might be the way in for SDF annotation */ + /* Find the end of the port info list */ output = ckt->evt->info.output_list; output_ptr = &(ckt->evt->info.output_list);