Jspice3
tranprse.c File Reference
#include "spice.h"
#include "ftedefs.h"
#include "inpdefs.h"
#include "inpmacs.h"
#include "misc.h"
Include dependency graph for tranprse.c:

Go to the source code of this file.

Functions

int TRANparse (GENERIC *ckt, INPtables *tab, int which, GENERIC *currentp, char **line, GENERIC *task, GENERIC *gnode)
 
int ParseTRAN (GENERIC *ckt, char **line, card *current, int which, GENERIC *aptr, INPtables *tab)
 

Function Documentation

int ParseTRAN ( GENERIC ckt,
char **  line,
card current,
int  which,
GENERIC aptr,
INPtables tab 
)

Definition at line 65 of file tranprse.c.

73 {
74  IFvalue ptemp; /* a value structure to package stuff into */
75  IFvalue *parm; /* a pointer to a value struct for function returns */
76  double dtemp; /* random double precision temporary */
77  int error; /* error code temporary */
78 
79  parm = INPgetValue(ckt,line,IF_REAL,tab); /* Tstep */
80  GCA(INPapName,(ckt,which,aptr,"tstep",parm))
81 
82  parm = INPgetValue(ckt,line,IF_REAL,tab); /* Tstop */
83  GCA(INPapName,(ckt,which,aptr,"tstop",parm))
84 
85  if (**line) {
86  dtemp = INPevaluate(line,&error,1); /* tstart? */
87  if (error == 0) {
88  ptemp.rValue = dtemp;
89  GCA(INPapName,(ckt,which,aptr,"tstart",&ptemp))
90  dtemp = INPevaluate(line,&error,1); /* tmax? */
91  if (error == 0) {
92  ptemp.rValue = dtemp;
93  GCA(INPapName,(ckt,which,aptr,"tmax",&ptemp))
94  }
95  }
96  }
97  return (0);
98 }
IFvalue * INPgetValue()
if(TDesc==NULL)
Definition: cd.c:1326
double INPevaluate()
double rValue
Definition: ifsim.h:233
Definition: fteinp.h:14
#define GCA(func, args)
Definition: inpmacs.h:27
#define IF_REAL
Definition: ifsim.h:108
int INPapName()
int TRANparse ( GENERIC ckt,
INPtables tab,
int  which,
GENERIC currentp,
char **  line,
GENERIC task,
GENERIC gnode 
)

Definition at line 17 of file tranprse.c.

31 {
32  GENERIC *foo; /* pointer to analysis */
33  IFvalue ptemp; /* a value structure to package stuff into */
34  int error; /* error code temporary */
35  char *token; /* a token from the line */
36  card *current = (card *)currentp;
37 
38  IFC(newAnalysis,(ckt,which,"transient",&foo,task))
39  GCA(ParseTRAN,(ckt,line,current,which,foo,tab))
40  while (**line) {
41  INPgetTok(line, &token, 1);
42  strtolower(token);
43  if (!strcmp(token,"dc")) {
44  txfree(token);
45  GCA(ParseDC,(ckt,line,current,which,foo,tab,1))
46  if (**line)
47  GCA(ParseDC,(ckt,line,current,which,foo,tab,2))
48  continue;
49  }
50  if (!strcmp(token,"uic")) {
51  txfree(token);
52  ptemp.iValue = 1;
53  GCA(INPapName,(ckt,which,foo,"uic",&ptemp))
54  continue;
55  }
56  LITERR("Unknown parameter on .tran - ignored.")
57  txfree(token);
58  }
59 
60  return (0);
61 }
if(TDesc==NULL)
Definition: cd.c:1326
Definition: inpdefs.h:62
int iValue
Definition: ifsim.h:232
#define LITERR(text)
Definition: inpmacs.h:35
Definition: fteinp.h:14
void txfree()
void strtolower()
#define GCA(func, args)
Definition: inpmacs.h:27
#define IFC(func, args)
Definition: inpmacs.h:19
int ParseDC()
while(TDesc->tSucc!=NULL)
Definition: cd.c:1335
int INPapName()
int ParseTRAN(GENERIC *ckt, char **line, card *current, int which, GENERIC *aptr, INPtables *tab)
Definition: tranprse.c:65
return(True)
char GENERIC
Definition: ifsim.h:27
int INPgetTok()