马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
自己用verilog-A编译的霍尔传感器仿真model,其中里面的G的表达式,(tan(theta_H))存在=0的情况,因此仿真会报错,请问各位大神这个问题应该如何解决,谢谢~~~
`include "discipline.h"
`include "constants.h"
`define M_PI
3.14159265358979323846264338327950288419716939937511
module ccvs_vh(vout_p, vout_n, iin_p, iin_n);
input iin_p, iin_n;
output vout_p, vout_n;
electrical vout_p, vout_n, iin_p, iin_n;
parameter real teff = 5E-4;
parameter real Ndnw = 1E16;
parameter real q = 1.6E-19;
parameter real l = 20E-4;
parameter real w = 15E-4;
parameter real un = 600;
parameter real r_H = 4E-5;
parameter real motor_freq = 100;
parameter real amp = 0.1;
parameter integer steps_per_period = 32;
real theta_H;
real G;
real SI;
real phase;
real B;
analog begin
// r_H = 1/(q*Ndnw)
$bound_step (1.0 / (steps_per_period*motor_freq));
phase = idtmod(motor_freq,0,1);
B = amp*sin(2*`M_PI*phase);
theta_H = atan(un*r_H*B);
G = 1-5.0267*theta_H/(tan(theta_H))*(exp(-(`M_PI*(w+2*l)/(2*w))));
SI = G*r_H/(q*Ndnw*teff);
V(vout_p, vout_n) <+ 0.5*SI*I(iin_p, iin_n)*B;
end
endmodule |