|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
task delay;
input clk,rst,en;
input[16:0]value;
output q;
reg q;
reg[16:0]count;
always @(posedge clk or posedge rst)
begin
if(rst)
begin
q<=0;
count<=0;
end
else
if(en==1'b1)
if(count<value)
begin
count<=count+1'b1;
q<=0;
end
else
begin
q<=1;
count<=0;
end
else
begin
q<=0;
count<=0;
end
end
endtask
这是我写的task的一段程序,综合时弹出错误。如下
Error(10170):Verilog HDL syntax error at ... near text "always"; expecting";"
不知道啥原因,请各位赐教 |
|