<一句话说清『这个 skill 做什么 + 何时调用』。把最关键的触发场景放最前面。结尾给 2-3 个用户会说的关键词。>
日本語の概要は準備中です。原文の説明を表示しています。
调用 Yosys 0.35 对 RTL 进行逻辑综合并技术映射到 ASAP7 标准单元,产出门级网表 + QoR 报告。支持并行综合(基于空闲CPU数量)。Workflow: (1)生成综合脚本;(2)并行执行综合;(3)LLM检查结果并迭代优化。
触发场景:(1) bba-guru-synthesis 已完成 SDC 与 CDC 检查、需要生成 netlist;(2) PD 反馈 area/path 超标需要重综合;(3) 显式 /bb-invoke-yosys。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
把 RTL 综合 → 技术映射 → ASAP7 标准单元网表,并产出供下游(OpenSTA、PD)使用的 QoR JSON。
核心 Workflow(LLM驱动):
generate_synthesis_config.py + render_yosys_tcl.pyrun_parallel_synthesis.py(并行数=空闲CPU数)synthesis_summary.json,修复问题并重试调用者:bba-guru-synthesis。
被调用方:Yosys 内置 abc 命令(独立 skill bb-invoke-abc 已 DEPRECATED,仅 mapping_effort=high 等高级调优时才链式调用)。
禁止使用:Task / Agent / Skill(本 skill 是叶子 skill,不递归调用其他 agent)。
| arg | type | required | 默认 | 说明 |
|---|---|---|---|---|
| file_list | path | true | — | file_list.f,每行一个 RTL 源文件路径 |
| sdc_path | path | true | — | constraints/<name>.sdc(yosys 仅做时序参考) |
| tech_lib | path | false | libs/asap7/.../asap7sc7p5t.lib | ASAP7 Liberty(脚本 --tech-lib 有默认值,可省略) |
| top_module | string | true | — | 顶层模块名 |
| design_name | string | true | — | 用于路径 designs/<name>/synth_parallel/ |
| abc_options | string | false | -g AND,OR,NAND,NOR,XOR | ABC 优化参数 |
| mapping_effort | enum | false | medium | low / medium / high |
| enable_retiming | bool | false | false | 是否启用 retiming pass |
| mode | enum | false | single | single(单模块)/ hierarchical(分层多模块) |
| modules | path | false | — | JSON文件列出子模块(hierarchical模式) |
写入 designs/<name>/synth_parallel/,返回 summary JSON:
| field | 值 |
|---|---|
synthesis_summary.json | 综合结果汇总 |
results[].artifact_path | designs/<name>/synth_parallel/<module>/netlist_<stamp>.v |
results[].qor_path | designs/<name>/synth_parallel/<module>/qor_<stamp>.json |
results[].valid | bool(综合成功 true) |
results[].cell_count | int |
results[].chip_area_um2 | float |
results[].wire_count | int |
results[].error | string|null |
max_parallel | int(并行执行数=空闲CPU数) |
调用 scripts/generate_synthesis_config.py,生成 synthesis_config.json:
python3 scripts/generate_synthesis_config.py \
--file-list designs/<name>/rtl/file_list.f \
--sdc designs/<name>/constraints/<name>.sdc \
--top <top_module> \
--design-name <name> \
--tech-lib libs/asap7/.../asap7sc7p5t.lib \
--out designs/<name>/synth_parallel/synthesis_config.json \
--mode single|hierarchical
LLM职责: 根据MAS/RTL结构决定 mode,准备输入参数。
run_parallel_synthesis.py 内部调用 scripts/render_yosys_tcl.py,为每个模块生成TCL脚本:
read_verilog -sv 逐行展开 file_list.fhierarchy -check -top <top_module> 检查顶层synth -top <top_module> 通用综合dfflibmap -liberty <tech_lib> DFF 映射abc -liberty <tech_lib> <abc_options> 技术映射abc -liberty <tech_lib> -script +retime (若 enable_retiming)opt_clean -purgewrite_verilog -noattr <netlist>stat -liberty <tech_lib> 输出统计并行准备: 所有模块的TCL脚本同时生成,不阻塞。
调用 scripts/run_parallel_synthesis.py:
python3 scripts/run_parallel_synthesis.py \
--config designs/<name>/synth_parallel/synthesis_config.json \
--timeout 600
并行执行:
get_idle_cpu_count())ProcessPoolExecutor 并行运行综合max_workers = min(idle_cpus, module_count)每个模块执行:
source ~/wrk/eda_opensources/eda_env.shyosys -V 输出含 Yosys 0.35yosys -c <tcl_path> > <log_path> 2>&1exit:<rc>run_parallel_synthesis.py 内部调用 scripts/parse_qor.py,从 log 提取:
Chip area for module <top>: <float> → chip_area_um2Number of cells: <int> → cell_countNumber of wires: <int> → wire_countERROR: / Error: 行 → error生成 synthesis_summary.json:
{
"stamp": "20260519_120000",
"total_elapsed": 45.3,
"max_parallel": 4,
"modules_total": 3,
"modules_passed": 2,
"modules_failed": 1,
"results": [...]
}
LLM职责:
synthesis_summary.jsonvalid=false)MULTIDRIVEN / latch inferred → rtl-needs-fixWIDTHEXPAND (≥5次) → rtl-needs-fixYOSYS_TIMEOUT → 降低复杂度、增加 opt -fastVERSION_MISMATCH → 修复EDA环境bba-guru-synthesis# Step 1: Generate config
python3 scripts/generate_synthesis_config.py \
--file-list designs/uart16550/rtl/file_list.f \
--sdc designs/uart16550/constraints/uart16550.sdc \
--top uart16550 \
--design-name uart16550 \
--out designs/uart16550/synth_parallel/synthesis_config.json
# Step 2: Run parallel synthesis
python3 scripts/run_parallel_synthesis.py \
--config designs/uart16550/synth_parallel/synthesis_config.json \
--timeout 600
# Step 3: LLM analyzes synthesis_summary.json and iterates
| 空闲CPU | 模块数 | max_parallel |
|---|---|---|
| 1 | N | 1(串行) |
| 4 | 3 | 3(全并行) |
| 4 | 10 | 4(分批并行) |
| 8 | 10 | 8(分批并行) |
检测方法:读取 /proc/loadavg 计算 idle_cpus = total_cpus - load_avg
| 状态 | 处理 |
|---|---|
modules_failed == 0 | 调用 bb-invoke-opensta 做 STA |
modules_failed > 0(RTL错误) | 返回错误,调整后重试 |
| Phase 3 timeout(600s) | 返回 {valid:false, error:"YOSYS_TIMEOUT"} |
VERSION_MISMATCH | 返回 {valid:false, error:"VERSION_MISMATCH"} |
scripts/generate_synthesis_config.py — Phase 1(配置生成)scripts/render_yosys_tcl.py — Phase 2(TCL渲染)scripts/run_parallel_synthesis.py — Phase 3(并行执行)scripts/run_yosys.py — 单模块执行器scripts/run_synthesis_first_run.py — 首轮/无库通用综合执行器(被 run_parallel_synthesis.py 使用)scripts/parse_qor.py — Phase 4(QoR解析)references/yosys_tcl_template.md — TCL 模板references/asap7_libs.md — ASAP7 库位置Gotcha/yosys_errors.md — 常见错误与修复まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
<一句话说清『这个 skill 做什么 + 何时调用』。把最关键的触发场景放最前面。结尾给 2-3 个用户会说的关键词。>
日本語の概要は準備中です。原文の説明を表示しています。
从粗略 idea 设计芯片或功能模块架构,输出专业架构文档到 spec_arch 目录。Trigger: 芯片架构设计, IC架构, 电路模块设计, 硬件架构. Generate IC/Chip architecture specification from rough ideas.
日本語の概要は準備中です。原文の説明を表示しています。
基于 AST 检查 CDC/RDC 违例:对比 MAS clock_domains 找跨域信号,检查是否被 2ff-sync CBB 保护。触发场景:(1) bba-guru-synthesis 综合前;(2) 显式 /bb-check-cdc。
日本語の概要は準備中です。原文の説明を表示しています。
调用 babel-lsp / verible-verilog-lint 检查 SV 源码。src 必须可综合(零 syntax error),tb 允许 verification constructs。发现 src error 时自动修复重检(max 3 iter)。触发:(1) bba-guru-rtl 生成后;(2) RTL 修复重检;(3) 显式 /bb-check-lint。
日本語の概要は準備中です。原文の説明を表示しています。
Babel internal issue protocol — close a handoff after downstream agent picked it up or user signed off. Moves designs/<name>/.handoff/<label>.md to .handoff/closed/ (using mv per CLAUDE.md), appends to handoff_log.jsonl.
日本語の概要は準備中です。原文の説明を表示しています。
对抗性代码评审:代码质量 / 可维护性 / 时序风险 / 综合友好度 / MAS 对齐度。默认 ruthless 模式,找 EVERY flaw。触发场景:(1) RTL lint 后;(2) 显式 /bb-code-review。
日本語の概要は準備中です。原文の説明を表示しています。