“Because XDC constraints are applied sequentially, and are prioritized based on clear precedence rules, you must review the order of your constraints carefully.”
这句话告诉我们,XDC约束按顺序执行,且约束之间有优先级。那么,XDC约束的顺序由什么决定呢?XDC约束之间的优先级关系又是怎样的呢?

1 约束文件读取顺序

与ISE不同, Vivado使用约束集(constraints set)包含一个或多个XDC约束文件,每个约束文件包含一条或多条约束指令。确定了约束文件的读取顺序,也就基本确定了约束指令的执行顺序。
Xilinx XDC约束文件分为两类:
1. 用户约束文件 :出现在Sources > Hierarchy > Constraints文件夹下的约束集中;
2. IP 约束文件 :出现在Sources > IP Sources视图下的IP中;

Vivado通过PROCESSING_ORDER属性初步将Xilinx XDC约束文件的读取顺序分为三个等级:
1. EARLY : Files that must be read first
2. NORMAL : Default
3. LATE : Files that must be read last

对于用户约束文件
1. By default, user XDC files belong the PROCESSING_ORDER NORMAL group.
2. For user XDC files that belong to the same PROCESSING_ORDER group, their relative order desplayed in the Vivado IDE determines their read sequence.
3. The order within the group can be modified by moving the files in the Vivado IDE constraints set.

以上三点总结如下:
1. 用户约束文件PROCESSING_ORDER默认为NORMAL;
2. PROCESSING_ORDER相同的用户约束文件读取顺序由它们在Vivado约束集中的相对位置决定;
3. 可以通过拖拽的方式来改变用户约束文件在约束集中的位置,进而改变其读取顺序

对于IP约束文件
1. An IP XDC will have its PROCESSING_ORDER property set to either EARLY or LATE. No IP delivers XDC files that belong to the NORMAL constraints group.
2. For IP XDC files that belong to the same PROCESSING_ORDER group, the order is determined by import or creation sequence of the IP cores.
3. This order cannot be changed after the project has been created.

以上三点总结如下:
1. IP约束文件PROCESSING_ORDER默认只能EARLY或LATE,不能是NORMAL;
2. PROCESSING_ORDER相同的IP约束文件读取顺序由包含它们的IP核在Vivado IP Sources窗口中的相对位置决定,不可更改;

关于PROCESSING_ORDER相同的IP约束文件读取顺序的更改,个人有以下看法:
1. 可以通过将IP从工程中移除然后再重新添加到工程中的方式改变IP约束文件的读取顺序;
2. 可以通过将IP约束文件Disable然后复制其内容到用户约束文件的方式改变IP约束文件的读取顺序(Xilinx给出的方法);

关于IP约束文件再补充几点:
1. IP约束文件常见有ip_name.xdc、ip_name_ooc.xdc、ip_name_clocks.xdc等,其他相见ug896;
2. ip_name.xdc和ip_name_ooc.xdc默认的PROCESSING_ORDER为EARLY;
3. ip_name_clocks.xdc默认的PROCESSING_ORDER为LATE;

用户约束文件和IP约束文件之间的关系
1. By default, IP XDC files are read in before the user XDC files.
2. Processing it in this way allows an IP to create a clock object that can be referenced in the XDC.
3. It also allows you to overwrite physical constraints set by an IP core because the user constraints are evaluated after the IP.

关于以上三点总结如下:
1. 默认先读取IP约束文件后读取用户约束文件(原因在上面的2和3中已经给出),ip_name_clocks.xdc是个例外(相见ug896);

用户约束文件和IP约束文件的最终读取顺序如下:
1. User Constraints marked as EARLY
2. IP Constraints marked as EARLY (default)
3. User Constraints marked as NORMAL
4. IP Constraints marked as LATE (contain clock dependencies)
5. User Constraints marked as LATE

约束文件读取实例
使用report_compile_order -constraints命令可以查询当前工程所有约束文件的执行顺序,这里以xilinx自带的wavegen example design为例,如下图所示。

