本文基于vivado进行说明。
1、在进行FPGA设计过程中,一旦工作时钟较高,FPGA资源使用率较高的情况下,时序违例就不可避免。例如工作时钟200MHz,假设FPGA资源使用率不到一半,那么可以使用资源换速度,但是占用再多的资源后,资源换速度就行不通了。
2、时序违例大概有三种,见下图
(1)intre-clock是同一个时钟下的违例
(2)inter-clock是跨时钟违例
(3)async clock是异步时钟违例
3、时序违例解决办法
时序违例一般是通过约束解决,即XDC。
时钟信号一般都要进行约束。约束方法如下:
create_clock -period 10 [get_ports sysclk]---约束主时钟
create_generated_clock
-name -source [get_pins CLKIN] - multiply_by 4 \
-divide_by 3 [get_pins CLKOUT]---约束主时钟生成的时钟
set_input_delay
-clock sysClk 2 [get_ports DIN]
set_output_delay
-clock sysClk 1 [get_ports DOUT]
set_multicycle_path
<path_multiplier> [-setup|-hold] [-start|-end]
[-from <startpoints>] [-to <endpoints>] [-through <pins|cells|nets>]
set_false_path
-from [get_port xx] -to [all_registers]
set_clock_groups
-group CLKA -group CLKB
set_max_delay
<delay> [-datapath_only] [-from <node_list>]
[-to <node_list>] [-through <node_list>]
set_min_delay
<delay> [-from <node_list>]
[-to <node_list>] [-through <node_list>]
通过以上约束时序问题都能得到解决。具体可以参考官方UG903、906。