主要参考了https://www.eefocus.com/liu1teng/blog/12-02/237897_4533d.html 、Xilinx UG471、UG472以及Xilinx Forum上的一些问答,在此一并表示感谢。

------------------------------------------------------------------------------------------------------

本文主要用来随意记录一下最近在为手头的FPGA项目做约束文件时候遇到的一点关于FPGA专用时钟管脚相关的内容,意在梳理思路、保存学习结果、以供自己日后以及他人参考。

起因是在做约束文件中的时序例外约束部分的内容的时候,发现很多单位之前的FPGA项目中的约束文件里经常出现的一句时序例外约束是:

set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets NETS_NAME_IBUF]

  

约束的对象往往是除了sys_clk之外的、由外部引入作为一些通信接口比如SPI或者MDIO接口的时钟管脚的IBUF线。

如果不加这个约束,执行implement的时候往往就会报error或者critical warning、内容中也会提到加上这个约束的话、就会将严重警告或者错误降级为普通warning,但是一直没搞明白这到底是怎么回事,所以这两天翻阅文档和论坛,算是弄清了个大概。

原来FPGA的管脚上有一类专用的时钟管脚、他们一般用于将外部的时钟信号引入FPGA、并在FPGA module中使用这些引入的时钟信号。但是如果设计时管脚分配没做好、或者管脚不够用了,那么就有可能将本该接入专用时钟管脚(或者叫做全局时钟管脚)的信号,接到了普通IO口上,这样只能通过添加CLOCK_DEDICETED_ROUTE FLASE绕过PAR的检查,但是没有解决根本问题。

在日常接触较多的Xilinx 7系列FPGA芯片上,Xilinx论坛上的工作人员对于这一点是这样解释的:

If you are bringing the the clock onto the device then you need to use the CCIO (Clock capable inputs) . Every 7 series FPGA has four clock-capable inputs in each bank. Two of the four are Multi-Region Clock Capable (MRCC) and the other two are Single Region Clock Capable (SRCC). These inputs are regular I/O pins with dedicated connections to internal clock resources.

也就是说,必须使用片上的MRCC或者SRCC引脚来把外部时钟信号引入FPGA、然后再在FPGA上使用这些引入的时钟。

对于这二者的含义和前后级连接,在UG472的table1-1中有详细说明:

关于这二者的区别,在xilinx forum的https://forums.xilinx.com/t5/Embedded-Processor-System-Design/MRCC-or-SRCC/m-p/787546

的下面的回答中进行了详细说明:

The clock capable pins in a 7 series FPGA serve two purposes; access to the local clocking resources and access to the global clocking resources.

If you are using the global clocking resources (BUFG, BUFH, MMCM, PLL) then the MRCC and SRCC have exactly the same capability - there is no difference between the two.

If you are using the local clocking resources (BUFR and BUFIO), then then the SRCC and MRCC can both only drive only the BUFIO and BUFR located in the same clock region. The BUFIO can then only drive the IOB flip-flops and high speed clock of the ISERDES in the same I/O bank and the BUFR can clock all the logic (except the high speed clock of the ISERDES) in the same clock region.

The only difference between the SRCC and MRCC is that the MRCC can also drive the BUFMR. The BUFMR can then drive the BUFIO/BUFR in the same clock region as well as in the clock regions above and below the MRCC. This would generally be used for "ChipSync" (source synchronous) interfaces that need to use more pins than are available in one I/O bank.

另外在https://forums.xilinx.com/t5/Other-FPGA-Architectures/LVDS-CLK-P-N-be-routed-to-MRCC-SRCC-or-regular-differential-IOs/m-p/913220下的回答中也提到了:

MRCCs can access multiple clock regions and the global clock tree. MRCCs function the same as SRCCs and can additionally drive multi-clock region buffers (BUFMR) to access up to three clock regions.

另外作者还提到了:

if you are forwarding clock out from the device, then you can use any regular IOs,  I.e

Clock path is

Clock you want to forward -> ODDR -> OBUFDS ->Routed to any regular differential pair .

这里也就是说,如果需要将外部时钟引入FPGA、但是不会在FPGA的module内部将该信号作为时钟去使用、而只是将这个引入的时钟做一个relay或者说forward,那么就不需要将其接到MRCC/SRCC管脚(虽然这两类管脚在一般情况下、不做时钟引入的管脚的时候、也可以作为普通IO来使用)、而只用接到任何一个普通的IO即可。

这里还注意到的是、如果做时钟中继、使用的方案是选用ODDR-OBUFDS,这二者在UG471文档中有说明。

