写一个VerilogA的mosefet模型
时间: 2024-05-07 20:20:43 浏览: 130
基于verilog语言的实例
以下是一个简单的VerilogA MOSFET模型,仅供参考:
```
`timescale 1ns/1ps
module MOSFET_model (Drain, Gate, Source, Substrate, Vds, Vgs, Ids);
// Inputs
electrical Drain, Gate, Source, Substrate, Vds, Vgs;
// Outputs
electrical Ids;
// Parameters
parameter real L = 1e-6; // Channel length
parameter real W = 1e-6; // Channel width
parameter real tox = 1e-9; // Oxide thickness
parameter real u0 = 600e-4; // Mobility
parameter real Cox = 3.9 * 8.85e-14 / tox; // Gate oxide capacitance per unit area
parameter real Vt0 = 0.7; // Zero-bias threshold voltage
parameter real lambda = 0.02; // Channel-length modulation parameter
parameter real Rd = 1e-3; // Drain series resistance
parameter real Rs = 1e-3; // Source series resistance
// Local variables
real Vth; // Threshold voltage
real Vgs_eff; // Effective gate-source voltage
real Vds_eff; // Effective drain-source voltage
real Vov; // Overdrive voltage
real Ids_sat; // Saturation current
real gm; // Small-signal transconductance
real gds; // Small-signal output conductance
real Vdsat; // Drain-source saturation voltage
real Rd_eff; // Effective drain series resistance
real Rs_eff; // Effective source series resistance
// Compute effective drain and source resistances
Rd_eff = (Vds > 0) ? Rd : 0;
Rs_eff = (Vds < 0) ? Rs : 0;
// Compute threshold voltage
Vth = Vt0 + (2 * tox * 8.854e-12 * 1e-6) / Cox * (Substrate - 2 * Vt0) / (2 * tox);
// Compute effective gate-source voltage
Vgs_eff = Vgs - (Substrate - Source);
// Compute effective drain-source voltage
Vds_eff = Vds - Rd_eff * Ids + Rs_eff * Ids;
// Compute overdrive voltage
Vov = Vgs_eff - Vth;
// Compute saturation current
Ids_sat = W / L * u0 * Cox / 2 * (Vov) ^ 2;
// Compute small-signal transconductance
gm = W / L * u0 * Cox * (Vgs_eff - Vth);
// Compute small-signal output conductance
gds = W / L * u0 * Cox * (Vds_eff - Vdsat) + lambda * Ids_sat;
// Compute drain-source saturation voltage
Vdsat = (Vgs_eff - Vth - sqrt((Vgs_eff - Vth) ^ 2 - 2 * Cox * Ids_sat / W / L)) / lambda;
// Compute drain current
if (Vgs_eff < Vth) {
Ids = 0;
} else if (Vds_eff < Vov) {
Ids = gm * Vds_eff - gds / 2 * Vds_eff ^ 2;
} else {
Ids = 0.5 * W / L * u0 * Cox * (Vgs_eff - Vth - Vov) ^ 2 * (1 + lambda * (Vds - Vdsat));
}
endmodule
```
该模型计算MOSFET的Drain电流(Ids)与Gate-Source电压(Vgs)和Drain-Source电压(Vds)之间的关系。它使用一些常见的MOSFET参数来计算电流,如门极氧化物厚度(tox)、载流子迁移率(u0)、栅极氧化物电容(Cox)等。还考虑了一些非理想效应,如栅极阈值电压(Vth)变化、沟道长度调制效应(lambda)、漏电阻(Rd)和源电阻(Rs)等。
阅读全文