语法错在哪里!!求大神
module traffic_lights;
reg clock,red,yellow,green;
parameter on=1,
off=0,
red_
tics=350,
yellow_tics=30,
green_tics=200;
initial red=off;
initial yellow=off;
initial green=off;
always
begin
red=on;
light(red,red_tics);
yellow=on;
light(yellow,yellow_tics);
green=on;
light(green,green_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:HDLCompiler:719 - "D:/
FPGA_EXP/traffic_lights/traffic_lights.v" Line 38: Port declaration not allowed in light with formal port declaration list
ERROR:HDLCompiler:719 - "D:/FPGA_EXP/traffic_lights/traffic_lights.v" Line 39: Port declaration not allowed in light with formal port declaration list
ERROR:HDLCompiler:24 - "D:/FPGA_EXP/traffic_lights/traffic_lights.v" Line 31: light expects 4 arguments
ERROR:HDLCompiler:24 - "D:/FPGA_EXP/traffic_lights/traffic_lights.v" Line 33: light expects 4 arguments
ERROR:HDLCompiler:24 - "D:/FPGA_EXP/traffic_lights/traffic_lights.v" Line 35: light expects 4 arguments
ERROR:HDLCompiler:598 - "D:/FPGA_EXP/traffic_lights/traffic_lights.v" Line 21: Module <traffic_lights> ignored due to previous errors.
一周热门 更多>