blob: 8e28605d969b171038c924367fc27bbcc473a737 [file] [log] [blame]
* Transistor Vth
.lib ../../../libraries/sky130_fd_pr/PDKVERSION/models/sky130.lib.spice CORNER
* Gate bias
Rg 1 2 680
X1 3 2 5 5 DEVICENAME W=3.0 L=0.15 M=1
Rd 3 4 100
* DC source for current measure
Vid 4 0 DC 0V
Vgb 5 1 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