blob: 1d6fea5d01218cca391fae0d3b2a6ca5418f33fb [file] [log] [blame] [edit]
* Transistor Vth
.lib ../../../libraries/sky130_fd_pr/PDKVERSION/models/sky130.lib.spice CORNER
* Gate bias
Rg 1 2 680
X1 3 2 0 0 DEVICENAME W=3.0 L=0.15 M=1
Rd 3 4 100
* DC source for current measure
Vid 4 5 DC 0V
Vgb 1 0 DC 0V
Vdd 5 0 DC 0V
.control
save @m.x1.mDEVICENAME[vth] V(1) V(3)
* Sweep Vds from 0 to 1.8V
dc Vdd 0 1.8 0.01 Vgb 0 1.2 0.01
echo threshold voltage
* NOTE: Internally accessed names MUST be in lowercase
print mean(@m.x1.mDEVICENAME[vth])
quit
.endc
.end