可以使用 Synopsys® Design Constraint (SDC) 命令 set_multicycle_path 指定在源寄存器与目标寄存器之间传输数据的允许时钟周期数(相对于目标时钟或源时钟)。这在图 1 所示的场景中很有用。
图 1 显示了一个简单电路,其中的目标寄存器 reg2 需要多周期 2。寄存器 reg2 应每隔一个时钟周期对数据进行锁存。
下面的 SDC 命令约束以上电路中的时钟。
#Constrain the base clock
create_clock -period 10.000 [get_ports clk_in]
#Constrain the PLL output clock
create_generated_clock -source inst|inclk[0] -multiply_by 2 \
-name inst|clk[1] inst|clk[1]
#Constrain the input and output ports
set_input_delay -clock clk_in 1.2 [get_ports data_in]
set_input_delay -clock clk_in 1.5 [get_ports async_rst]
set_output_delay -clock clk_in 2 [get_ports data_out]
#Apply a multicycle of 2 to registers reg1 and reg2
#By default the multicycle is relative to the destination clock waveform
set_multicycle_path -setup -end -from [get_pins reg1|clk] -to [get_pins reg2|*] 2