UG471-P128:

Clock Forwarding
Output DDR can forward a copy of the clock to the output. This is useful for propagating
a clock and DDR data with identical delays, and for multiple clock generation, where every
clock load has a unique clock driver. This is accomplished by tying the D1 input of the
ODDR primitive High, and the D2 input Low. Xilinx recommends using this scheme to
forward clocks from the FPGA logic to the output pins.

此外,在UG472的table2-1中,对不同应用场合下、时钟输入之后的各类BUF的连接方式进行了说明,包括各种常见的clk buffer:

clock management tiles (CMT)

Global clock buffers (BUFGCTRL, simplified as BUFG throughout this user guide).BUFGs do not belong to a clock region and can reach any clocking point on the device.

horizontal clock buffer (BUFH/BUFHCE)

clock enable circuit (BUFHCE)

I/O clock buffer (BUFIO)

regional clock buffer (BUFR)

multi-clock region buffers (BUFMR)

另外在https://www.eefocus.com/liu1teng/blog/12-02/237897_4533d.html中的博文中提到了:

输入输出的随路时钟,如果硬件上接到了普通IO上,这就有点悲剧了,尽管可以用BUFG接进全局时钟网,但是,从PAD到BUFG的输出有10ns的固有延时。这10ns无法消除,所以如果时钟频率超过20M左右时,skew会比较大。

这篇博文是2012年的,距离现在已经略久远,所以关于BUFG的延时数据、在现在看起来有点不可思议、直觉上觉得太大了点、尽管作者的这个10ns的数据包含了从pad-IBUFG(可能是IBUFG,也可能是其他)-BUFG的整个延时。查阅现在使用的xilinx 7 系列FPGA芯片的ds181手册、在Clock Buffers and Networks一小节的内容中找到了BUFG的delay,如下图所示:

根据不同速度等级的芯片、这个延时不尽相同、大概在0.1ns左右。这里的Tbccko_o对应的就是UG472-Figure2-6中的BUFG的输入输出延时、如下图所示:

另外博文中还提到:

一些处理办法:用两个DCM级联来调相BUFG+DCM+DCM。

对应现在使用的7series FPGA中、也就是时钟BUFG+MMCM来实现时钟的相位调整。

关于DCM,MMCM和PLL的发展历史和区别,除了参阅UG472之外、在xilinx forum的回答下https://forums.xilinx.com/t5/Welcome-Join/DCM-MMCM-and-PLL/m-p/654372有详细说明:

The DCM is a Digital Clock Manager - at its heart it is a Delay Locked Loop. This has the ability to deskew a clock, generate different phases of the clock, dynamically change the phase of a clock, generate related (2x) clocks, do clock division, and even generate clocks with harmonic relationships to the incoming clock. It was the only clock management block that existed in older technologies (up to Spartan-3 and Virtex-4).

In Virtex-5 and Spartan-6 the Phase Locked Loop (PLL) was introduced along with the DCM. The PLL is an analog clock management cell that can do almost everything the DCM can do with the exception of dynamic and fine phase shifting. However, it can do more precise frequency generation and can generate multiple different frequencies at the same time. It also has significantly better jitter performance than the DCM - particularly when doing frequency synthesis with large multipliers/dividers.

