本人FPGA verilog 初学者,近日写程序遇到问题,向各位大神请教。
总出现警告:Warning:OutputpinsarestuckatVCCorGNDWarning(13410):Pin"L"isstuckatGND程序如下://tes...
总出现警告:Warning: Output pins are stuck at VCC or GND
Warning (13410): Pin "L" is stuck at GND
程序如下:
//test button and led
module button(E,L,clk); //capital
output L;
input E,clk; //E是按钮 clk 时钟
reg sig=1'd0,count=11'd0,LED=1'd0;
always@ (negedge E)sig <= 1'd1;
always@ (posedge clk) begin
if (sig == 1'd1)
if (count == 11'd1999) begin
sig <= 1'd0;
count <= 11'd0;
LED <= 1'd1;
end
else count <= count + 1'd1;
end
assign L = LED;
endmodule
出现的警告:Warning: Output pins are stuck at VCC or GND
Warning (13410): Pin "L" is stuck at GND
Warning: Design contains 2 input pin(s) that do not drive logic
Warning (15610): No output dependent on input pin "E"
Warning (15610): No output dependent on input pin "clk"
Warning: Following 1 pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results
Info: Pin L has GND driving its datain port 展开
Warning (13410): Pin "L" is stuck at GND
程序如下:
//test button and led
module button(E,L,clk); //capital
output L;
input E,clk; //E是按钮 clk 时钟
reg sig=1'd0,count=11'd0,LED=1'd0;
always@ (negedge E)sig <= 1'd1;
always@ (posedge clk) begin
if (sig == 1'd1)
if (count == 11'd1999) begin
sig <= 1'd0;
count <= 11'd0;
LED <= 1'd1;
end
else count <= count + 1'd1;
end
assign L = LED;
endmodule
出现的警告:Warning: Output pins are stuck at VCC or GND
Warning (13410): Pin "L" is stuck at GND
Warning: Design contains 2 input pin(s) that do not drive logic
Warning (15610): No output dependent on input pin "E"
Warning (15610): No output dependent on input pin "clk"
Warning: Following 1 pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results
Info: Pin L has GND driving its datain port 展开
3个回答
展开全部
你这个程序应该出现error啊,为什么不贴出来?
更多追问追答
追问
没有ERROR的
追答
always@ (negedge E)sig <= 1'd1;
always@ (posedge clk)sig <= 1'd0;
这就是个错误啊,你用什么编译器编的?同一个寄存器不可以被两个信号促发。reg的那一行没什么问题,像你那么写是可以的。楼上的不懂不要乱说。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
reg 这行有问题,寄存器初值不要这么设置,放到always里面搞个条件初值
更多追问追答
追问
我用always赋初值了,还是不行,老样子。我看了 help 文件,说我的问题是程序逻辑方面的,说是输出总是被牵制在低电平。
追答
加个上电复位,把reg 的值放到复位条件里面
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询