“Constraint evaluation order for ‘implementation’ with fileset ‘sources_1’ & with fileset ‘constrs_1’”

注意:char_fifo_ooc.xdc和clk_core_ooc.xdc未出现在上图中,因为上图报告的是"implementation"阶段约束文件的读取顺序,ip_name_ooc.xdc只在IP的OOC Synthesis综合阶段生成DCP文件时有用。

wavegen工程有两个IP:char_fifo和clk_core,其位置如下图所示:


wavegen工程有两个用户约束:wave_gen_tming.xdc和wave_gen_pins.xdc,其位置如下图所示:

2 约束指令执行顺序

前文提到过:约束文件的读取顺序确定了,约束指令的执行顺序也就基本确定了。注意这里说的是“基本确定”,但是尚未完全确定,因为约束指令之间可能存在冲突、重叠和依赖特殊情况。

约束按照对象不同可以分为物理约束(physical constraints)和时序约束(timing constraints)。

对于物理约束
1. 存在冲突(Conflict)的情况:If multiple physical constraints are conflicting, the latest constraint wins. For example, if an I/O port gets assigned a different location (LOC) through multiple XDC files, the latest location assigned to the port takes precedence.

对于时序约束
1. 存在冲突(Conflict)的情况:对同一个时钟Port使用两条create_clock指令创建时钟对象,在不加-add选项的情况下,后面的约束指令会覆盖前面的约束指令;
2. 存在重叠(Overlap)的情况:主要是时序例外(Timing Exception)约束中的路径重叠,时序例外约束有执行的优先级,和读取顺序没有关系,优先级按照指令不同、对象不同和选项不同如所示:
(1)指令不同
If constraints overlap (for example, if several timing exceptions are applied to the samepath), the priority from highest to lowest is:
a. Clock Groups (set_clock_groups)
b. False Path (set_false_path)
c. Maximum Delay Path (set_max_delay) and Minimum Delay Path (set_min_delay)
d. Multicycle Paths (set_multicycle_path)
(2)对象不同
The priority rule for the objects is:
1. Ports, pins, and cells
Pins of a cell are used instead of the cell itself.
2. Clocks
Clocks always have lower priority than ports, pins, and cells. A timing exception that uses clock object(s) always has a lower priority than another timing exception defined with ports, pins, and cells.
(3)选项不同
The precedence rule for the filters, from highest to lowest, is:
a. -from -through -to
b. -from -to
c. -from -through
d. -from
e. -through -to
f. -to
g. -through
3. 存在依赖(Dependency)的情况:
(1)一定要先创建主时钟
a. Start with the clock definitions.
b. The clocks must be created before they can be used by any subsequent constraints.
c. Any reference to a clock before it has been declared results in an error and the corresponding constraint is ignored.
(2)建议时序约束顺序如下
Timing Assertions Section
a. Primary clocks
b. Virtual clocks
c. Generated clocks
d. Clock Groups
e. Bus Skew constraints
f. Input and output delay constraints
Timing Exceptions Section
a. False Paths
b. Max Delay / Min Delay
c. Multicycle Paths
d. Case Analysis
e. Disable Timing

物理约束和时序约束的位置关系

两者关系如下:
Physical Constraints Section
1. located anywhere in the file, preferably before or after the timing constraints or stored in a separate constraint file

总结就是:物理约束要么在时序约束前边,要么在时序约束后边,最好分开存放在不同的约束文件中吗,如project_name_pinout.xdc和project_name_timing.xdc。

