集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 2699|回复: 3

高手请进,帮忙看下程序哪错了~~

[复制链接]
流浪在此 发表于 2010-8-23 14:26:05 | 显示全部楼层 |阅读模式
module rpg;
   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;
   reg color;
   begin
   repeat(tics)@(posedge clock);//等待tics个时钟的上升沿
   color=off;//关灯
   end
endtask
//产生时钟脉冲的always块
always
begin
#100 clock=0;
#100 clock=1;
end
endmodule
我在Quartusii下编译的,下面是错误信息:
Error (10170): Verilog HDL syntax error at rpg.v(20) near text "color";  expecting ")", or "inout", or "input", or "output", or "(*"
Error (10170): Verilog HDL syntax error at rpg.v(24) near text "begin";  expecting an identifier ("begin" is a reserved keyword ), or "endmodule", or a parallel statement
Error (10112): Ignored design unit "rpg" at rpg.v(1) due to previous errors
Error: Quartus II Analysis & Synthesis was unsuccessful. 3 errors, 0 warnings
        Error: Peak virtual memory: 154 megabytes
        Error: Processing ended: Mon Aug 23 14:12:02 2010
        Error: Elapsed time: 00:00:01
        Error: Total CPU time (on all processors): 00:00:01
Error: Quartus II Full Compilation was unsuccessful. 5 errors, 0 warnings

哪里错了,麻烦高手解决下,小弟初学Verilog ,不是很懂~~谢谢
 楼主| 流浪在此 发表于 2010-8-23 19:58:01 | 显示全部楼层
就没有人知道吗?
无名 发表于 2010-8-23 20:37:53 | 显示全部楼层
在Quartusii下编译肯定是一堆错误啦,编译包括综合、优化和适配等,你的程序n多不可综合的,当然错了。拿到Modelsim里面仿真估计就没错了。。。
 楼主| 流浪在此 发表于 2010-8-24 14:42:37 | 显示全部楼层
回复 3# 无名


  嗯,谢谢啊
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

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

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-5-4 20:42 , Processed in 0.136361 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表