时序约束进阶四:set_input_delay和set_output_delay详解

news/2024/10/9 5:22:31/

目录

一、前言

set_input_delay%2Fset_output_delay-toc" style="margin-left:0px;">二、set_input_delay/set_output_delay

2.1 延时约束

2.2 约束设置界面

2.3 示例工程

2.4 Delay Value

2.5 Delay value is relative to clock edge

2.6 Delay value already includes latencies of the specified clock edge

2.7 Rise/Fall

2.8 Max/Min

2.9 Add delay information to the existing delay

一、前言

        为了在设计中准确的模拟信号从FPGA传输到外部或外部信号进入到FPGA端口的时序,在设计中需要给定输入端口和输出端口的延时信息,因为vivado仅仅能够识别边界内部的时序。此时,就需要使用到约束set_input_delay/set_output_delay

set_input_delay%2Fset_output_delay">二、set_input_delay/set_output_delay

2.1 延时约束

        set_input_delay输入时延约束指定了设计中输入时钟端口的输入时延,以应用板为例,输入时延表示在数据从外部芯片通过应用板到达FPGA的输入引脚和应用板的时钟相位存在差异。因此,输入时延值可以是正数也可以是复数,正负值取决于数据信号和时钟信号在外部芯片与FPGA接口处的相对相位。 

        set_output_delay约束指定了关联时钟沿的输出端口的输出路径时延,输出时延可理解为在数据从FPGA的输出端口到达其他芯片和关联的参考时钟间的相位差。输出时延值可以是正数也可以是复数,正负值取决于数据信号和时钟信号在外部芯片与FPGA接口处的相对相位。

2.2 约束设置界面

set input delay和set output delay设置界面相同,区别是Object(ports)中可设置的端口分别为输入端口和输出端口。

set output delay界面

2.3 示例工程

工程设计为一个简单的包含2个触发器的时序路径

module slow_to_fast(in,clk1,clk2,rst,out);
input in,clk1,clk2,rst;
output out;
reg ff1,ff2;
//时钟域一
always@(posedge clk1,negedge rst)
beginif(!rst)ff1<=0;elseff1<=in;
end
//时钟域二
always@(posedge clk2,negedge rst)
beginif(!rst)ff2<=0;else              //打两拍处理ff2<=ff1;
end
assign out=ff2;endmodule

 时序约束由两条主时钟约束加上set_input_delay和set_output_delay,input延时为1ns,output延时为2ns

create_clock -period 10.000 -name clk1 -waveform {0.000 5.000} [get_ports clk1]
create_clock -period 8.000 -name clk2 -waveform {0.000 4.000} [get_ports clk2]
set_input_delay -clock [get_clocks clk1] 1.000 [get_ports in]
set_output_delay -clock [get_clocks clk2] 2.000 [get_ports -filter { NAME =~  "*" && DIRECTION == "OUT" }]

2.4 Delay Value

延时值Delay Value可设置正值或负值,并且设为正值或负值在set_input_delay/set_output_delay中表现不同,set_input_delay中的设置input delay值直接添加到Data Path的最前段,可理解为此段即为正常路径的Source Clock Path

再看output delay,延时值output delay添加到Destination Clock Path,约束为2ns,分析时为-2ns,为何要取反呢?回到output delay的定义来,为数据输出端口的延时,但现在输出端口Data Path中并无新增2ns延时,延时添加到了Destination clock上。因此,对于捕获端,相当于时钟在原有基础上提前2ns(-2)到达,和延时值直接加到Data Path效果相同。

2.5 Delay value is relative to clock edge

Delay value is relative to clock edge用于设置延时值是相对于关联时钟的上升沿还是下降沿,默认为上升沿,如示例工程Input delay约束,延时参考时钟为clk1,同时clk1的上升沿在0ns处,因次Incr为0ns,

set_input_delay -clock [get_clocks clk1] 1.000 [get_ports in]

修改时钟clk1的下降沿在6ns处,同时input_delay参考边沿为下降沿

create_clock -period 10.000 -name clk1 -waveform {1.000 6.000} [get_ports clk1]

set_input_delay -clock [get_clocks clk1] -clock_fall 1.0 [get_ports in]

结果如下,因为下降沿在6ns处,因为总的延时值为6ns+1ns共7ns

2.6 Delay value already includes latencies of the specified clock edge

Delay value already includes latencies of the specified clock用于设置延时值是否包含set_clock_latency约束的延时。Vivado时序分析时会默认捕获时钟是在时钟延时(包含源延时和网络延时)后到达捕获触发器中,除非是set_input_delay/set_output_delay约束中指定包含了源延时或网络延时。该配置的设置主要是避免和set_clock_latency约束进行重复计算。

该配置选项可设置值如下

None:输入端口延时input delay不包含时钟延时
Network:输入端口延时包含网络延时

Source:输入端口延时包含源延时

Network/Source:输入端口延时包含源延时和网络延时

2.7 Rise/Fall

该配置和前面的Delay value is relative to clock edge容易混淆,看字面意思都是上升沿和下降沿,两者对象是完全不同,前者指时钟的上升沿或下降沿,此处指端口Port的切换沿为上升沿或下降沿,默认的是对Port的上升沿或下降沿都有效。但因port通常都是fall transition/rise transition都支持,因此,设置后看不到变化,该设置使用也不多。

