verilog代码在isim(xilinx 14.2)中工作,但在Partan6上不工作

verilog代码在isim(xilinx 14.2)中工作,但在Partan6上不工作,verilog,fpga,xilinx-ise,spartan,Verilog,Fpga,Xilinx Ise,Spartan,我用verilog(xilix14.2)编写了一个简单的计数器代码。代码在isim中正常工作,但我无法将其转储到spartan6。当我尝试转储代码时,斯巴达6上的红灯亮了,代码没有被转储。请让我知道我需要做的更改 module clk(int_clk,ext_pulse,reset,pos_count,neg_count); input int_clk; input ext_pulse; input reset; output reg [7:0] pos_count; output reg [7

我用verilog(xilix14.2)编写了一个简单的计数器代码。代码在isim中正常工作,但我无法将其转储到spartan6。当我尝试转储代码时,斯巴达6上的红灯亮了,代码没有被转储。请让我知道我需要做的更改

module clk(int_clk,ext_pulse,reset,pos_count,neg_count);
input int_clk;
input ext_pulse;
input reset;
output reg [7:0] pos_count;
output reg [7:0] neg_count;
reg [7:0] count;
always@(posedge int_clk)
if(reset)
begin
pos_count<=0;
neg_count<=0;
end
else if(ext_pulse)
begin
neg_count<=neg_count+1;
pos_count<=0;
end
else
begin
pos_count<=pos_count+1;
neg_count<=0;
end
endmodule
模块时钟(内部时钟、外部脉冲、复位、正计数、负计数);
输入int_clk;
输入外脉冲;
输入复位;
输出寄存器[7:0]位置计数;
输出寄存器[7:0]负计数;
reg[7:0]计数;
始终@(posedge int_clk)
如果(重置)
开始

pos_count嘿,你还没有在always块中设置begin..end。此外,您还使用了同步重置,这通常是不可取的。我对你的代码做了一些更改。顺便问一下,你生成了比特流吗

module clk(int_clk,ext_pulse,reset,pos_count,neg_count);
input int_clk;
input ext_pulse;
input reset;

output reg [7:0] pos_count;
output reg [7:0] neg_count;
reg [7:0] count;              //This reg is unused

always@(posedge int_clk or posedge reset) //I am assuming you want active high reset
begin
if(reset)
begin
  pos_count<=0;
  neg_count<=0;
end
else if(ext_pulse)
begin
 neg_count<=neg_count+1;
 pos_count<=0;
end
else
begin
 pos_count<=pos_count+1;
 neg_count<=0;
end
end
endmodule
模块时钟(内部时钟、外部脉冲、复位、正计数、负计数);
输入int_clk;
输入外脉冲;
输入复位;
输出寄存器[7:0]位置计数;
输出寄存器[7:0]负计数;
reg[7:0]计数//此注册表未使用
总是@(posedge int_clk或posedge reset)//我假设您需要活动高电平重置
开始
如果(重置)
开始
pos_计数