在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2400|回复: 3

[求助] 各位大神,请问Verilog-A中出现说我的*号和/号未定义,这是怎么回事啊

[复制链接]
发表于 2012-9-29 19:45:18 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
QQ截图未命名.png
乘除号不是在下面这里定义的么?
`include "constants.vams"
`include "disciplines.vams"
PI不是下面这么定义吗?                                             
`define PI 3.14159265358                     
下面是运放的全部程序
`include "constants.vams"
`include "disciplines.vams"
`define PI 3.14159265358
module diff_opamp(vout_p,vout_n,vref,vin_p,vin_n,vspply_p,vspply_n);
input vref ,vspply_p,vspply_n;
inout vout_p,vout_n,vin_p,vin_n;
parameter real gain=835e3;
parameter real freq_unitygain=1.0e6;
parameter real rin=1e6;
parameter real vin_offset=0.0;
parameter real ibias=0.0;
parameter real lin_max=100e-6;
parameter real slew_rate=0.5e6;
parameter real rout=80;
parameter real vsoft=0.5;
real c1;
real gm_nom;
real r1;
real vmax_in;
real vin_val;
electrical vout_p,vout_n,vref,vin_p,vin_n,vspply_p,vspply_n;
electrical cout_p,cout_n;
analog begin
@(initial_step or initial_step("dc") )begin
c1=lin_max/(slew_rate);
gm_nom=2*PI*freq_unitygain*c1;
r1=gain / gm_nom;
vmax_in=lin_max/gm_nom;
end
vin_val=V(vin_p,vin_n) / 2+vin_offset;                                
//
//INPUT STAGE
//
I(vin_p,vin_n)<+(V(vin_p,vin_n)+vin_offset) / rin;
I(vref,vin_p)<+ibias;
I(vref,vin_n)<+ibias;
//
// GM stage with slewing
//
I(vref,cout_p)<+V(vref,cout_p) / 100e6;
I(vref,cout_n)<+V(vref,cout_n) / 100e6;
if(vin_val>vmax_in)begin
I(vref,cout_p)<+lin_max;
I(vref,cout_n)<+ -lin_max;
end
else begin
I(vref,cout_p)<+0.5*gm_nom*vin_val;
  I(vref,cout_n)<+0.5*gm_nom*vin_val;
end
//
// Dominant Pole
//
I(cout_p,vref)<+ddt(c1*V(cout_p,vref));
I(cout_p,vref)<+V(cout_p,vref)/r1;
I(cout_n,vref)<+ddt(c1*V(cout_n,vref));
I(cout_n,vref)<+V(cout_n,vref)/r1;
//
//output stage
//
I(vref,vout_p)<+V(cout_p,vref)/rout;
I(vout_p,vref)<+V(cout_p,vref)/rout;
I(vref,vout_n)<+V(cout_n,vref)/rout;
I(vout_n,vref)<+V(cout_n,vref)/rout;
//
// soft output limiting
//
if(V(vout_p)>(V(vspply_p)-vsoft))
I(cout_p,vref)<+gm_nom*(V(vout_p,vspply_p)+vsoft);
else if (V(vout_p)<(V(vspply_n)+vsoft))  
I(cout_p,vref)<+gm_nom*(V(vout_p,vspply_n)+vsoft);
if(V(vout_n)>(V(vspply_p)-vsoft))
I(cout_n,vref)<+gm_nom*(V(vout_n,vspply_p)+vsoft);
else if (V(vout_n)<(V(vspply_n)+vsoft))  
I(cout_n,vref)<+gm_nom*(V(vout_n,vspply_n)+vsoft);
end
endmodule
 楼主| 发表于 2012-9-30 08:28:36 | 显示全部楼层
可不可能是仿真器有问题,我描述一个电阻都有问题
发表于 2012-10-1 22:30:50 | 显示全部楼层
不是说你的*和/啊!是说你的PI!
用`define定义的变量需要用`变量名调用。
 楼主| 发表于 2012-10-14 17:03:31 | 显示全部楼层
太感谢了!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-28 05:31 , Processed in 0.019762 second(s), 10 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表