参考文章
https://blog.csdn.net/weixin_33909059/article/details/93446444
要验证的问题
验证jtag的时钟频率与ila内部输入的时钟之间的关系。
验证方法
jtag的时钟,我们采用的系统的工程是LED的流水灯的设计实验。
工程代码
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2020/07/25 00:03:39
// Design Name:
// Module Name: les_test
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module les_test(
sys_clk_p,
sys_clk_n,
rst_n, // reset ,low active
led // LED,use for control the LED signal on board
);
input sys_clk_p;
input sys_clk_n;
input rst_n;
output [3:0] led;
//define the timer counter
reg[31:0] timer;
reg[3:0] led;
wire sys_clk;
IBUFDS sys_clk_ibufgds
(
.O (sys_clk ),
.I (sys_clk_p ),
.IB (sys_clk_n )
);
always @(posedge sys_clk or negedge rst_n)
begin
if (~rst_n)
timer <= 32'd0; // when the reset signal valid,time counter clearing
else if (timer == 32'd19_999_999) //1 seconds count(200M-1=199999999)
timer <= 32'd0; //count done,clearing the time counter
else
timer <= timer + 1'b1; //timer counter = timer counter + 1
end
//===========================================================================
// LED control
//===========================================================================
always @(posedge sys_clk or negedge rst_n)
begin
if (~rst_n)
led <= 4'b0000; //when the reset signal active
else if (timer == 32'd4_999_999) //time counter count to 0.25 sec,LED1 lighten
led <= 4'b0001;
else if (timer == 32'd9_999_999) //time counter count to 0.5 sec,LED2 lighten
begin
led <= 4'b0010;
end
else if (timer == 32'd14_999_999) //time counter count to 0.75 sec,LED3 lighten
led <= 4'b0100;
else if (timer == 32'd19_999_999) //time counter count to 1 sec,LED4 lighten
led <= 4'b1000;
end
wire clk_100M;
wire clk_10M;
clk_wiz_0 aa
(
.clk_in1(sys_clk),
.clk_out1(clk_100M),
.clk_out2(clk_10M)
);
ila_0 u1
(
.clk(clk_10M),
.probe0(led),
.probe1(timer)
);
endmodule
代码说明
上面主要分成三个部分:
(1)流水灯产生部分
(2)clk分频时钟模块
(3)ila实例化部分
我们将10M的分频时钟的给ila核输入时钟,这样我们可以选择jtag 的时钟大于该频率或者小于该频率,或者小于该频率2.5倍,来去查看对于我们得到ila的时钟的结果有什么影响
结果
jtag选择30M
出现error
jtag 选择10M
点击运行后不报错,但是不显示任何结果
jtag 选择7.5M
同样没有任何结果
jtag 选择5M
此时出现了期望的运行的结果
jtag 选择更低的1M的时钟