FPGA时序约束分析:IO延时约束方法
在多路数据同步设计时经常需要源同步,在设计源同步时经常会用到IO延时约束,特别是在时钟频率比较高的情况下对输入数据和时钟关系进行约束是很有必要的。在针对常见的DDR数据输入时约束如下:
# Center-Aligned Double Data Rate Source Synchronous Inputs
#
# For a center-aligned Source Synchronous interface, the clock
# transition is aligned with the center of the data valid window.
# The same clock edge is used for launching and capturing the
# data. The constraints below rely on the default timing
# analysis (setup = 1/2 cycle, hold = 0 cycle).
#
# input ____________________
# clock _____________| |_____________
# | |
# dv_bre | dv_are dv_bfe | dv_afe
# <------>|<------> <------>|<------>
# _ ________|________ ________|________ _
# data _XXXX____Rise_Data____XXXX____Fall_Data____XXXX_
#
set input_clock <clock_name>; # Name of input clock
set input_clock_period <period_value>; # Period of input clock (full-period)
set dv_bre 0.000; # Data valid before the rising clock edge
set dv_are 0.000; # Data valid after the rising clock edge
set dv_bfe 0.000; # Data valid before the falling clock edge
set dv_afe 0.000; # Data valid after the falling clock edge
set input_ports <input_ports>; # List of input ports
# Input Delay Constraint
set_input_delay -clock $input_clock -max [expr $input_clock_period/2 - $dv_bfe] [get_ports $input_ports];
set_input_delay -clock $input_clock -min $dv_are [get_ports $input_ports];
set_input_delay -clock $input_clock -max [expr $input_clock_period/2 - $dv_bre] [get_ports $input_ports] -clock_fall -add_delay;
set_input_delay -clock $input_clock -min $dv_afe [get_ports $input_ports] -clock_fall -add_delay;