一、常规网表
Inverter
.lib "D:\lib\l0040ll_v1p4_1r.lib" TT .param SUPPLY=.1V
.param T=10ns
.param dt=.02ns
.temp
.global VDD VSS
.option MEASDGT= post *MEASDGT=3表示输出结果保留3位有效数字 VVDD VDD 'SUPPLY' *********** 反相器 ****************
.subckt Inverter
*Inputs
+ in
*Supply
+ VDD GND
*Outputs
+ out XP1 out in VDD VDD p11ll_ckt W=200n L=40n
XN1 out in GND GND n11ll_ckt W=120n L=40n .ends
******************************************** X_Inverter
*Inputs
+ in
*Supply
+ VDD GND
*Outputs
+ out
+ Inverter C_load out 1.5f *Vin in PWL(0n 0V,"T-dt" 0V , T SUPPLY , "2*T-dt" SUPPLY, "2*T" 0V , "3*T-dt" 0V) *--
Vin in PULSE( SUPPLY "T*0.5" 0n 0n "T*0.5" T) _| ̄|_ *测量语句
.Measure tran V_in find V(in) when V(out)="0.1*SUPPLY" rise= .Measure tran pwr AVG P(VVDD) From=0ns To="3*T-dt" .Measure tran Tr trig V(out) val='0.1*SUPPLY' rise=
+ targ V(out) val='0.9*SUPPLY' rise= *瞬态扫描语句
.tran .001n "6*T"
*+ sweep monte=
+ sweep SUPPLY .6V .1V .1V *.print tran V(in) V(out) .probe v(*)
.end
二、直流分析网表
HSPICE demo .LIB ".\cmos25_level49.lib" TT .temp
.plot DC I(M0) VVSS VSS
VVDS D VSS
VVGS G VSS 0.5 .dc VVDS 0.1 sweep VVGS 0.5 2.5 0.5
M0 D G VSS VSS nmos L=.5u W=.8u .end
打开生成的.sw0文件可以看到如下的波形:
Ids:
Vd:
Vg: