我正在学习 Verilog 并使用 CPLD,但我被困住了。我编写的代码切换了一个 LED,但在综合过程中我不断收到警告。
//toggles LED on and off after 1000000 clock cycles
module LEDON(
LED,
clk
);
output LED;
reg LED;
input clk ;
wire clk;
reg [31:0] count;
wire count_max = 32'd1_000_000;
assign count_nxt = (count >= count_max) ? 32'd0 : count + 32'd1;
assign led_state_nxt = (count == count_max) ? ~LED : LED;
always @(posedge clk)
begin
count <= count_nxt;
LED <= led_state_nxt;
end
endmodule
我收到这些警告:
@W:MT420 |发现推断时钟 LEDON|clk 周期为 1000.00ns。请在对象“p:clk”上声明一个用户定义的时钟
警告 - 地图:C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.lpf (4): FREQUENCY NET "clk" 2.080000 MHz 中的错误;
警告 - 地图:首选项解析结果:检测到 1 个语义错误
警告 - 地图:首选项文件“C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.lpf”中有错误。
警告 - 地图:首选项文件“C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.prf”中存在语义错误。
我的 LPF 文件如下所示:
BLOCK RESETPATHS ;
BLOCK ASYNCPATHS ;
LOCATE COMP "LED" SITE "41" ;
FREQUENCY NET "clk" 2.08 MHz ;
那么有谁知道如何解决这些时钟警告?