2.8 Max/Min

Min/Max中Min为最小时延值,作用于hold/removal,Max为最大时延值,作用于setup/recovery分析,如果Min/Max都未选择,表示最大时延和最小时延值相等,该延时值同时引用到setup/hold分析中。

set_input_delay -clock [get_clocks clk1] -min -network_latency_included 1.0 [get_ports in]约束为例,clk1的同步路径中只有hold路径,无setup路径,符合预期。

约束中min修改max,set_input_delay -clock [get_clocks clk1] -max -network_latency_included 1.0 [get_ports in]

2.9 Add delay information to the existing delay

Add delay information to the existing delay勾选表示如果设置约束的端口已经存在约束延时,新增加的约束不会覆盖旧的,不勾选则覆盖旧的约束。

1)端口in上同时两条set_input_delay,但都没有add参数,约束生效遍历到第二条时,因没有-add_delay参数,因此后一条覆盖前一条,input delay为1.11ns

set_input_delay -clock [get_clocks clk1] 2.22 [get_ports in]
set_input_delay -clock [get_clocks clk1] 1.11 [get_ports in]

2)端口in上同时两条set_input_delay,但第一条添加了-add_delay参数,因此仍是后一条覆盖前一条,input delay为1.11ns

set_input_delay -clock [get_clocks clk1] -add_delay 2.22 [get_ports in]
set_input_delay -clock [get_clocks clk1] 1.11 [get_ports in]

3)端口in上同时两条set_input_delay,都添加了-add_delay参数,后一条有参数将不会覆盖前面的,因此,input delay为2.22ns

set_input_delay -clock [get_clocks clk1] -add_delay 2.22 [get_ports in]
set_input_delay -clock [get_clocks clk1] -add_delay 1.11 [get_ports in]

4)端口in上同时两条set_input_delay,只有第二条添加了-add_delay参数,因此,后一条有参数将不会覆盖前面的,input delay为2.22ns

set_input_delay -clock [get_clocks clk1] 2.22 [get_ports in]
set_input_delay -clock [get_clocks clk1] -add_delay 1.11 [get_ports in]

http://www.ppmy.cn/news/1536481.html

相关文章

Android Studio New里面没有New Flutter Project

跟着Flutter中文网的配置教程&#xff0c;安装好了flutter,在Android studio里面也安装了dart和flutter的插件。重启后还是在FIle->New里面没有显示New Flutter Project。 反复卸载重装dart和flutter插件好几次&#xff0c;依然没有效果。 原来是没有把Android APK Suppor…

CPU、GPU、显卡

CPU VS GPUCPU&#xff08;Central Processing Unit&#xff09;&#xff0c;中央处理器GPU&#xff08;Graphics Processing Unit&#xff09;&#xff0c;图形处理单元GPU 的技术演变CUDA&#xff08;Compute Unified Device Architecture&#xff09; 显卡&#xff08;Video…

QT:信号与槽

QT是一种流行的C框架&#xff0c;用于开发图形用户界面&#xff08;GUI&#xff09;应用程序。在QT中&#xff0c;信号与槽是一种用于实现对象间通信的机制。 信号&#xff08;signal&#xff09;是对象发出的事件或消息&#xff0c;槽&#xff08;slot&#xff09;是接收并处…

TCP协议的三次握手与四次挥手的过程

目录 三次握手&#xff08;建立连接&#xff09; 第一次握手&#xff08;SYN&#xff09; 第二次握手&#xff08;SYN-ACK&#xff09; 第三次握手&#xff08;ACK&#xff09; 四次挥手&#xff08;终止连接&#xff09; 第一次挥手&#xff08;FIN&#xff09; 第二次…

栈与队列面试题(Java数据结构)

前言&#xff1a; 这里举两个典型的例子&#xff0c;实际上该类型的面试题是不确定的&#xff01; 用栈实现队列&#xff1a; 232. 用栈实现队列 - 力扣&#xff08;LeetCode&#xff09; 方法一&#xff1a;双栈 思路 将一个栈当作输入栈&#xff0c;用于压入 push 传入的数…

微软官网列出了 Windows 11 LTSC 2024 中的全部新功能

今天早些时候&#xff0c;微软发布了有关受托管PC的Windows 11 24H2 升级和兼容性的详细信息。 该帖子针对的是负责在各自办公室和组织中处理系统的 IT 系统管理员。与此同时&#xff0c;微软也发布了有关 Windows 11 LTSC 或长期服务渠道的信息。 该公司已于四月早些时候证实…

YOLO11训练自己的数据集(吸烟、跌倒行为检测)

YOLO11训练自己的数据集&#xff08;吸烟、跌倒行为检测&#xff09; 前言相关介绍前提条件实验环境安装环境项目地址LinuxWindows 使用YOLO11训练自己的数据集进行吸烟、跌倒行为检测准备数据进行训练进行预测进行验证 参考文献 前言 由于本人水平有限&#xff0c;难免出现错漏…

Linux驱动学习——内核编译

1、从官网下载适合板子的Linux内核版本 选择什么版本的内核需要根据所使用的硬件平台而定&#xff0c;最好使用硬件厂商推荐使用的版本 https://www.kernel.org/pub/linux/kernel/ 2、将压缩包复制到Ubuntu内进行解压 sudo tar -xvf linux-2.6.32.2-mini2440-20150709.tgz 然…