我正在尝试对我的 verilog 代码使用板载差分时钟。下面是我的 verilog 和约束文件的片段。尽管代码综合得很好,但我无法看到板上 LED 的变化。有人可以告诉我我在这里缺少什么吗?
Verilog:
module leds(
input DIFF_SYS_P,
input DIFF_SYS_N,
output reg [7:0] leds=8'd0,
output clk
);
reg [31:0] count =0;
wire clk;
IBUFGDS #(
.DIFF_TERM("FALSE"),
.IBUF_LOW_PWR("TRUE"),
.IOSTANDARD("DEFAULT")
) IBUFGDS_inst (
.O(clk),
.I(DIFF_SYS_P),
.IB(DIFF_SYS_N)
);
always@(posedge clk) begin
if(count ==10) begin
leds <= 8'b10101010;
count <=count +1;
end
else begin
count<=count +1;
end
end
endmodule
约束(xdc):
set_property PACKAGE_PIN G18 [get_ports DIFF_SYS_N]
set_property IOSTANDARD DIFF_SSTL15 [get_ports DIFF_SYS_N]
set_property PACKAGE_PIN H19 [get_ports DIFF_SYS_P]
set_property IOSTANDARD DIFF_SSTL15 [get_ports DIFF_SYS_P]
set_property PACKAGE_PIN AM39 [get_ports {leds[0]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[0]}]
set_property PACKAGE_PIN AN39 [get_ports {leds[1]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[1]}]
set_property PACKAGE_PIN AR37 [get_ports {leds[2]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[2]}]
set_property PACKAGE_PIN AT37 [get_ports {leds[3]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[3]}]
set_property PACKAGE_PIN AR35 [get_ports {leds[4]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[4]}]
set_property PACKAGE_PIN AP41 [get_ports {leds[5]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[5]}]
set_property PACKAGE_PIN AP42 [get_ports {leds[6]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[6]}]
set_property PACKAGE_PIN AU39 [get_ports {leds[7]}]
set_property IOSTANDARD LVCMOS18 [get_ports {leds[7]}]
create_clock -period 5.000 -name DIFF_SYS_P -waveform {0.000 2.500} [get_ports DIFF_SYS_P]**
首先,您可能希望使用 IBUFG 来跟进 IBUFGDS,以实际将时钟连接到全局时钟网络。 之后,您需要除以超过 10 的很多才能看到任何闪烁。 我建议数到 1 亿,重置计数器,然后切换 LED,而不仅仅是设置它们。
您可以发布 IBUFGDS 模块的代码吗? 或者说,这是内在的东西吗?