在ModelSim编译时候老报一个奇怪的错,高手帮忙看一下下面一个简单的代码
时间:10-02
整理:3721RD
点击:
是粘贴夏宇闻老师讲解task时候的一个举例
刚开始学verilog 和modelSim,很多不明白的地方,谢谢
module traffic_lights;
regclock, red, amber, green;
parameteron=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
tasklight(color,tics);
outputcolor;//老在这里报错 vlog -reportprogress 300 -work work F:/modul_exercise/test1.v
# Model Technology ModelSim SE vlog 6.2b Compiler 2006.07 Jul 31 2006
# -- Compiling module traffic_lights
# ** Error: F:/modul_exercise/test1.v(18): near "output": syntax error, unexpected "output"
input[31:0] tics;
begin
repeat(tics) @(posedge clock);
color=off;
end
endtask
always
begin
#100 clock=0;
#100 clock=1;
end
endmodule
刚开始学verilog 和modelSim,很多不明白的地方,谢谢
module traffic_lights;
regclock, red, amber, green;
parameteron=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
tasklight(color,tics);
outputcolor;//老在这里报错 vlog -reportprogress 300 -work work F:/modul_exercise/test1.v
# Model Technology ModelSim SE vlog 6.2b Compiler 2006.07 Jul 31 2006
# -- Compiling module traffic_lights
# ** Error: F:/modul_exercise/test1.v(18): near "output": syntax error, unexpected "output"
input[31:0] tics;
begin
repeat(tics) @(posedge clock);
color=off;
end
endtask
always
begin
#100 clock=0;
#100 clock=1;
end
endmodule
我做的时候好像没有抱错啊!
那是不是编译器设置的问题