跳转至

SDC 时序约束

1. 时钟约束

# 主时钟
create_clock -name clk_cpu -period 2.0 [get_ports clk_cpu]
create_clock -name clk_axi -period 2.0 [get_ports clk_axi]
create_clock -name clk_apb -period 8.0 [get_ports clk_apb]

# 时钟不确定性
set_clock_uncertainty -setup 0.1 [get_clocks clk_cpu]
set_clock_uncertainty -hold 0.05 [get_clocks clk_cpu]

# 时钟延迟
set_clock_transition 0.1 [get_clocks clk_cpu]

2. 输入输出延迟

1
2
3
4
5
6
7
# 输入延迟
set_input_delay -clock clk_cpu 0.5 [get_ports {rst_n}]
set_input_delay -clock clk_apb 1.0 [get_ports {uart_rx}]

# 输出延迟
set_output_delay -clock clk_cpu 0.5 [get_ports {uart_tx}]
set_output_delay -clock clk_apb 1.0 [get_ports {gpio_out[*]}]

3. 多周期路径

1
2
3
# 跨时钟域路径
set_multicycle_path -setup 2 -from [get_cells -hierarchical *cdc_sync*]
set_multicycle_path -hold 1 -from [get_cells -hierarchical *cdc_sync*]

4. 假路径

1
2
3
4
5
6
# 异步复位路径
set_false_path -from [get_ports rst_n]
set_false_path -to [get_ports rst_n]

# 测试路径
set_false_path -from [get_cells -hierarchical *scan*]

5. 面积约束

set_max_area 0

6. 功耗约束

set_operating_conditions -max slow_max -min fast_min
set_power_budget -total 100mW