VERILOG 键盘扫码,有几个warning很难解决
时间:10-02
整理:3721RD
点击:
使用PMOD键盘,扫描并且在七段数码管显示,综合正确,但是下载后结果不对,可能与几个warnings 有关系,但是我不懂如何消除 。求大神指导
module keyscan(clk,
rst_n,
keyscan,
keyin,
real_number);/////////////////////////////////////////////////////////////////////////////////
input clk,rst_n;
input[3:0] keyin;
output[3:0] keyscan;
output reg[4:0] real_number;
reg[3:0] state;
reg[3:0] four_state;
reg anykeypress;
reg[4:0] numberout,number_reg,number_reg1;//
reg[3:0] scancode;
reg[3:0] scan_state;
assign keyscan = scancode;
always@(posedge clk or posedge rst_n) // part 1 : 状态机,确定是哪一行数据
if(rst_n)
begin
scancode (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block . //// 为啥会是恒定0? 搞死人了
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block .
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block .
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block .
module keyscan(clk,
rst_n,
keyscan,
keyin,
real_number);/////////////////////////////////////////////////////////////////////////////////
input clk,rst_n;
input[3:0] keyin;
output[3:0] keyscan;
output reg[4:0] real_number;
reg[3:0] state;
reg[3:0] four_state;
reg anykeypress;
reg[4:0] numberout,number_reg,number_reg1;//
reg[3:0] scancode;
reg[3:0] scan_state;
assign keyscan = scancode;
always@(posedge clk or posedge rst_n) // part 1 : 状态机,确定是哪一行数据
if(rst_n)
begin
scancode (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch (without init value) has a constant value of 0 in block . This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block . //// 为啥会是恒定0? 搞死人了
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block .
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block .
WARNING:Xst:2404 - FFs/Latches > (without init value) have a constant value of 0 in block .
求助啊
这个应该是没有设置初始值,后面用了并且赋值了的话就没问题。