【ug903】Xilinx XDC约束的序(Order)相关推荐

  1. xilinx xdc 约束及时序收敛分析

    Clock Modifying Blocks (CMBs) 模块Vivado会自动生成时钟约束:     无效主时钟:ug906 page283 常用时序分析命令: //显示最差的前50个路径 rep ...

  2. 1,Xilinx Vivado XDC约束简介

    关于xilinx vivado FPGA XDC约束的所有讲解文档汇总:关于xilinxvivadoFPGAXDC约束的所有讲解文档汇总_vivado约束-嵌入式文档类资源-CSDN下载 在了解xil ...

  3. 2,xilinx vivado xdc约束语句的命令结构

    注:学习.交流就在博主的个人weixin公众号 "FPGA动力联盟" 留言或直接+博主weixin "fpga_start" 私信~  关于xilinx viv ...

  4. FPGA Vivado XDC 约束文件编写方式语法笔记

    参考手册: UG625:https://china.xilinx.com/support/documentation/sw_manuals/xilinx14_7/cgd.pdf UG903:https ...

  5. 关于XDC约束文件,你需要知道的几点

    原文地址:http://xilinx.eetrend.com/d6-xilinx/blog/2016-06/10241.html 在ISE时代,使用的是UCF约束文件.从Vivado开始,XDC成了唯 ...

  6. VIVADO XDC约束注意事项

    原文地址:http://xilinx.eetrend.com/d6-xilinx/blog/2016-06/10241.html 在ISE时代,使用的是UCF约束文件.从Vivado开始,XDC成了唯 ...

  7. Vivado使用误区与进阶——XDC约束技巧之I/O篇 (下)

    <XDC约束技巧之时钟篇>中曾对I/O约束做过简要概括,相比较而言,XDC中的I/O约束虽然形式简单,但整体思路和约束方法却与UCF大相径庭.加之FPGA的应用特性决定了其在接口上有多种构 ...

  8. XDC约束技巧——CDC篇

    上一篇<XDC约束技巧之时钟篇>介绍了XDC的优势以及基本语法,详细说明了如何根据时钟结构和设计要求来创建合适的时钟约束.我们知道XDC与UCF的根本区别之一就是对跨时钟域路径(CDC)的 ...

  9. XDC约束技巧之时钟篇

    Xilinx©的新一代设计套件 Vivado 中引入了全新的约束文件 XDC,在很多规则和技巧上都跟上一代产品 ISE 中支持的 UCF 大不相同,给使用者带来许多额外挑战.Xilinx 工具专家告诉 ...

最新文章

  1. 合肥python培训-在合肥学习Python去哪
  2. putty上传文件到linux_基于windows安装部署putty小工具及相关功能介绍
  3. linux 应用层gpio中断_如何在嵌入式Linux中检测GPIO线路上的中断?
  4. Eclipse导入GitHub项目两处报错处理
  5. java之简单的Callback使用总结
  6. es6新特性之Set
  7. 升级到WP8必需知道的13个特性
  8. 基于深度学习的图像风格转换
  9. 虚拟化技术简介--CPU/内存/IO/网络虚拟化介绍
  10. java ftp取远程服务器时间_在 Java 中如何获取 FTP 服务器上的文件修改时间
  11. WWW2022 | 知识提示的预训练微调
  12. 提高电脑反应速度_大家都能看懂的电脑内存条挑选技巧,电脑的内存条就应该这样选!...
  13. 关于PLSQL的破解,按图输入即可
  14. 群体遗传学习笔记-测序技术学习
  15. 制作集成SATA、RAID和AHCI驱动的Windows XP sp3 安装光盘
  16. rasa框架nlu源码解析
  17. 腾讯云工商注册服务重磅上线!全场低至10元起
  18. uniapp文档常用整理
  19. 磁盘挂载报错/dev/sdb1 is apparently in use by the system
  20. 爬取泡面小镇每日第一条新闻

热门文章

  1. List和IList的区别
  2. Write Zeroes
  3. 如何基于数据分析精准定位你的用户群?
  4. 分布式系统中的一致性模型
  5. 请把ios文件解压出来是什么意思_全网电影+美剧+日韩剧(ios+安卓)
  6. Sublime Text 3默认临时/缓存文件保存位置
  7. 浅谈CTF中各种花式绕过的小trick
  8. JavaPoet的使用指南
  9. SYN攻击原理以及防范技术
  10. opencv 锐化 java_如何在OpenCV中锐化图像?