-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathldo_v2_sim_jm_3V.sch
273 lines (235 loc) · 6.04 KB
/
ldo_v2_sim_jm_3V.sch
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
v {xschem version=3.4.2 file_version=1.2
}
G {}
K {}
V {}
S {}
E {}
N 3590 -3720 3790 -3720 { lab=#net1}
N 3590 -3810 3590 -3780 { lab=#net2}
N 3590 -3810 3790 -3810 { lab=#net2}
N 3510 -3930 3510 -3820 { lab=vdd}
N 3510 -3930 3930 -3930 { lab=vdd}
N 3930 -3930 3930 -3860 { lab=vdd}
N 4230 -3730 4230 -3710 { lab=ldo_out}
N 4230 -3870 4230 -3790 { lab=vdd}
N 4230 -3760 4330 -3760 { lab=vdd}
N 4330 -3870 4330 -3760 { lab=vdd}
N 4150 -3550 4230 -3550 { lab=pos}
N 4230 -3720 4330 -3720 { lab=ldo_out}
N 4330 -3720 4370 -3720 { lab=ldo_out}
N 4230 -3950 4230 -3870 { lab=vdd}
N 4330 -3950 4330 -3870 { lab=vdd}
N 4230 -3950 4330 -3950 { lab=vdd}
N 4230 -3410 4230 -3370 { lab=GND}
N 4230 -3370 4230 -3360 { lab=GND}
N 3930 -3930 4230 -3930 { lab=vdd}
N 4090 -3760 4190 -3760 { lab=#net3}
N 4090 -3760 4090 -3720 { lab=#net3}
N 3510 -3670 3510 -3650 { lab=GND}
N 3930 -3560 3930 -3540 { lab=GND}
N 4070 -3550 4150 -3550 { lab=pos}
N 4070 -3550 4070 -3400 { lab=pos}
N 3750 -3400 4070 -3400 { lab=pos}
N 3750 -3630 3750 -3400 { lab=pos}
N 3750 -3630 3790 -3630 { lab=pos}
N 3410 -3750 3440 -3750 { lab=en}
N 3030 -3530 3030 -3490 { lab=GND}
N 3030 -3610 3030 -3590 { lab=vdd}
N 2800 -3620 2800 -3600 { lab=en}
N 2800 -3540 2800 -3510 { lab=GND}
N 3030 -3750 3030 -3610 { lab=vdd}
N 4230 -3610 4230 -3500 {
lab=pos}
N 4230 -3710 4230 -3670 {
lab=ldo_out}
N 4230 -3440 4230 -3410 {
lab=GND}
C {bgr2.sym} 2150 -2100 0 0 {name=xb2}
C {Error_Amp.sym} 3030 -2340 0 0 {name=xy1}
C {sky130_fd_pr/pfet_g5v0d10v5.sym} 4210 -3760 0 0 {name=M24
L=0.5
W=10
nf=1
mult=800
ad="'int((nf+1)/2) * W/nf * 0.29'"
pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
as="'int((nf+2)/2) * W/nf * 0.29'"
ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
nrd="'0.29 / W'" nrs="'0.29 / W'"
sa=0 sb=0 sd=0
model=pfet_g5v0d10v5
spiceprefix=X
}
C {devices/lab_pin.sym} 4150 -3550 1 0 {name=l25 sig_type=std_logic lab=pos}
C {devices/gnd.sym} 4230 -3360 0 0 {name=l2 lab=GND}
C {devices/opin.sym} 4320 -3720 0 0 {name=p3 lab=ldo_out
}
C {devices/gnd.sym} 3930 -3540 0 0 {name=l1 lab=GND}
C {devices/gnd.sym} 3510 -3650 0 0 {name=l3 lab=GND}
C {devices/vsource.sym} 3030 -3560 0 0 {name=Vs value=3.5}
C {devices/vsource.sym} 2800 -3570 0 0 {name=Ven value=3.5}
C {devices/lab_pin.sym} 2800 -3620 0 0 {name=l27 sig_type=std_logic lab=en}
C {devices/gnd.sym} 3030 -3490 0 0 {name=l4 lab=GND}
C {devices/gnd.sym} 2800 -3510 0 0 {name=l5 lab=GND}
C {devices/code_shown.sym} 4760 -4550 0 0 {name= SPICE1 only_toplevel="false" value=
"
*.param R=36k
.param R=50k
.save all
R10 ldo_out GND \{R\}
IL ldo_out 0 PWL(0 0.1m 10u 0.1m 20u 10m 30u 10m)
*CL ldo_out gnd 10p
*.lib "/home/mustafa/mabrains/pdks/share/pdk/sky130A/libs.tech/ngspice/sky130.lib_mod.spice" tt
.lib /foss/pdks/sky130A/libs.tech/ngspice/sky130.lib.spice TT
.nodeset v(x1.inn)=1.2
.nodeset v(x1.inp)=1.2
.nodeset v(x1.mir)=1
.nodeset v(x1.net5)=1
.nodeset v(x1.bg_out)=1.1
.nodeset v(ldo_out)=1.8
.nodeset v(pos)=1.1
*.nodeset v(net3)=0.8
*.nodeset v(net1)=0.7
.nodeset v(x1.net6)=0.9
*.nodeset v(net7)=0.75
.nodeset v(xy1.vb)=0.9
.option temp=27
*User_defined_functions
.control
define max(vector_name) (vecmax(vector_name))
define min(vector_name) (vecmin(vector_name))
.endc
*Temp_sweep
.control
alter IL 0
dc temp 85 0 -1
let temp_coeff=1000000*(max(ldo_out)-min(ldo_out))/85
print temp_coeff
plot v(ldo_out)
plot v(pos)
set wr_singlescale
set wr_vecnames
set appendwrite
.endc
*.control
*alter IL 0
**alter R10 1G
*op
*let iq =i(Vs)
*print iq
**print all
*set wr_singlescale
*set wr_vecnames
*set appendwrite
*if v(ldo_out)>1
*wrdata op_point_test v(ldo_out)
*end
*.endc
*Stability_Analysis
*.control
*alter IL 0
*alter Vs AC =0
*alter Vt AC=1
*ac dec 10 1 1G
*plot vdb(out)
*plot (180/pi)*vp(out)
*let ph= (180/pi)*vp(out)
*meas ac pm FIND ph WHEN vdb(out)=0
*.endc
*PSRR_Analysis
.control
alter IL 0
alter Vs AC =1
alter Vt AC=0
alter L1 0
alter C2 0
ac dec 10 1 1G
meas AC PSRR100 FIND vdb(ldo_out) AT=100
meas AC PSRR100k FIND vdb(ldo_out) AT=100k
plot vdb(ldo_out)
.endc
*supply_sweep
*.control
*alter IL 0
*dc Vs 4 0 -0.01
*plot vdd ldo_out
*meas DC Vldo_Sup_2 FIND ldo_out AT=2
*meas DC Vldo_nom FIND ldo_out AT=2.3
*meas DC Vldo_Sup_2_8 FIND ldo_out AT=2.8
*let line_reg = abs((Vldo_Sup_2_8-Vldo_Sup_2)/0.8)
*print line_reg
*meas DC vin WHEN v(ldo_out)=1.764
*let dropout=vin-1.764
*print dropout
*set wr_singlescale
*set wr_vecnames
*set appendwrite
*.endc
*Load_Reg_switches --> commented from before
*V1 c1 0 DC 0 PWL(0 5 20u 5 35u 0 50u 0 100u 0)
*V2 c2 0 DC 0 PWL(0 0 20u 0 35u 0 50u 5 100u 5)
*s1 ldo_out 2 c1 0 switch1 ON
*s2 ldo_out 3 c2 0 switch1 OFF
*.model switch1 sw vt=0.1 ron =0.1 roff =1G
*R1 2 0 18k
*R2 3 0 180
*.control --> commented from before
*alter R10 1G
*tran 0.1u 90u
*plot v(ldo_out) v(c1) v(c2)
*meas TRAN V_ldo_100u FIND v(ldo_out) AT=10u
*meas TRAN V_ldo_10m FIND v(ldo_out) AT=50u
*let load_reg= V_ldo_100u-V_ldo_10m
*print load_reg
*.endc
**Load_Transient
*.control
*alter IL 50u
*alter R10 3600k
*tran 0.1u 100u
*meas TRAN V_ldo_100u FIND v(ldo_out) AT=5u
*meas TRAN V_ldo_10m FIND v(ldo_out) AT=100u
*let load_reg= V_ldo_100u-V_ldo_10m
*let load_current =(-1*i(Vs)-131.8e-6)
*print load_reg
*plot load_current v(ldo_out)-1.8
*.endc
**Transient
*.control
*alter R10 36k
*alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
*alter @Vs[pulse] = [ 1.8 3 10u 10u 1u 100u 200u ]
*alter IL 0
*tran 0.1u 100u
*plot vdd ldo_out
*.endc
*.control
*alter R10 36k
*alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
*alter @Vs[pulse] = [ 0 2.3 10u 0.1u 1u 100u 200u ]
*tran 0.1u 100u
*plot vdd ldo_out
*.endc
*.control
*alter R10 36k
*alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
*alter @Ven[pulse] = [ 0 2.3 10u 0.1u 1u 100u 200u ]
*tran 0.1u 100u
**meas TRAN st_up_time when v(ldo_out)>1.782
*plot ven ldo_out
*.endc
"}
C {devices/lab_pin.sym} 3410 -3750 0 0 {name=l9 sig_type=std_logic lab=en}
C {devices/lab_pin.sym} 3030 -3750 0 0 {name=l6 sig_type=std_logic lab=vdd}
C {devices/lab_pin.sym} 3510 -3930 0 0 {name=l8 sig_type=std_logic lab=vdd}
C {devices/res.sym} 4230 -3640 0 0 {name=RD2
value=7e3
footprint=1206
device=resistor
m=1}
C {devices/res.sym} 4230 -3470 0 0 {name=RD1
value=3e3
footprint=1206
device=resistor
m=1}