In Virtex-6 the MMCM - Mixed Mode Clock Manager - was introduced. This is a PLL with some small part of a DCM tacked on to do fine phase shifting (that's why its mixed mode - the PLL is analog, but the phase shift is digital). Thus the MMCM can do everything the PLL can do plus the phase shifting from the DCM. The V6 only had MMCMs.

In the 7 series, they have a combination of PLLs and MMCMs. Mostly this is so that there are more cells available for use (the PLLs are smaller, so they take less room on the FPGA die). Furthermore the PLLs are tightly bound to the I/O structures that are used for DDRx-SDRAM memory controllers (via the MIG).

As for the number of them, that is determined by the size of the device. Look at the Product Table for the device you are using - it will tell you what is in the CMT (Clock Management Tile) and how many of them are available in your device.

Xilinx FPGA的专用时钟引脚及时钟资源相关的更多相关文章

  1. xilinx FPGA全局时钟资源的使用

    1.什么是xilinx fpga全局时钟资源 时钟对于一个系统的作用不言而喻,就像人体的心脏一样,如果系统时钟的抖动.延迟.偏移过大,会导致系统的工作频率降低,严重时甚至会导致系统的时序错乱,实现不了 ...

  2. Xilinx FPGA全局时钟和全局时钟资源的使用方法

    对FPGA的全局时钟了解不多,遂转载一篇文档: http://xilinx.eetop.cn/?action-viewnews-itemid-42 目前,大型设计一般推荐使用同步时序电路.同步时序电路 ...

  3. Xilinx原语学习之时钟资源相关原语

    一直来,都是使用Vivado中自带的GMIItoRGMII IP核来完成GMII转RGMII的功能:尽管对GMII及RGMII协议都有一定的了解,但从没用代码实现过其功能.由于使用IP时,会涉及到MD ...

  4. Xilinx FPGA引脚txt文件导入excel中

    需求 为了把xilinx FPGA的官方引脚文件txt转成excel文件(实际官网中有对应的csv文件就是excel文件了...) xilinx FPGA引脚地址:https://china.xili ...

  5. 基于Xilinx FPGA的视频图像采集系统

    本篇要分享的是基于Xilinx FPGA的视频图像采集系统,使用摄像头采集图像数据,并没有用到SDRAM/DDR.这个工程使用的是OV7670 30w像素摄像头,用双口RAM做存储,显示窗口为320x ...

  6. Xilinx FPGA结构

    FPGA是什么?FPGA是现场可编程逻辑阵列,由可编程逻辑资源(LUT和 REG),可编程连线,可编程I/O构成.Xilinx的FPGA的基本结构是一样的,但随着半导体工艺的发展,FPGA的逻辑容量越 ...

  7. xilinx FPGA普通IO作PLL时钟输入

    本帖转自于 :http://www.cnblogs.com/jamesnt/p/3535073.html 在xilinx ZC7020的片子上做的实验; [结论] 普通IO不能直接作PLL的时钟输入, ...

  8. Xilinx FPGA LVDS应用

    最近项目需要用到差分信号传输,于是看了一下FPGA上差分信号的使用.Xilinx FPGA中,主要通过原语实现差分信号的收发:OBUFDS(差分输出BUF),IBUFDS(差分输入BUF). 注意在分 ...

  9. Xilinx FPGA开发环境vivado使用流程

    Xilinx FPGA开发环境vivado使用流程 1.启动vivado 2016.1 2.选择Create New Project 3.指定工程名字和工程存放目录 4.选择RTL Project 5 ...

随机推荐

  1. Openlayers3 计算地图上随意两点间的距离

    相应的openlayers的版本号为3.7. 主要用的接口是ol.Sphere.haversineDistance([x1,y1],[x2,y2]): 4326坐标系中计算两点距离的方式为: var ...

  2. LeetCode 500. Keyboard Row (键盘行)

    Given a List of words, return the words that can be typed using letters of alphabet on only one row' ...

  3. HTTP的GET和POST请求

    1.GET请求: 格式例如以下: request-line headers blank-line request-body 如图是我用wireshark截的一个GET请求的HTTP首部: GET请求发 ...

  4. Hackerrank Connected Cell in a Grid

    Problem Statement You are given a matrix with m rows and n columns of cells, each of which contains ...

  5. Oracle 用户管理(二)

    1    给某人赋予"系统权限"     SQL> grant connect to aobama with admin option     意思是将admin的连接数据库 ...

  6. luogu3959 宝藏 搜索+剪枝

    题目大意 参与考古挖掘的小明得到了一份藏宝图,藏宝图上标出了 n 个深埋在地下的宝藏屋, 也给出了这 n 个宝藏屋之间可供开发的 m 条道路和它们的长度. 小明决心亲自前往挖掘所有宝藏屋中的宝藏.但是 ...

  7. android binder 基础实例及解析(一)【转】

    本文转载自:http://blog.csdn.net/newchenxf/article/details/49359283#insertcode 原文网址(转载请注明出处): http://blog. ...

  8. E20171005-ts

    collapse  n. 垮台; (身体的) 衰弱;              vt. 使倒塌; 使坍塌; 使瓦解;               vi. 崩溃; 倒塌; 折叠; (尤指工作劳累后) 坐 ...

  9. github 用户不被识别问题

    期末考完,继续开发. 用过的都知道,直接用的话贡献者上面显示不出自己. 查一下就知道是因为github的识别是靠邮箱设置的.   但是如果频繁创建新仓库,容易忘记设定用户名和邮箱.   突发奇想,发现 ...

  10. Web程序安全机制

    ASP.NET提供了一个多层的安全模型,这个模型能够非常容易的保护Web应用程序. 安全策略没有必要非常复杂,但是需要应用安全策略的地方却是非常广泛的.程序员需要保证自己的应用程序不能被骗取,而把私有 ...