求助~~~
//`timescale 1 ns / 1 psmodule keyled
( key,clk,rst,
led
);
input key,clk,rst;
output led;
reg led;
//------------------------------------------
reg count;
always @ (posedge clk, negedge rst)
if(!rst)
count <= 0;
else
count <= count+1'b1;
//-------------------------------------------
reg keycnt;
always @ (posedge clk, negedge rst)
if(!rst)
keycnt <= 8'd0;
else
keycnt <= keycnt + 1'b1;
//-------------------------------------------
reg bufdata1,bufdata2;
always @ (posedge clk, negedge rst)
if(!rst)
bufdata1 <= 1;
else
if(keycnt == 20'hfffff)
bufdata1 <= key;
//-------------------------------------------
always @ (posedge clk, negedge rst)
if(!rst)
bufdata2 <= 1;
else
bufdata2 <= bufdata1;
//-------------------------------------------
wire keyvalue;
assign keyvalue = bufdata2 & (~bufdata1);
reg keyjudge;
always @ (posedge clk, negedge rst)
if(!rst)
keyjudge = 3'b0;
else
if(keyvalue)
if(keyjudge == 3'b100)
keyjudge = 3'b0;
else
keyjudge = keyjudge + 1'b1;
//-------------------------------------------
always @ (posedge clk, negedge rst)
if(!rst)
begin
led = count;
end
else
begin
case(keyjudge)
2'b0: led = count;
2'b1: led = count;
2'b10: led = count;
2'b11: led = count;
default: led = 1'bx;
endcase
end
endmodule
警告是:
Warning: Presettable and clearable registers converted to equivalent circuits with latches. Registers power-up to an undefined state, and DEVCLRn places the registers in an undefined state.
Warning (13310): Register "led~reg0" is converted into an equivalent circuit using register "led~reg0_emulated" and latch "led~reg0latch"
请问问题 出在了哪?
请高手赐教 default: led = 1'bx;
x 没识别吧 大虾们 都睡着了???{:sleepy:} 友情提示:小心ID 咦,lz的ID还在呢?等待消失。。。。 这是虾米玩意啊,闪人 友情提示:小心ID
+1 i_kkyu 发表于 2013-4-12 18:53 static/image/common/back.gif
友情提示:小心ID
+1
他ID怎么了。。。。 标题不规范 tastier 发表于 2013-4-13 14:32 static/image/common/back.gif
他ID怎么了。。。。
标题不合格,如果有人举报的话。。会被封ID的。
页:
[1]