Re-formatting
This commit is contained in:
parent
9cfbb2bc8c
commit
f8d341b05a
|
|
@ -34,7 +34,7 @@ void INPpas2(CKTcircuit *ckt, struct card *data, INPtables * tab, TSKtask *task)
|
||||||
char *groundname = "0";
|
char *groundname = "0";
|
||||||
char *gname;
|
char *gname;
|
||||||
CKTnode *gnode;
|
CKTnode *gnode;
|
||||||
int error; /* used by the macros defined above */
|
int error; /* used by the macros defined above */
|
||||||
#ifdef HAS_PROGREP
|
#ifdef HAS_PROGREP
|
||||||
int linecount = 0, actcount = 0;
|
int linecount = 0, actcount = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -45,28 +45,28 @@ void INPpas2(CKTcircuit *ckt, struct card *data, INPtables * tab, TSKtask *task)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
error = INPgetTok(&groundname, &gname, 1);
|
error = INPgetTok(&groundname, &gname, 1);
|
||||||
if (error)
|
if (error) {
|
||||||
data->error =
|
data->error =
|
||||||
INPerrCat(data->error,
|
INPerrCat(data->error,
|
||||||
INPmkTemp
|
INPmkTemp
|
||||||
("can't read internal ground node name!\n"));
|
("can't read internal ground node name!\n"));
|
||||||
|
}
|
||||||
error = INPgndInsert(ckt, &gname, tab, &gnode);
|
error = INPgndInsert(ckt, &gname, tab, &gnode);
|
||||||
if (error && error != E_EXISTS)
|
if (error && error != E_EXISTS) {
|
||||||
data->error =
|
data->error =
|
||||||
INPerrCat(data->error,
|
INPerrCat(data->error,
|
||||||
INPmkTemp
|
INPmkTemp
|
||||||
("can't insert internal ground node in symbol table!\n"));
|
("can't insert internal ground node in symbol table!\n"));
|
||||||
|
}
|
||||||
#ifdef TRACE
|
|
||||||
|
#ifdef TRACE
|
||||||
printf("Examining this deck:\n");
|
printf("Examining this deck:\n");
|
||||||
for (current = data; current != NULL; current = current->nextcard) {
|
for (current = data; current != NULL; current = current->nextcard) {
|
||||||
printf("%s\n", current->line);
|
printf("%s\n", current->line);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAS_PROGREP
|
#ifdef HAS_PROGREP
|
||||||
for (current = data; current != NULL; current = current->nextcard)
|
for (current = data; current != NULL; current = current->nextcard)
|
||||||
linecount++;
|
linecount++;
|
||||||
|
|
@ -75,195 +75,195 @@ void INPpas2(CKTcircuit *ckt, struct card *data, INPtables * tab, TSKtask *task)
|
||||||
for (current = data; current != NULL; current = current->nextcard) {
|
for (current = data; current != NULL; current = current->nextcard) {
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
/* SDB debug statement */
|
/* SDB debug statement */
|
||||||
printf("In INPpas2, examining card %s . . .\n", current->line);
|
printf("In INPpas2, examining card %s . . .\n", current->line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_PROGREP
|
#ifdef HAS_PROGREP
|
||||||
if (linecount > 0) {
|
if (linecount > 0) {
|
||||||
SetAnalyse( "Parse", (int) (1000.*actcount/linecount));
|
SetAnalyse( "Parse", (int) (1000.*actcount/linecount));
|
||||||
actcount++;
|
actcount++;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Current_parse_line = current->linenum_orig;
|
Current_parse_line = current->linenum_orig;
|
||||||
Sourcefile = current->linesource;
|
Sourcefile = current->linesource;
|
||||||
|
|
||||||
c = *(current->line);
|
c = *(current->line);
|
||||||
if(islower_c(c))
|
if(islower_c(c))
|
||||||
c = toupper_c(c);
|
c = toupper_c(c);
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
||||||
case ' ':
|
case ' ':
|
||||||
/* blank line (space leading) */
|
/* blank line (space leading) */
|
||||||
case '\t':
|
case '\t':
|
||||||
/* blank line (tab leading) */
|
/* blank line (tab leading) */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef XSPICE
|
#ifdef XSPICE
|
||||||
/* gtri - add - wbk - 10/23/90 - add case for 'A' devices */
|
/* gtri - add - wbk - 10/23/90 - add case for 'A' devices */
|
||||||
|
|
||||||
case 'A': /* Aname <cm connections> <mname> */
|
case 'A': /* Aname <cm connections> <mname> */
|
||||||
MIF_INP2A(ckt, tab, current);
|
MIF_INP2A(ckt, tab, current);
|
||||||
ckt->CKTadevFlag = 1; /* an 'A' device is requested */
|
ckt->CKTadevFlag = 1; /* an 'A' device is requested */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* gtri - end - wbk - 10/23/90 */
|
/* gtri - end - wbk - 10/23/90 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case 'R':
|
case 'R':
|
||||||
/* Rname <node> <node> [<val>][<mname>][w=<val>][l=<val>] */
|
/* Rname <node> <node> [<val>][<mname>][w=<val>][l=<val>] */
|
||||||
INP2R(ckt, tab, current);
|
INP2R(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'C':
|
case 'C':
|
||||||
/* Cname <node> <node> <val> [IC=<val>] */
|
/* Cname <node> <node> <val> [IC=<val>] */
|
||||||
INP2C(ckt, tab, current);
|
INP2C(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'L':
|
case 'L':
|
||||||
/* Lname <node> <node> <val> [IC=<val>] */
|
/* Lname <node> <node> <val> [IC=<val>] */
|
||||||
INP2L(ckt, tab, current);
|
INP2L(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'G':
|
case 'G':
|
||||||
/* Gname <node> <node> <node> <node> <val> */
|
/* Gname <node> <node> <node> <node> <val> */
|
||||||
INP2G(ckt, tab, current);
|
INP2G(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'E':
|
case 'E':
|
||||||
/* Ename <node> <node> <node> <node> <val> */
|
/* Ename <node> <node> <node> <node> <val> */
|
||||||
INP2E(ckt, tab, current);
|
INP2E(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'F':
|
case 'F':
|
||||||
/* Fname <node> <node> <vname> <val> */
|
/* Fname <node> <node> <vname> <val> */
|
||||||
INP2F(ckt, tab, current);
|
INP2F(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'H':
|
case 'H':
|
||||||
/* Hname <node> <node> <vname> <val> */
|
/* Hname <node> <node> <vname> <val> */
|
||||||
INP2H(ckt, tab, current);
|
INP2H(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'D':
|
case 'D':
|
||||||
/* Dname <node> <node> <model> [<val>] [OFF] [IC=<val>] */
|
/* Dname <node> <node> <model> [<val>] [OFF] [IC=<val>] */
|
||||||
INP2D(ckt, tab, current);
|
INP2D(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'J':
|
case 'J':
|
||||||
/* Jname <node> <node> <node> <model> [<val>] [OFF]
|
/* Jname <node> <node> <node> <model> [<val>] [OFF]
|
||||||
|
[IC=<val>,<val>] */
|
||||||
|
INP2J(ckt, tab, current);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Z':
|
||||||
|
/* Zname <node> <node> <node> <model> [<val>] [OFF]
|
||||||
[IC=<val>,<val>] */
|
[IC=<val>,<val>] */
|
||||||
INP2J(ckt, tab, current);
|
INP2Z(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Z':
|
case 'M':
|
||||||
/* Zname <node> <node> <node> <model> [<val>] [OFF]
|
/* Mname <node> <node> <node> <node> <model> [L=<val>]
|
||||||
[IC=<val>,<val>] */
|
[W=<val>] [AD=<val>] [AS=<val>] [PD=<val>]
|
||||||
INP2Z(ckt, tab, current);
|
[PS=<val>] [NRD=<val>] [NRS=<val>] [OFF]
|
||||||
break;
|
[IC=<val>,<val>,<val>] */
|
||||||
|
INP2M(ckt, tab, current);
|
||||||
case 'M':
|
break;
|
||||||
/* Mname <node> <node> <node> <node> <model> [L=<val>]
|
|
||||||
[W=<val>] [AD=<val>] [AS=<val>] [PD=<val>]
|
|
||||||
[PS=<val>] [NRD=<val>] [NRS=<val>] [OFF]
|
|
||||||
[IC=<val>,<val>,<val>] */
|
|
||||||
INP2M(ckt, tab, current);
|
|
||||||
break;
|
|
||||||
#ifdef OSDI
|
#ifdef OSDI
|
||||||
case 'N':
|
case 'N':
|
||||||
/* Nname [<node>...] [<mname>] */
|
/* Nname [<node>...] [<mname>] */
|
||||||
INP2N(ckt, tab, current);
|
INP2N(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 'O':
|
case 'O':
|
||||||
/* Oname <node> <node> <node> <node> <model>
|
/* Oname <node> <node> <node> <node> <model>
|
||||||
[IC=<val>,<val>,<val>,<val>] */
|
[IC=<val>,<val>,<val>,<val>] */
|
||||||
INP2O(ckt, tab, current);
|
INP2O(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
/* Vname <node> <node> [ [DC] <val>] [AC [<val> [<val> ] ] ]
|
/* Vname <node> <node> [ [DC] <val>] [AC [<val> [<val> ] ] ]
|
||||||
[<tran function>] */
|
[<tran function>] */
|
||||||
INP2V(ckt, tab, current);
|
INP2V(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'I':
|
case 'I':
|
||||||
/* Iname <node> <node> [ [DC] <val>] [AC [<val> [<val> ] ] ]
|
/* Iname <node> <node> [ [DC] <val>] [AC [<val> [<val> ] ] ]
|
||||||
[<tran function>] */
|
[<tran function>] */
|
||||||
INP2I(ckt, tab, current);
|
INP2I(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Q':
|
case 'Q':
|
||||||
/* Qname <node> <node> <node> [<node>] <model> [<val>] [OFF]
|
/* Qname <node> <node> <node> [<node>] <model> [<val>] [OFF]
|
||||||
[IC=<val>,<val>] */
|
[IC=<val>,<val>] */
|
||||||
INP2Q(ckt, tab, current, gnode);
|
INP2Q(ckt, tab, current, gnode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
/* Tname <node> <node> <node> <node> [TD=<val>]
|
/* Tname <node> <node> <node> <node> [TD=<val>]
|
||||||
[F=<val> [NL=<val>]][IC=<val>,<val>,<val>,<val>] */
|
[F=<val> [NL=<val>]][IC=<val>,<val>,<val>,<val>] */
|
||||||
INP2T(ckt, tab, current);
|
INP2T(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
case 'S':
|
||||||
/* Sname <node> <node> <node> <node> [<modname>] [IC] */
|
/* Sname <node> <node> <node> <node> [<modname>] [IC] */
|
||||||
INP2S(ckt, tab, current);
|
INP2S(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'W':
|
case 'W':
|
||||||
/* Wname <node> <node> <vctrl> [<modname>] [IC] */
|
/* Wname <node> <node> <vctrl> [<modname>] [IC] */
|
||||||
/* CURRENT CONTROLLED SWITCH */
|
/* CURRENT CONTROLLED SWITCH */
|
||||||
INP2W(ckt, tab, current);
|
INP2W(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'U':
|
case 'U':
|
||||||
/* Uname <node> <node> <model> [l=<val>] [n=<val>] */
|
/* Uname <node> <node> <model> [l=<val>] [n=<val>] */
|
||||||
INP2U(ckt, tab, current);
|
INP2U(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Kspice addition - saj */
|
/* Kspice addition - saj */
|
||||||
case 'P':
|
case 'P':
|
||||||
/* Pname <node> <node> ... <gnd> <node> <node> ... <gnd> [<modname>] */
|
/* Pname <node> <node> ... <gnd> <node> <node> ... <gnd> [<modname>] */
|
||||||
/* R=<vector> L=<matrix> G=<vector> C=<matrix> len=<val> */
|
/* R=<vector> L=<matrix> G=<vector> C=<matrix> len=<val> */
|
||||||
INP2P(ckt, tab, current);
|
INP2P(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
case 'Y':
|
case 'Y':
|
||||||
/* Yname <node> <node> R=<val> L=<val> G=<val> C=<val> len=<val> */
|
/* Yname <node> <node> R=<val> L=<val> G=<val> C=<val> len=<val> */
|
||||||
INP2Y(ckt, tab, current);
|
INP2Y(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
/* end Kspice */
|
/* end Kspice */
|
||||||
|
|
||||||
case 'K':
|
case 'K':
|
||||||
/* Kname Lname Lname <val> */
|
/* Kname Lname Lname <val> */
|
||||||
INP2K(ckt, tab, current);
|
INP2K(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '*': case '$':
|
case '*': case '$':
|
||||||
/* *<anything> - a comment - ignore */
|
/* *<anything> - a comment - ignore */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'B':
|
case 'B':
|
||||||
/* Bname <node> <node> [V=expr] [I=expr] */
|
/* Bname <node> <node> [V=expr] [I=expr] */
|
||||||
/* Arbitrary source. */
|
/* Arbitrary source. */
|
||||||
INP2B(ckt, tab, current);
|
INP2B(ckt, tab, current);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '.': /* .<something> Many possibilities */
|
case '.': /* .<something> Many possibilities */
|
||||||
if (INP2dot(ckt,tab,current,task,gnode))
|
if (INP2dot(ckt,tab,current,task,gnode))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\0':
|
case '\0':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* the un-implemented device */
|
/* the un-implemented device */
|
||||||
LITERR(" unknown device type - error \n");
|
LITERR(" unknown device type - error \n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue