Jspice3
Main Page
Data Structures
Files
File List
Globals
mutparse.c
Go to the documentation of this file.
1
/***************************************************************************
2
JSPICE3 adaptation of Spice3e2 - Copyright (c) Stephen R. Whiteley 1992
3
Copyright 1990 Regents of the University of California. All rights reserved.
4
Authors: 1987 Thomas L. Quarles
5
1993 Stephen R. Whiteley
6
****************************************************************************/
7
8
#include "
spice.h
"
9
#include <stdio.h>
10
#include "
inpdefs.h
"
11
#include "
inpmacs.h
"
12
13
void
14
MUTparse
(
type
,ckt,tabp,currentp)
15
16
int
type
;
17
GENERIC
*ckt;
18
GENERIC
*tabp;
19
GENERIC
*currentp;
20
{
21
/* mutual inductance parser */
22
23
/* Kname Lname Lname <val> */
24
25
INPtables
*
tab
= (
INPtables
*)tabp;
26
card
*current = (
card
*)currentp;
27
28
char
*
line
;
/* the part of the current line left to parse */
29
char
*name;
/* the device's name */
30
int
error;
/* error code temporary */
31
GENERIC
*fast;
/* pointer to the actual instance */
32
IFvalue
ptemp;
/* a value structure to package resistance into */
33
IFvalue
*parm;
/* ptr to a value structure for function return values */
34
int
waslead;
/* flag to indicate that unlabeled number was found */
35
double
leadval;
/* actual value of unlabeled number */
36
IFuid
uid;
/* uid for default model */
37
38
line = current->
line
;
39
INPgetTok
(&line,&name,1);
40
INPinsert
(&name,tab);
41
42
if
(!tab->
defKmod
) {
43
/* create deafult K model */
44
IFnewUid
(ckt,&uid,(
IFuid
)
NULL
,
"K"
,
UID_MODEL
,(
GENERIC
**)NULL);
45
IFC
(newModel,(ckt,type,&(tab->
defKmod
),uid))
46
}
47
IFC
(newInstance,(ckt,tab->
defKmod
,&fast,name))
48
49
parm =
INPgetValue
(ckt,&line,
IF_INSTANCE
,tab);
50
GCA
(
INPpName
,(
"inductor1"
,parm,ckt,type,fast))
51
parm =
INPgetValue
(ckt,&line,
IF_INSTANCE
,tab);
52
GCA
(
INPpName
,(
"inductor2"
,parm,ckt,type,fast))
53
54
PARSECALL
((&line,ckt,type,fast,&leadval,&waslead,tab))
55
if
(waslead) {
56
ptemp.
rValue
= leadval;
57
GCA
(
INPpName
,(
"coefficient"
,&ptemp,ckt,type,fast))
58
}
59
}
INPpName
int INPpName()
card::line
char * line
Definition:
inpdefs.h:64
INPgetValue
IFvalue * INPgetValue()
IFnewUid
int IFnewUid()
card
Definition:
inpdefs.h:62
UID_MODEL
#define UID_MODEL
Definition:
ifsim.h:83
tab
Definition:
subckt.c:51
MUTparse
void MUTparse(int type, GENERIC *ckt, GENERIC *tabp, GENERIC *currentp)
Definition:
mutparse.c:14
IF_INSTANCE
#define IF_INSTANCE
Definition:
ifsim.h:112
uIFvalue::rValue
double rValue
Definition:
ifsim.h:233
INPinsert
int INPinsert()
line
Definition:
fteinp.h:14
IFuid
GENERIC * IFuid
Definition:
ifsim.h:72
NULL
#define NULL
Definition:
spdefs.h:121
type
Definition:
types.c:18
inpdefs.h
GCA
#define GCA(func, args)
Definition:
inpmacs.h:27
IFC
#define IFC(func, args)
Definition:
inpmacs.h:19
spice.h
PARSECALL
#define PARSECALL(args)
Definition:
inpmacs.h:42
sINPtables::defKmod
GENERIC * defKmod
Definition:
inpdefs.h:45
inpmacs.h
uIFvalue
Definition:
ifsim.h:231
sINPtables
Definition:
inpdefs.h:30
GENERIC
char GENERIC
Definition:
ifsim.h:27
INPgetTok
int INPgetTok()
src
lib
dev
ind
mutparse.c
Generated by
1.8.11