Skip to content
Back to skills

Ic Xilinx Vivado

ASecurity

Xilinx/AMD Vivado 纯命令行 Batch Tcl 自动化、.xci 明文参数提取、仿真基准采集、综合/实现与 PPA 报告解析 Skill。 当需要用命令行运行 Vivado 综合/实现、提取 Timing/Utilization/Latch 报告、解析 .xci 明文参数或生成比特流时使用本 skill。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentspythonshellbashperformance

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add lihhf666-rgb/open-verilog-ip-skills --skill ic-xilinx-vivado --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ic Xilinx Vivado?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ic Xilinx Vivado
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lihhf666-rgb-ic-xilinx-vivado/badge)](https://www.skillsdirectory.com/skills/lihhf666-rgb-ic-xilinx-vivado)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ic-xilinx-vivado
description: >-
  Xilinx/AMD Vivado 纯命令行 Batch Tcl 自动化、.xci 明文参数提取、仿真基准采集、综合/实现与 PPA 报告解析 Skill。
  当需要用命令行运行 Vivado 综合/实现、提取 Timing/Utilization/Latch 报告、解析 .xci 明文参数或生成比特流时使用本 skill。
---

# Xilinx Vivado 命令行 Tcl 自动化(`ic-xilinx-vivado`)

## 一、定位与边界
* **只负责**:使用**非交互式 Batch Tcl(`vivado -mode batch`)**驱动 Vivado 工具链,解析 `.xci` 明文参数、跑综合/实现、抓取官方 `xsim` 黄金参考输出,并把庞大的 `.rpt` 报告解析为简洁结构化指标。
* **绝对禁止**:严禁尝试解密或逆向 Xilinx 加密文件;严禁在命令行中启动阻塞的 GUI 界面;严禁手动凭空编造综合资源数字(必须读取真实 `.rpt` 文件)。
* **环境配置说明**:可通过环境变量 `VIVADO_BIN` 指定 `vivado` / `vivado.bat` 路径(若已在系统 `PATH` 中则无需设置)。注意:Windows 下勿在 WSL Linux 内直接调用 Windows 版 `vivado`/`xsim`;命令行运行 `xsim` 必须带 `-R`(无 `-R` 会进入交互提示符阻塞)。
* **一键 OOC 综合 + 实现级(Post-Route `--impl`)+ 签核检查(`--signoff`)工具**:
  ```bash
  # 快速综合体检(Post-Synth):
  python skills/ic-xilinx-vivado/scripts/run_ooc_synth.py --top <TOP_MODULE> --part <TARGET_PART> --rtl rtl/<ip>.v --out-dir build/reports/r0 --name <ip>_r0 --clk aclk --period 5.0
  # 真实布局布线 + CDC/Methodology/Power 完整签核(--impl 自动包含 --signoff):
  python skills/ic-xilinx-vivado/scripts/run_ooc_synth.py --top <TOP_MODULE> --part <TARGET_PART> --rtl rtl/<ip>.v --out-dir build/reports/r0_impl --name <ip>_r0 --clk aclk --period 5.0 --impl
  ```
  *(支持 `--synth-period` 综合前高频驱动、`--impl-period` 实现时序驱动、`--signoff` 输出 `report_cdc` / `report_methodology` / `report_power` 摘要,以及 `--dcp <existing.dcp> --impl` 直接对已有检查点跑实现时序分析)*

---

## 二、确定性任务流程(4 种标准模式,直接套模板执行)

### 模式 1:解析 `.xci` 明文配置参数(用于净室替代)
直接调用本 Skill 配套的现成解析脚本 [parse_xci.py](./scripts/parse_xci.py)(无需手写临时解析器):
```powershell
python .agents/skills/ic-xilinx-vivado/scripts/parse_xci.py <path/to/ip.xci> --out docs/<ip>_xci_params.md
```
脚本自动提取 XML/JSON 格式 `.xci` 与 `_stub.v` 中的:
1. `VLNV`(IP 类型与版本,如 `xilinx.com:ip:fifo_generator:13.2`)
2. `Component_Name`(用户例化模块名,替代 IP 必须 100% 沿用此名或提供同名 Wrapper)
3. 所有 `valueSource="user"` 的用户显式修改参数(位宽、深度、读模式、延迟、复位极性、时钟模式)
4. `_stub.v` 文件中的精确端口列表(端口名、方向、位宽)

---

### 模式 2:Non-Project Batch 纯综合 + PPA 体检(最快,无需建工程!)
生成 `build/<mod>/run_synth.tcl` 并执行 `vivado -mode batch -nojournal -nolog -source build/<mod>/run_synth.tcl`:

```tcl
set PART    "<target_part>"     ;# e.g. xc7a100tcsg324-1 / xczu7ev-ffvc1156-2-e
set TOP     "<TOP_MODULE>"
set OUT_DIR "build/<TOP_MODULE>/reports"
file mkdir $OUT_DIR

# 1. 读入纯 Verilog-2001 源文件
read_verilog [glob rtl/*.v]

# 2. 综合前加载目标频率 XDC(必须放在 synth_design 之前!否则综合器无时序压力不会做扇出复制与逻辑重定时)
# 注意:严禁把 place_design 的 -directive PerformanceOptimized 错传给 synth_design!
read_xdc build/<TOP_MODULE>/target_clk.xdc
synth_design -top $TOP -part $PART -mode out_of_context

# 3. 报告前统一用基准时钟(如 5.000ns = 200MHz)约束全部 *clk* 端口,确保与官方 IP 公平对比 WNS/Fmax
set clks [get_ports -quiet -regexp -nocase {.*clk.*}]
if {[llength $clks] > 0} {
    create_clock -period 5.000 -name sys_clk $clks
}

# 4. 输出全套标准报告
report_utilization        -file "$OUT_DIR/utilization.rpt"
report_timing_summary     -file "$OUT_DIR/timing_summary.rpt" -max_paths 10
report_drc                -file "$OUT_DIR/drc.rpt"
report_clock_interaction  -file "$OUT_DIR/clock_interaction.rpt"
report_high_fanout_nets   -file "$OUT_DIR/high_fanout.rpt" -max_nets 10

write_checkpoint -force "$OUT_DIR/${TOP}_synth.dcp"
exit
```

---

### 模式 3:从报告中提取固定 PPA 指标表(严禁遗漏任何 1 项)
直接调用本 Skill 配套的现成解析脚本 [parse_ppa.py](./scripts/parse_ppa.py)(杜绝人工误读):
```powershell
python .agents/skills/ic-xilinx-vivado/scripts/parse_ppa.py --util <util.rpt> --timing <timing.rpt> --name "<IP_Label>"
```
> **OOC 叶节点时序说明**:若独立 IP 内部仅包含单颗硬核且无内部 reg-to-reg 路径(如单个 `RAMB18E1` 或单颗 `DSP48E1`),`WNS = N/A` 属正常现象;如需测极限 Fmax,可加 1 级输入/输出寄存壳后再测。

| 指标 | 来源文件 | 提取关键字 | 合格门禁 |
| :--- | :--- | :--- | :--- |
| **Slice LUTs** | `utilization.rpt` | `Slice LUTs` | 记录数量与占比 |
| **Slice Registers (FF)** | `utilization.rpt` | `Register as Flip Flop` | 记录数量与占比 |
| **意外 Latch 数** | `utilization.rpt` | `Register as Latch` | **必须 == 0** |
| **Block RAM Tile** | `utilization.rpt` | `Block RAM Tile` | 核对是否成功推断 BRAM |
| **DSP48E1** | `utilization.rpt` | `DSPs` | 核对是否成功推断 DSP |
| **WNS / TNS (ns)** | `timing_summary.rpt` | `Design Timing Summary` | **WNS >= 0.000 ns** |
| **最差路径逻辑级数** | `timing_summary.rpt` | `Logic Levels` | 记录 Top-1 供 `ic-timing-cdc` 使用 |

---

### 模式 4:官方 `.xci` 跑 `xsim` 录制黄金参考日志(用于等价性验证)
使用 `export_simulation -simulator xsim` 导出的 `vhdl.prj` / `vlog.prj` + `xvhdl` / `xvlog` → `xelab` → `xsim -R` 批处理命令(无需打开 GUI),**必须遵守 3 条防踩坑铁律**:
1. **等 `glbl.GSR` 释放**:Xilinx 仿真前 `100ns` 处于全局复位 `GSR` 屏蔽期,测试台在喂 `stim[0]` 前**必须先等 `#200; @(negedge clk);`**,否则前 10 拍输出全丢导致与 Verilator 错位!
2. **强制指定 `--work xil_defaultlib`**:编译测试台时必须写 `xvlog --relax --work xil_defaultlib tb.v`(`xvlog` 默认编进 `work` 库,不指定库名会导致 `xelab` 报 `[XSIM 43-3225] Cannot find design unit`!)。
3. **严格对齐采样契约(含 AXI-Stream 必避大坑)**:
   * 非握手模块:测试台在 `negedge clk` 驱动 `stim[i]`,在 `@(posedge clk); #1;` 后 `$fwrite`;
   * **AXI-Stream 握手模块**:**必须在 `@(posedge clk)` 之前(先 `#1;` 等组合 `tready` 稳定后)采样 `fire = tvalid && tready` 与 `tdata`**,绝不可在 `@(posedge clk); #1;` 之后才判 `tvalid && tready`(否则 `tready` 随上升沿跳变会导致首拍/反压拍漏记或错位!)。切忌对 `xelab` 静默丢弃输出而不检查 `$LASTEXITCODE`。

---

## 三、Vivado 报错确定性排查表(Max Retries = 3)

| 日志报错关键字 | 根因 | 固定修复动作 |
| :--- | :--- | :--- |
| `[Synth 8-439] module 'xxx' not found` | Tcl 漏读了依赖的 `.v` 文件 | 在 `read_verilog` 中补全缺失文件路径 |
| `[Synth 8-327] inferring latch for variable` | 组合块存在未覆盖分支产生 Latch | 立刻交回 `ic-verilog-style` 补全 `always @(*)` 块首默认值 |
| `[Synth 8-6859] multi-driven net` | 同一信号在多个块被驱动 | 立刻交回 `ic-verilog-style` 合并驱动源 |
| `[Place 30-58] IO placement is infeasible` | 独立 IP 端口超过芯片可用 IO,却忘了加 `-mode out_of_context` | 在 `synth_design` 加上 `-mode out_of_context` |
| `WNS < 0`(时序不收敛) | 关键路径过长 / 扇出过大 / 未打拍 | 将 `timing_summary.rpt` Top-3 路径原样交给 `ic-timing-cdc` |
| `TIMING-6 / TIMING-7 / TIMING-10` | 存在未约束或未同步的跨时钟域路径 | 交给 `ic-timing-cdc` 核查 CDC 同步器与 XDC 约束 |

---

## 四、强制退出自检清单
- [ ] Vivado Batch 进程退出码为 `0`,日志中 `ERROR:` 数量为 `0`
- [ ] 已从真实 `.rpt` 文件提取出完整的 PPA 指标表(含 LUT/FF/Latch/BRAM/DSP/WNS)
- [ ] `Register as Latch == 0`
- [ ] 若出现 `WNS < 0`,已完整附上 Top-3 最差路径原文供下游 `ic-timing-cdc` 处理

Files in this skill

  • SKILL.md8.3 KB
  • scripts/parse_ppa.py3 KB
  • scripts/parse_xci.py7.5 KB
  • scripts/run_ooc_synth.py16.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.