写一个VerilogA的mosefet模型
时间: 2024-05-02 08:16:45 浏览: 210
下面是一个简单的VerilogA MOSFET模型示例:
```
`timescale 1ns / 1ps
module mosfet_va(vd, vg, vs, id, w, l, tox, u0, vth, lamda, temp, cgs, cgd, cgb, pb, cgso, cgdo, cgbo);
parameter REAL PI = 3.14159265358979323846;
// Define variables
electrical vd, vg, vs, id;
real w, l, tox, u0, vth, lamda, temp;
real cgs, cgd, cgb, pb, cgso, cgdo, cgbo;
real vt, arg, beta, vgs, vds, vgb;
real cgs0, cgd0, cgb0, id0;
real cgs1, cgd1, cgb1, id1;
real cgs2, cgd2, cgb2, id2;
// Define constants
real eps0 = 8.85e-12;
real epsr = 3.9;
real q = 1.6e-19;
real kb = 1.38e-23;
// Calculate threshold voltage
vt = kb * temp / q * vth;
// Calculate bulk charge capacitances
cgs0 = w * tox * eps0 / l;
cgd0 = w * tox * eps0 / l;
cgb0 = w * tox * eps0 / pb;
// Calculate overlap capacitances
cgs1 = cgso * w * l;
cgd1 = cgdo * w * l;
cgb1 = cgbo * w * l;
// Calculate parasitic capacitances
cgs2 = cgs1 + cgs0;
cgd2 = cgd1 + cgd0;
cgb2 = cgb1 + cgb0;
// Calculate current and capacitance coefficients
beta = w / l * u0 * tox / 2 * (1 + lamda * vds);
arg = vgs - vt;
id0 = beta * arg * arg;
id1 = beta * arg * (vds - 0.5 * lamda * vds * vds);
id2 = beta * (vds - 0.5 * lamda * vds * vds) * (vds - 0.5 * lamda * vds * vds);
// Calculate currents and capacitances
if (vds < 0) begin
vgb = vg - vs;
vgs = vgb + vs;
id = -id0 + id1 + id2;
end else begin
vgb = vg - vd;
vgs = vgb + vs;
id = -id0 + id1;
end
cgs = cgs2;
cgd = cgd2;
cgb = cgb2;
endmodule
```
这个模型包含了MOSFET的关键参数,包括宽度、长度、栅极氧化物厚度、迁移率、阈值电压、温度等等。它还考虑了各种电容,例如接触电容、重叠电容、寄生电容等。最后,它计算了MOSFET的电流和电容系数,以及计算了栅极、源极和漏极之间的电势差。
阅读全文