即使语法看起来正确,也会产生错误的简单代码(ISE VERILOG)

即使语法看起来正确,也会产生错误的简单代码(ISE VERILOG),verilog,xilinx,xilinx-ise,Verilog,Xilinx,Xilinx Ise,我在Xilinx ISE verilog编码方面比较新(只有几个小时)。这是我的uni项目代码。它在count=0行显示语法错误。在运行check语法时,我没有发现任何错误。我该如何解决这个问题 module syncdown(clk,rst,count); input clk,rst; output reg [3:0] count = 1; always @(posedge clk); begin if(rst) count = 0; // wrong here else count =

我在Xilinx ISE verilog编码方面比较新(只有几个小时)。这是我的uni项目代码。它在count=0行显示语法错误。在运行check语法时,我没有发现任何错误。我该如何解决这个问题

 module syncdown(clk,rst,count);
input clk,rst;
output reg [3:0] count = 1;
always @(posedge clk);
begin
if(rst)
count = 0; // wrong here 
else
count = count-1;
end
endmodule
错误

ERROR:HDLCompiler:806 - "/home/bossman/mux/syncdown.v" Line 8: Syntax error near "=".

删除
始终
行末尾的分号:

module syncdown(clk,rst,count);
input clk,rst;
output reg [3:0] count = 1;
always @(posedge clk)
begin
if(rst)
count = 0; // wrong here 
else
count = count-1;
end
endmodule

删除
始终
行末尾的分号:

module syncdown(clk,rst,count);
input clk,rst;
output reg [3:0] count = 1;
always @(posedge clk)
begin
if(rst)
count = 0; // wrong here 
else
count = count-1;
end
endmodule