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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 6893|回复: 0

请大虾们帮我看看下面的程序(Verilog),怎么仿真时老是出错啊??

[复制链接]
发表于 2005-12-23 10:30:08 | 显示全部楼层 |阅读模式

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

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

x
源程序:
module mytak;
reg clock,red,amber,green;
parameter on=1,off=0,red_tics=350,
amber_tics=30,green_tics=200;
initial red=off;
initial amber=off;
initial green=off;
always
    begin
         red=on;
    light(red,red_tics);
    green=on;
    light(green,green_tics);
    amber=on;
    light(amber,amber_tics);
    end
  task light(color,tics);
      output color;
      input[31:0] tics;
     begin
   repeat(tics) @(posedge clock);
   color =off;
        end
   endtask
   always
      begin
    #100 clock=0;
    #100 clock=1;
      end
endmodule
仿真时的错误提示:
# ** Error: C:/Modeltech_5.8/examples/mysimulate1/mytak.v(18):
near "color": expecting: INOUT INPUT OUTPUT
# ** Error: C:/Modeltech_5.8/examples/mysimulate1/mytak.v(21):
ear "begin": syntax error
# ** Error: C:/Modeltech_5.8/examples/mysimulate1/mytak.v(22):
near "@": expecting: ';'
# ** Error: C:/Modeltech_5.8/examples/mysimulate1/mytak.v(23):
near "=":  expecting: IDENT
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-9-17 03:51 , Processed in 0.012348 second(s), 7 queries , Gzip On, Redis On.

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