-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrev2.sp
More file actions
128 lines (102 loc) · 3.25 KB
/
rev2.sp
File metadata and controls
128 lines (102 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
* Design Problem, ee114/214A- 2018
* Team Member 1 Name: Maggie Ford
* Team Member 2 Name: Andrea Ramirez
* Please fill in the specification achieved by your circuit
* before you submit the netlist.
**************************************************************
* sunetids of team members =
* The specifications that this script achieves are:
* Power =
* Gain =
* BandWidth =
* Spot Noise @ 1kHz =
* FOM =
***************************************************************
** Including the model file
.include /afs/ir.stanford.edu/class/ee114/hspice/ee114_hspice.sp
* Defining Top level circuit parameters
.param Cin = 100f
.param CL = 250f
.param RL = 20k
* Defining Low level circuit parameters
.param Ru = 118400
.param Rd = 137600
* defining the supply voltages
vdd vdd 0 2.5
vss vss 0 -2.5
* defining load mosfet parameters
.param wl1 = 8u
.param ll1 = 2u
.param wl2 = 2u
.param ll2 = 2u
* defining the mosfet parameters
.param w1 = 8u
.param l1 = 2u
.param w2 = 2u
.param l2 = 2u
*.param w3 = 2u
*.param l3 = 2u
* defining bias mosfet parameters
.param wb1 = 8u
.param lb1 = 2u
.param wb2 = 2u
.param lb2 = 2u
*.param wb3 = 2u
*.param lb3 = 2u
* Defining the input current source
* Note, having each source with ac magnitude of 0.5 (as below) ensures a differential input magnitude of 1
** For ac simulation uncomment the following 2 lines**
Iina iina vdd ac 0.5
Iinb vdd iinb ac 0.5
** For transient simulation uncomment the following 2 lines**
*Iina iina vdd sin(0 0.5u 1e6)
*Iinb vdd iinb sin(0 0.5u 1e6)
* Defining Input capacitance
Cina vdd iina 'Cin'
Cinb vdd iinb 'Cin'
* Defining the differential load
*RL vouta voutb 'RL'
*CL vouta voutb 'CL'
*** Your Trans-impedance Amplifier here ***
*** d g s b n/pmos114 w l
*** A Side ***
m1a dra 0 iina vss nmos114 w=w1 l=l1
ml1a dra vbp vdd vdd pmos114 w=wl1 l=ll1
mb1a iina vbn vss vss nmos114 w=wb1 l=lb1
ml2a vdd vdd vouta vss nmos114 w=wl2 l=ll2
m2a vouta dra sba vss nmos114 w=w2 l=l2
mb2a sba vbn vss vss nmos114 w=wb2 l=lb2
*m3a vdd sla vouta vss nmos114 w=w3 l=l3
*mb3a vouta vbn vss vss nmos114 w=wb3 l=lb3
*** B Side ***
m1b drb 0 iinb vss nmos114 w=w1 l=l1
ml1b drb vbp vdd vdd pmos114 w=wl1 l=ll1
mb1b iinb vbn vss vss nmos114 w=wb1 l=lb1
ml2b vdd vdd voutb vss nmos114 w=wl2 l=ll2
m2b voutb drb sba vss nmos114 w=w2 l=l2
mb2b sba vbn vss vss nmos114 w=wb2 l=lb2
*m3b vdd slb voutb vss nmos114 w=w3 l=l3
*mb3b voutb vbn vss vss nmos114 w=wb3 l=lb3
*** Current Bias ***
*** Your Bias Circuitry here ***
vbiasp vbp 0 0.72
vbiasn vbn 0 -1.12
rua vdd dra Ru
rda dra vss Rd
rub vdd drb Ru
rdb drb vss Rd
* defining the analysis
.op
.option post brief nomod
** For ac simulation uncomment the following line**
.ac dec 1k 100 1g
* add line for noise simulation
.measure ac gainmaxa max vdb(vouta)
.measure ac f3dba when vdb(vouta)='gainmaxa-3'
.measure ac gainmaxb max vdb(voutb)
.measure ac f3dbb when vdb(voutb)='gainmaxb-3'
* Note, the statement below gives you the differential gain
.measure ac gaindiff max vdb(vouta, voutb)
** For transient simulation uncomment the following line **
*.tran 0.01u 4u
.end