好吧,我有这个代码,它运行得很好:
module syncRX(clk, signal, detect);
input clk, signal;
output reg [7:0] detect = 0;
reg [7:0] delay = 0;
//wire clk_1khz;
freq_div div(.clk(clk), .clk_1khz(clk_1khz));
always @(posedge signal)
begin
detect <= detect + 1;
delay <= 0;
end
always @(posedge clk_1khz)
begin
delay <= delay + 1;
end
endmodule // top
module freq_div(input clk, output reg clk_1khz);
reg [12:0] count = 0;
always @(posedge clk)
begin
if(count == 6000)
begin
clk_1khz <= ~clk_1khz;
count <= 0;
end
else
count <= count + 1;
end
endmodule
当我把";检测<=检测+1"至";检测<=延迟&";。目的是计算信号的周期,但我收到了冰风暴的警告信息:警告:在设计中找不到时钟
FPGA停止工作。。。拜托,有人知道发生了什么坏事吗?感谢大家!
通过对这个问题的投票,我可以看出这不是一个好的问题,也许是因为社区认为它已经有了文档,但我仍然找不到问题的解决方案,我做了一些改进,我会再次尝试在这里找到帮助,我现在有了这个代码,完美地合成了:
module syncRX(clk, signal, detect);
input clk, signal;
output [7:0] detect;
reg [7:0] detect_aux = 8'b0;
reg rst;
assign detect = detect_aux & ~rst;
freq_div div(.clk(clk), .clk_1khz(clk_1khz));
always @(posedge signal)
rst <= 1;
always @(posedge clk_1khz)
detect_aux <= detect_aux + 1;
endmodule // top
module freq_div(input clk, output reg clk_1khz);
reg [12:0] count = 0;
always @(posedge clk)
begin
if(count == 6000)
begin
clk_1khz <= ~clk_1khz;
count <= 0;
end
else
count <= count + 1;
end
endmodule
问题是
reg rst;
assign detect = detect_aux & ~rst;
海员无所事事。有什么建议吗?感谢
问题是delay
是乘驱动的(合成中不允许从多个始终块驱动(,这是未定义的行为(在这种情况下,我相信将使用常数"0"(。这至少也是一个警告。