Jspice3
Main Page
Data Structures
Files
File List
Globals
mosic.c
Go to the documentation of this file.
1
/***************************************************************************
2
JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3
Copyright 1990 Regents of the University of California. All rights reserved.
4
Authors: 1985 Thomas L. Quarles
5
1989 Takayasu Sakurai
6
1993 Stephen R. Whiteley
7
****************************************************************************/
8
9
#include "
spice.h
"
10
#include <stdio.h>
11
#include "
mosdefs.h
"
12
#include "
sperror.h
"
13
14
15
int
16
MOSgetic
(inModel,ckt)
17
18
GENmodel
*inModel;
19
CKTcircuit
*ckt;
20
{
21
MOSmodel
*
model
= (
MOSmodel
*)inModel;
22
MOSinstance
*here;
23
/*
24
* grab initial conditions out of rhs array. User specified, so use
25
* external nodes to get values
26
*/
27
28
for
( ;
model
; model = model->
MOSnextModel
) {
29
for
(here = model->
MOSinstances
; here;
30
here = here->
MOSnextInstance
) {
31
32
if
(!here->
MOSicVBSGiven
) {
33
here->
MOSicVBS
=
34
*(ckt->
CKTrhs
+ here->
MOSbNode
) -
35
*(ckt->
CKTrhs
+ here->
MOSsNode
);
36
}
37
if
(!here->
MOSicVDSGiven
) {
38
here->
MOSicVDS
=
39
*(ckt->
CKTrhs
+ here->
MOSdNode
) -
40
*(ckt->
CKTrhs
+ here->
MOSsNode
);
41
}
42
if
(!here->
MOSicVGSGiven
) {
43
here->
MOSicVGS
=
44
*(ckt->
CKTrhs
+ here->
MOSgNode
) -
45
*(ckt->
CKTrhs
+ here->
MOSsNode
);
46
}
47
}
48
}
49
return
(
OK
);
50
}
sMOSmodel::MOSnextModel
struct sMOSmodel * MOSnextModel
Definition:
mosdefs.h:274
sMOSmodel::MOSinstances
MOSinstance * MOSinstances
Definition:
mosdefs.h:276
mosdefs.h
sMOSinstance::MOSicVGSGiven
unsigned MOSicVGSGiven
Definition:
mosdefs.h:229
CKTcircuit
Definition:
cktdefs.h:62
sMOSmodel
Definition:
mosdefs.h:272
sMOSinstance::MOSicVDSGiven
unsigned MOSicVDSGiven
Definition:
mosdefs.h:228
sMOSinstance::MOSsNode
int MOSsNode
Definition:
mosdefs.h:27
OK
#define OK
Definition:
iferrmsg.h:17
sperror.h
sMOSinstance::MOSgNode
int MOSgNode
Definition:
mosdefs.h:26
sMOSinstance::MOSicVBS
double MOSicVBS
Definition:
mosdefs.h:63
sMOSinstance::MOSicVBSGiven
unsigned MOSicVBSGiven
Definition:
mosdefs.h:227
MOSgetic
int MOSgetic(GENmodel *inModel, CKTcircuit *ckt)
Definition:
mosic.c:16
sMOSinstance::MOSdNode
int MOSdNode
Definition:
mosdefs.h:25
spice.h
sGENmodel
Definition:
gendefs.h:39
sMOSinstance::MOSicVGS
double MOSicVGS
Definition:
mosdefs.h:65
model
static char model[32]
Definition:
subckt.c:76
sMOSinstance
Definition:
mosdefs.h:18
sMOSinstance::MOSbNode
int MOSbNode
Definition:
mosdefs.h:28
sMOSinstance::MOSnextInstance
struct sMOSinstance * MOSnextInstance
Definition:
mosdefs.h:20
CKTcircuit::CKTrhs
double * CKTrhs
Definition:
cktdefs.h:97
sMOSinstance::MOSicVDS
double MOSicVDS
Definition:
mosdefs.h:64
src
lib
dev
mos
mosic.c
Generated by
1.8.11