5.子电路
-----------------------------------------
子电路的名字要以 X 开头,并且元件名不能超过16个字符,
端口写在前,子电路定义的模块名字写在最后,如:
Xopa1 a b c c OPAMP
举例:反向器链
.global vdd
vdc vdd 0 1.8V
.subckt inv in out wn=0.36u wp=0.72u
mn out in gnd gnd N_18_G2 w=wn l=0.18u
mp out in vdd vdd P_18_G2 w=wp l=0.18u
.ends
x1 in 1 inv wn=0.36u wp=0.72u
x2 1 2 inv wn=0.36u wp=0.72u
x3 2 out inv wn=0.36u wp=0.72u
cl out 0 1pf