| name | vivado-impl |
| description | 当用户需要 Vivado 实现策略选择和优化方面的帮助时使用此技能。这包括 opt_design(逻辑优化指令和选项)、place_design(布局指令、拥塞分析、PSIP 物理综合)、phys_opt_design(物理优化 - 扇出/布局/布线/SLR 交叉/寄存器优化、hold 修复)、route_design(布线指令、拥塞解决、预布线关键网络)、power_opt_design(时钟门控、BRAM 功耗优化)、增量实现(read_checkpoint -incremental、auto_incremental、reuse 分析)、ECO 流程、实现运行策略(Performance/Congestion/Area 策略)或选择实现指令或解决实现过程中时序/拥塞问题的任何问题。此技能为实现阶段提供决策知识——如需执行 TCL 命令使用 vivado-tcl,如需综合使用 vivado-synth,如需约束使用 vivado-constraints,如需时序报告解释和分析使用 vivado-analysis。 |
Vivado 实现决策指南
基于 UG904(v2025.2)。命令语法和属性表请参阅 REFERENCE.md;如需 RTL 优化示例(UG906 前后对比)请参阅 examples/ug906/ 目录。
实现流程概述
opt_design ← 逻辑优化(必需)
↓
power_opt_design ← 时钟门控功耗优化(可选,非 Versal)
↓
place_design ← 布局(必需)
↓
power_opt_design ← 布局后功耗优化(可选)
↓
phys_opt_design ← 布局后物理优化(可选,推荐)
↓
route_design ← 布线(必需)
↓
phys_opt_design ← 布线后物理优化(可选)
↓
write_bitstream ← 比特流(Versal 除外)
write_device_image ← 器件镜像(仅 Versal)
关键规则: 所有实现命令都是可重入的——它们可以在同一设计上重复运行。每次运行优化前一次运行的结果。
opt_design — 逻辑优化
指令决策表
| 场景 | 指令 | 效果 |
|---|
| 默认/首次尝试 | Default | 默认优化阶段 |
| 深度探索 | Explore | 多轮优化 |
| 面积减少(组合) | ExploreArea | 多轮,强调减少组合逻辑 |
| 面积减少(组合+时序) | ExploreSequentialArea | 减少组合和时序逻辑 |
| 探索 + LUT 重映射 | ExploreWithRemap | 探索 + 重映射优化 |
| 快速迭代 | RuntimeOptimized | 最少优化轮次 |
| QoR 建议 | RQS | 使用 report_qor_suggestion 策略 |
可用优化(18 个阶段)
| 阶段 | 选项 | 默认值 | 描述 |
|---|
| 1 | -retarget | ON | 跨器件系列重定目标原语 |
| 2 | -propconst | ON | 常量传播 |
| 3 | -sweep | ON | 移除无负载单元、tie-off、重定目标双口→单口 RAM |
| 4 | -muxf_remap | off | 将 MUXF7/F8/F9 重映射到 LUT3 以提高可布线性 |
| 5 | -carry_remap | off | 将短进位链重映射到 LUT |
| 6 | -control_set_merge | off | 合并等效控制集驱动器 |
| 7 | -merge_equivalent_drivers | off | 合并所有等效驱动器(不仅是控制) |
| 8 | -bufg_opt | ON | 在高扇出时钟/非时钟网络上插入 BUFG |
| 9 | -shift_register_opt | ON | SRL 扇出优化 + SRL↔寄存器变换 |
| 10 | -mbufg_opt | off | 用 MBUFG 替换并行 BUFGCE(Versal) |
| 11 | -dsp_register_opt | off | 优化 DSP 流水线寄存器 |
| 12 | (自动) | ON | 控制集减少(CONTROL_SET_REMAP 属性) |
| 13 | -hier_fanout_limit <N> | off | 基于模块的扇出复制 |
| 13 | -control_set_opt | off | 控制集优化(自动选择候选) |
| 14 | -remap | off | 组合级联 LUT 以减少逻辑层级 |
| 15 | -resynth_remap | off | 时序驱动的重新综合 + 重映射 |
| 16 | -resynth_area | off | 重新综合以减少面积(减少 LUT) |
| 17 | -resynth_seq_area | off | 重新综合以减少面积(组合 + 时序) |
| 18 | -bram_power_opt | ON | Block RAM 功耗优化(WRITE_MODE) |
重要: 指定单个选项会禁用所有默认选项。运行默认 + 额外:opt_design -retarget -propconst -sweep -bufg_opt -shift_register_opt -bram_power_opt -remap
place_design — 布局
指令决策表
| 场景 | 指令 | 受益设计 |
|---|
| 默认 | Default | 所有 |
| 深度探索 | Explore | 所有(更高努力细节布局) |
| 激进探索 | AggressiveExplore | 时序关键设计 |
| RAM/DSP 密集 | WLDrivenBlockPlacement | 许多 BRAM/DSP 块 |
| RAM/DSP 密集 | EarlyBlockPlacement | RAM/DSP 作为布局锚点 |
| 布局后满足但布线后失败 | ExtraNetDelay_high | 长距离网络、高扇出 |
| 布局后满足但布线后失败 | ExtraNetDelay_low | 相同,更低悲观主义 |
| 拥塞 | AltSpreadLogic_high | 高连接 → 拥塞 |
| 拥塞(中等) | AltSpreadLogic_medium/low | 中等拥塞 |
| SSI 拥塞 | SSI_SpreadLogic_high/low | SSI 器件 |
| SSI SLR 平衡 | SSI_SpreadSLLs | 跨 SLR 平衡 SLL 连接 |
| SSI SLR 平衡 | SSI_BalanceSLLs | SLR 之间平衡 SLL |
| SSI SLR 平衡 | SSI_BalanceSLRs | SLR 之间平衡单元数 |
| SSI 高利用率 | SSI_HighUtilSLRs | 在每个 SLR 中更紧密打包逻辑 |
| 额外布局后优化 | ExtraPostPlacementOpt | 所有 |
| 替代时序 | ExtraTimingOpt | 替代时序驱动算法 |
| ML 预测最佳 | Auto_1 | 最高置信度 ML 预测 |
| ML 预测第二 | Auto_2 | 第二最佳 ML 预测 |
| ML 预测第三 | Auto_3 | 第三最佳 ML 预测 |
| 快速迭代 | RuntimeOptimized | 以 QoR 换取速度 |
| 最快 | Quick | 非时序驱动,最小合法布局 |
| QoR 建议 | RQS | 使用 report_qor_suggestion |
关键选项
| 选项 | 效果 |
|---|
-post_place_opt | 布局后额外时序优化 |
-timing_summary | 强制基于 STA 的时序汇总(更准确,更慢) |
-no_timing_driven | 仅线长布局(最快) |
-no_psip | 禁用布局器中的物理综合 |
-no_bufg_opt | 禁用布局期间 BUFG 插入 |
-sll_align_opt | 对 SSI 多芯片部件对齐 SLL 寄存器 |
-ultrathreads | 跨 SLR 并行布局(UltraScale+ SSI) |
-unplace | 移除所有非固定布局 |
phys_opt_design — 物理优化
两种模式
- 布局后: 更激进,基于布局时序估计
- 布线后: 更保守,使用实际布线延迟,自动更新布线
提示: 布局后 phys_opt 对失败路径较少(WNS > -0.200 ns)的设计最有效。失败端点 > 200 的设计改进很小。
指令决策表
| 场景 | 指令 | 效果 |
|---|
| 默认 | Default | 默认优化 |
| 深度探索 | Explore | 多轮 + SLR 交叉 + 关键路径最终阶段 |
| 探索 + hold 修复 | ExploreWithHoldFix | 探索 + hold 违规修复 |
| 探索 + 激进 hold | ExploreWithAggressiveHoldFix | 探索 + 激进 hold 修复 |
| 最激进 | AggressiveExplore | 允许 SLR 交叉优化中 WNS 退化 |
| 替代复制 | AlternateReplication | 不同关键单元复制算法 |
| 扇出聚焦 | AggressiveFanoutOpt | 激进扇出优化 |
| 添加重定时 | AddRetime | 默认流程 + 寄存器重定时 |
| 激进 + 重定时 | AlternateFlowWithRetiming | 激进复制 + DSP/BRAM 优化 + 重定时 |
| 快速 | RuntimeOptimized | 最少迭代 |
关键单独选项
Setup 优化(布局后默认):
| 选项 | 描述 |
|---|
-fanout_opt | 复制高扇出网络驱动器(默认布局后) |
-critical_cell_opt | 复制失败路径中的单元(默认布局后) |
-placement_opt | 重新布局关键路径单元(默认两种模式) |
-dsp_register_opt | 在 DSP 单元内外移动寄存器 |
-bram_register_opt | 在 BRAM 单元内外移动寄存器 |
-uram_register_opt | 在 UltraRAM 单元内外移动寄存器 |
-shift_register_opt | 提取 SRL 末端级以改善时序 |
-restruct_opt | 交换 LUT 连接以减少逻辑层级 |
-lut_opt | 单 LUT 移动/复制 |
-clock_opt | 有用的时钟 skew 优化 |
布线优化(布线后默认):
| 选项 | 描述 |
|---|
-routing_opt | 重新布线关键网络/引脚(默认布线后) |
-slr_crossing_opt | 优化跨 SLR 路径(默认两种模式) |
-critical_pin_opt | 将 LUT 引脚映射到更快的物理引脚 |
Hold 修复:
| 选项 | 描述 |
|---|
-hold_fix | 修复超过阈值的 hold 违规 |
-aggressive_hold_fix | 修复更多 hold 违规 |
-sll_reg_hold_fix | SLL 寄存器 hold 修复(UltraScale+) |
-insert_negative_edge_ffs | 插入负边沿 FF 以分割 hold 路径 |
其他:
| 选项 | 描述 |
|---|
-retime | 寄存器重定时(Versal) |
-interconnect_retime | 通过 FF 移动的互连重定时(Versal) |
-force_replication_on_nets <nets> | 强制在特定网络上复制驱动器 |
-equ_drivers_opt | 将负载重新连线到等效驱动器 |
-casc_opt | LUT 级联优化(Versal) |
-cell_group_opt | 关键扇入锥组优化(Versal) |
-bram_enable_opt | 恢复时序关键使能路径上的 BRAM 功耗优化 |
-path_groups <args> | 限制优化到特定路径组 |
-tns_cleanup | 允许在保持 WNS 的情况下 slack 退化(带 -slr_crossing_opt) |
route_design — 布线
指令决策表
| 场景 | 指令 | 效果 |
|---|
| 默认 | Default | 默认布线 |
| 探索替代 | Explore | 探索不同关键路径路由(签发时序) |
| 激进探索 | AggressiveExplore | 更激进阈值 |
| 无时序放松 | NoTimingRelaxation | 从不放松时序目标 |
| 更多迭代 | MoreGlobalIterations | 所有阶段详细时序分析 |
| 强调延迟 | HigherDelayCost | 以编译时间换取延迟优化 |
| 快速 | RuntimeOptimized | 最少迭代 |
| 拥塞 | AlternateCLBRouting | 替代 CLB 布线算法 |
| 最快 | Quick | 非时序驱动,最小合法布线 |
| QoR 建议 | RQS | 使用 report_qor_suggestion |
关键选项
| 选项 | 效果 |
|---|
-tns_cleanup | 聚焦 WNS,修复非关键失败路径。在布线后 phys_opt 之前使用 |
-preserve | 保留现有路由,布线剩余。用于预布线关键网络 |
-nets <net_objects> | 仅布线指定网络 |
-pins <pin_objects> | 仅布线指定引脚 |
-delay | 以最小延迟布线单个网络 |
-auto_delay | 使用时序约束驱动的预算布线(与 -nets/-pins 一起使用) |
-max_delay <ps> / -min_delay <ps> | 引脚布线的目标延迟(与 -pins 一起使用) |
-unroute | 移除布线(整个设计或特定网络/引脚) |
-timing_summary | 强制 STA 时序汇总(更准确) |
-finalize | 完成部分布线的连接(ECO 流程) |
-eco | 增量 ECO 布线(小更改后更快) |
-ultrathreads | 并行布线(更快,轮次之间略有变化) |
-no_timing_driven | 禁用时序驱动布线(仅可行性测试) |
预布线关键网络模式
# 首先用最小延迟布线前 10 条关键网络
set preRoutes [get_nets -of [get_timing_paths -max_paths 10]]
route_design -nets [get_nets $preRoutes] -delay
# 然后保留关键路由布线其余
route_design -preserve
power_opt_design — 功耗优化
# 基本用法(优化整个设计)
power_opt_design
# 控制范围
set_power_opt -include_cells [get_cells inst_A]
set_power_opt -exclude_cells [get_cells inst_B]
set_power_opt -cell_types {BRAM}
set_power_opt -clocks {clk1}
注意: 不支持 Versal。如果已由 opt_design 完成,BRAM 功耗优化会被跳过。
增量实现
设置
# 非工程模式
read_checkpoint -incremental <reference_routed.dcp>
# 自动增量(推荐)
read_checkpoint -incremental -auto_incremental <reference.dcp>
# 即使条件不满足也强制增量
read_checkpoint -incremental -force_incr <reference.dcp>
# 修复特定对象
read_checkpoint -incremental <ref.dcp> -fix_objects [all_rams]
增量指令
read_checkpoint -incremental -directive <directive> <ref.dcp>
| 指令 | 效果 |
|---|
RuntimeOptimized | 最大重用,目标与参考 WNS 相同(默认) |
TimingClosure | 拆除失败路径,努力关闭时序 |
Quick | 无计时器,最快,需要 WNS > 1.0 ns |
自动增量条件
- 单元匹配 ≥ 94%
- 网络匹配 ≥ 90%
- 参考 WNS ≥ -0.250 ns
分析
report_incremental_reuse -file incr_reuse.rpt
注意: 不支持 Versal。
拥塞分析与解决
拥塞级别
- 级别 5(32x32 tiles)— 警告阈值,预期时序影响
- 级别 8+ — 路由器提前退出,设计可能不可布线
诊断
report_design_analysis -congestion -file congestion.rpt
report_route_status -file route_status.rpt
解决决策树
- 综合: 使用
AlternateRoutability 指令,减少 MUXF/CARRY 使用
- opt_design: 使用
-muxf_remap、-carry_remap、LUT_DECOMPOSE 属性
- place_design: 使用
AltSpreadLogic_high 或 SSI_SpreadLogic_high
- route_design: 使用
AlternateCLBRouting
- RTL 更改: 减少扇出,流水线长路径,减少资源利用率
预定义实现策略(工程模式)
性能聚焦
Performance_Auto_1/2/3、Performance_Explore、Performance_ExplorePostRoutePhysOpt、Performance_ExploreWithRemap、Performance_WLBlockPlacement、Performance_WLBlockPlacementFanoutOpt、Performance_EarlyBlockPlacement、Performance_NetDelay_high/low、Performance_Retiming、Performance_ExtraTimingOpt、Performance_RefinePlacement、Performance_SpreadSLLs、Performance_BalanceSLLs、Performance_BalanceSLRs、Performance_HighUtilSLRs
拥塞聚焦
Congestion_SpreadLogic_high/medium/low、Congestion_SSI_SpreadLogic_high/low
面积聚焦
Area_Explore、Area_ExploreSequential、Area_ExploreWithRemap