Jspice3
traparse.c File Reference
#include "spice.h"
#include <stdio.h>
#include "inpdefs.h"
#include "inpmacs.h"
Include dependency graph for traparse.c:

Go to the source code of this file.

Functions

void TRAparse (int type, GENERIC *ckt, GENERIC *tabp, GENERIC *currentp)
 

Function Documentation

void TRAparse ( int  type,
GENERIC ckt,
GENERIC tabp,
GENERIC currentp 
)

Definition at line 15 of file traparse.c.

21 {
22  /* lossless transmission line parser */
23 
24  /* Tname <node> <node> <node> <node> [TD=<val>]
25  * [F=<val> [NL=<val>]][IC=<val>,<val>,<val>,<val>]
26  */
27 
28  INPtables *tab = (INPtables*)tabp;
29  card *current = (card*)currentp;
30 
31  char *line; /* the part of the current line left to parse */
32  char *name; /* the device's name */
33  char *nname1; /* the first node's name */
34  char *nname2; /* the second node's name */
35  char *nname3; /* the third node's name */
36  char *nname4; /* the fourth node's name */
37  GENERIC *node1; /* the first node's node pointer */
38  GENERIC *node2; /* the second node's node pointer */
39  GENERIC *node3; /* the third node's node pointer */
40  GENERIC *node4; /* the fourth node's node pointer */
41  int error; /* error code temporary */
42  GENERIC *fast; /* pointer to the actual instance */
43  int waslead; /* flag to indicate that unlabeled number was found */
44  double leadval; /* actual value of unlabeled number */
45  IFuid uid; /* uid for default model */
46 
47  line = current->line;
48  INPgetTok(&line,&name,1);
49  INPinsert(&name,tab);
50 
51  INPgetTok(&line,&nname1,1);
52  INPtermInsert(ckt,&nname1,tab,&node1);
53 
54  INPgetTok(&line,&nname2,1);
55  INPtermInsert(ckt,&nname2,tab,&node2);
56 
57  INPgetTok(&line,&nname3,1);
58  INPtermInsert(ckt,&nname3,tab,&node3);
59 
60  INPgetTok(&line,&nname4,1);
61  INPtermInsert(ckt,&nname4,tab,&node4);
62 
63  if (!tab->defTmod) {
64  /* create deafult T model */
65  IFnewUid(ckt,&uid,(IFuid)NULL,"T",UID_MODEL,(GENERIC**)NULL);
66  IFC(newModel,(ckt,type,&(tab->defTmod),uid))
67  }
68  IFC(newInstance,(ckt,tab->defTmod,&fast,name))
69  IFC(bindNode,(ckt,fast,1,node1))
70  IFC(bindNode,(ckt,fast,2,node2))
71  IFC(bindNode,(ckt,fast,3,node3))
72  IFC(bindNode,(ckt,fast,4,node4))
73  PARSECALL((&line,ckt,type,fast,&leadval,&waslead,tab))
74 }
char * line
Definition: inpdefs.h:64
int INPtermInsert()
int IFnewUid()
Definition: inpdefs.h:62
#define UID_MODEL
Definition: ifsim.h:83
Definition: subckt.c:51
int INPinsert()
Definition: fteinp.h:14
GENERIC * IFuid
Definition: ifsim.h:72
#define NULL
Definition: spdefs.h:121
Definition: types.c:18
#define IFC(func, args)
Definition: inpmacs.h:19
#define PARSECALL(args)
Definition: inpmacs.h:42
GENERIC * defTmod
Definition: inpdefs.h:54
char GENERIC
Definition: ifsim.h:27
int INPgetTok()