创建时间和保持时间(setup time 和 hold time)

创建时间和保持时间贯穿了整个时序分析过程。只要涉及到同步时序电路,那么必然有上升沿、降低沿采样,那么没法避免setup-time 和 hold-time这两个概念。本文内容相对独立于该系列其余文章,是同步时序电路的基础。html

针对xilinx手册中一些概念的更新和术语的规范化,以及存在的一些问题,参考文档为UG906,已进行了一系列修改。--2019/5/5app

系列目录  electron

    时序收敛:基本概念工具

    创建时间和保持时间(setup time 和 hold time)ui

    OFFSET约束(OFFSET IN 和OFFSET OUT)spa

    Clock Skew , Clock uncertainly 和 Period设计

    特殊约束From To3d

    OFFSET IN 使用举例htm

    Achieving Timing Closureblog

1. 什么是setup-time 和 hold-time

    同步时序电路设计中,只在时钟的上升沿或降低沿进行采样。为了正确获得采样结果,须要确保采样时刻数据有效,所以工具会对综合结果进行静态时序分析,以判断时钟和数据之间的相对关系是否知足要求。以寄存器-寄存器之间的路径为例子

image

图1

 

image

图2

  •     发射时间(launch edge):源时钟发射数据的时刻
  •     采样时间(capture edge):目的时钟采样数据的时刻(显然采样时刻要晚于发射时刻)

    而Setup time和Hold time,按照维基百科的解释为

Setup time is the minimum amount of time the data signal should be held steady before the clock event so that the data is reliably sampled by the clock. This applies to synchronous input signals to the flip-flop.

Hold time is the minimum amount of time the data signal should be held steady after the clock event so that the data are reliably sampled. This applies to synchronous input signals to the flip-flop.

image

    不管是Setup time 或者Hold time,都是指时间上的相对关系;在具体分析过程当中,时钟有发射时钟和采样时钟,而各个路径上的数据也有不一样的延时,所以仅说起Setup time/Hold time每每有指代不清的问题。所以,Xilinx在UG902中明确了

  •     setup relationship:时序分析工具给出的launch edge和capture edge之间setup关系
  •     setup requirement:launch edge和capture edge之间最严格的setup约束(分析获得全部的setup relationship中的最小值)
  •     hold relationship:时序分析工具给出的launch edge和capture edge之间hold关系
  •     hold requirement:launch edge和capture edge之间最严格的hold约束(分析获得全部的hold relationship中的最大值)

 

    如图2所示,在同一理想时钟下,假设时钟周期为5ns;lanch time记为0ns,则capture time为5ns,此时setup relationship为5ns,hold relationship为0ns。

 

2. 创建在Setup和Hold上时序分析

    创建在上一节基础上,能够对数据的具体采样时刻进行分析,以判断是否在数据有效时刻完成了采样。若是说采样时刻比数据到达时刻晚,则知足了setup的要求。

    如图1所示,因为源时钟可能有路径延时,所以Q端的输出会比launch time晚source clock path delay,同时因为在数据路径上有延时,所以到达下一寄存器Q端还需花费datapath delay时间,所以

    Data Arrival Time(Setup) = launch edge time + source clock path delay + datapath delay

    相似可计算实际的采样时刻

    Data Required Time(Setup) = Caputure edge time + destinationclock path delay – clock uncertainty – Synchronous Element Setup time

    其中Synchronous Element Setup time是寄存器的特性,Clock Uncertainty相似下图所示,因为时钟的不肯定性,须要考虑最坏状况。

image

   Xilinx计算Slack来判断是否知足是须要求。Slack的中文意思是“松弛的”,能够简单的理解为设计余量。即若是slack是正数,那么设计知足要求,不然不知足要求。对于setup time的slack,有

        Slack = Data Required Time(Setup) - Data Arrival Time(Setup)

   如图2所示的理想状况下,Required Time(setup)为5ns,只要datapth delay不大于5ns,那么Slack就能知足要求。

   固然,在一个设计中会存在多条路径,全部的Slack均须要知足要求。

   

    相似的,也能够给出Hold的分析结果;与setup不一样,要求数据完成采样以后下一个数据才能到达。

    Data Arrival Time(hold) = launch edge time + source clock path delay + datapath delay

    Data Required Time(Setup) = Caputure edge time + destinationclock path delay + clock uncertainty + Synchronous Element Hold time

    Slack = Data Arrival Time(Hold) - Data Requried Time(Hold)

   如图2所示的理想状况下,Required Time(Hold)为0ns,只要datapth delay大于0,那么Slack就能知足要求。

相关文章
相关标签/搜索