Added debug tracing. Activated by defining TRACE

This commit is contained in:
sjborley 2005-05-10 21:31:20 +00:00
parent 0a78434a17
commit 75fe905cc9
2 changed files with 44 additions and 4 deletions

View File

@ -51,6 +51,11 @@ INP2M (void *ckt, INPtables * tab, card * current)
void *mdfast; /* pointer to the actual model */
IFuid uid; /* uid for default model */
#ifdef TRACE
/* SJB debug statement */
printf("INP2M: Parsing '%s'\n",current->line);
#endif
nodeflag = 0; /* initially specify a 4 terminal device */
line = current->line;
INPgetTok (&line, &name, 1);
@ -70,23 +75,39 @@ INP2M (void *ckt, INPtables * tab, card * current)
save = line; /*saj - save the posn for later if
the default mosfet model is used */
thismodel = (INPmodel *) NULL;
#ifdef TRACE
/* SJB debug statement */
printf("INP2M: checking for 4 node device\n");
#endif
INPgetMod (ckt, nname5, &thismodel, tab);
if (thismodel == NULL)
{ /* 5th token is not a model in the table */
nodeflag = 1; /* now specify a 5 node device */
INPgetNetTok (&line, &nname6, 1); /* get next token */
thismodel = (INPmodel *) NULL;
#ifdef TRACE
/* SJB debug statement */
printf("INP2M: checking for 5 node device\n");
#endif
INPgetMod (ckt, nname6, &thismodel, tab);
if (thismodel == NULL)
{ /* 6th token is not a model in the table */
nodeflag = 2; /* now specify a 6 node device */
INPgetNetTok (&line, &nname7, 1); /* get next token */
thismodel = (INPmodel *) NULL;
#ifdef TRACE
/* SJB debug statement */
printf("INP2M: checking for 6 node device\n");
#endif
INPgetMod (ckt, nname7, &thismodel, tab);
if (thismodel == NULL)
{ /* 7th token is not a model in the table */
nodeflag = 3; /* now specify a 7 node device */
INPgetTok (&line, &model, 1); /* get model name */
#ifdef TRACE
/* SJB debug statement */
printf("INP2M: checking for 7 node device\n");
#endif
INPgetMod (ckt, model, &thismodel, tab); /* get pointer to the model */
if (thismodel != NULL)
{
@ -108,6 +129,10 @@ INP2M (void *ckt, INPtables * tab, card * current)
}
/*saj unbreak the default model creation*/
else{
#ifdef TRACE
/* SJB debug statement */
printf("INP2M: couldn't workout number of nodes, assuming 4\n");
#endif
model = nname5;/*mosfet*/
line = save; /* reset the posn to what it sould be */
}
@ -162,6 +187,10 @@ INP2M (void *ckt, INPtables * tab, card * current)
INPinsert (&model, tab);
thismodel = (INPmodel *) NULL;
#ifdef TRACE
/* SJB debug statement */
printf("INP2M: Looking up model\n");
#endif
current->error = INPgetMod (ckt, model, &thismodel, tab);
if (thismodel != NULL)
{

View File

@ -16,6 +16,9 @@ Author: 1985 Thomas L. Quarles
/* gtri - end - wbk - 11/9/90 */
#endif
/* uncomment to trace in this file */
/*#define TRACE*/
/* pass 2 - Scan through the lines. ".model" cards have processed in
* pass1 and are ignored here. */
@ -47,12 +50,20 @@ void INPpas2(void *ckt, card * data, INPtables * tab, void *task)
INPerrCat(data->error,
INPmkTemp
("can't insert internal ground node in symbol table!\n"));
#ifdef TRACE
printf("Examining this deck:\n");
for (current = data; current != NULL; current = current->nextcard) {
printf("%s\n", current->line);
}
printf("\n");
#endif
for (current = data; current != NULL; current = current->nextcard) {
#ifdef TRACE
/* SDB debug statement */
printf("In INPpas2, examining card %s . . .\n", current->line);
/* SDB debug statement */
printf("In INPpas2, examining card %s . . .\n", current->line);
#endif
c = *(current->line);
@ -70,8 +81,8 @@ void INPpas2(void *ckt, card * data, INPtables * tab, void *task)
/* gtri - add - wbk - 10/23/90 - add case for 'A' devices */
case 'A': /* Aname <cm connections> <mname> */
MIF_INP2A(ckt,tab,current);
break;
MIF_INP2A(ckt,tab,current);
break;
/* gtri - end - wbk - 10/23/90 */
#endif