Skip to content
cccskills
FreePublished on GitHub

bb-invoke-klayout

调用 KLayout 0.30.8 执行 GDSII 导出(stream out)、GDS-level DRC、或导出后 verify。PD 流程末尾产出最终 .gds(signoff 产物)。

触发场景:(1) bba-guru-pd routed 后 GDS export;(2) GDS 层 DRC 检查;(3) 导出后 verify;(4) 显式 /bb-invoke-klayout。

The English summary is being prepared. Showing the original description.

See how to install

Files included (8)

  • SKILL.md3.6 KB
  • assets/drc_runset.drc302 B
  • assets/export_gdsii.lym309 B
  • Gotcha/klayout_pitfalls.md2.4 KB
  • references/asap7_klayout_tech.md2.1 KB
  • scripts/parse_klayout.py2.6 KB
  • scripts/render_klayout.py3.7 KB
  • scripts/run_klayout.py3.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

bb-invoke-klayout

职责

按 action 切换三种模式调 KLayout:gdsii_export(DEF → GDS,别名 export_gds)、drc(GDS 层规则检查)、或 verify(导出后回读 + 单元完整性校验)。

  • 调用者:bba-guru-pd
  • 禁止使用:Task / Agent / Skill

Input Args

argtyperequired说明
input_defpathtrueexport/verify: pd/routed.def 或 gdsii/<name>.gds;drc: pd/*.gds
tech_filepathtrueASAP7 KLayout tech file(.lyt)
actionenumtruegdsii_export (== export_gds alias) | drc | verify
design_namestringtrue—
top_modulestringtrue—
runsetpathfalseDRC 模式 runset 路径(默认 ASAP7 内置)
stampstringfalse<auto YYYYMMDD-HHMMSS>

Output Contract

field值
artifact_pathexport→designs/<name>/gdsii/<name>.gds;drc→designs/<name>/pd/klayout_drc_<stamp>.lyrdb;verify→designs/<name>/gdsii/<name>_verify_<stamp>.json
script_pathdesigns/<name>/pd/klayout_<action>_<stamp>.lym
log_pathdesigns/<name>/pd/klayout_<action>_<stamp>.log
gds_size_bytesint(export 模式)
violationsint(drc 模式)
verify_okbool(verify 模式:cells_expected == cells_found 且无 open 错误)
validbool
errorstring|null

4-Phase 执行

Phase 1 — render_klayout_script

scripts/render_klayout.py 按 action 渲染 LYM/Ruby 脚本,承载:

  • gdsii_export / export_gds: DEF→GDS stream out(assets/export_gdsii.lym)
  • drc: 加载 runset(assets/drc_runset.drc)
  • verify: 重新打开导出的 GDS,遍历 top cell hierarchy,统计 cells / nets,与 placed.def 期望值比对

Phase 2 — run_klayout

scripts/run_klayout.py:

  1. source ~/wrk/eda_opensources/eda_env.sh
  2. klayout -v 2>&1 | grep "0.30" 否则 VERSION_MISMATCH
  3. timeout 1800 klayout -b -rd input=<def> -rd tech=<tech> -rd output=<gds> -r <script> > <log> 2>&1
  4. log 末尾追加 exit:<rc>

Phase 3 — parse_klayout

scripts/parse_klayout.py:

  • gdsii_export / export_gds:.gds 存在 + size>0 → valid=true,记 gds_size_bytes
  • drc:解析 .lyrdb 中 <item> 数 → violations
  • verify:log 中 cells_found=<N>、opens=<M> 等指标 → verify_ok = (opens==0 && cells_found>=cells_expected)

写 klayout_<action>_<stamp>.json。

Phase 4 — return

返回 JSON。

  • export valid=true → 触发 verify 二次校验后 PD signoff
  • drc violations==0 → 干净
  • verify verify_ok=true → 最终签字

收敛 / 失败

状态行动
export valid=truesignoff
export valid=false上溯 Magic DRC 定位
drc violations>0bba-guru-pd 开 synth-needs-fix(综合冲突)或重布线
VERSION_MISMATCH修 eda_env.sh
Phase 2 timeout(1800s)error="KLAYOUT_TIMEOUT"

资源索引

  • scripts/render_klayout.py、scripts/run_klayout.py、scripts/parse_klayout.py
  • assets/export_gdsii.lym — DEF→GDS LYM 模板
  • assets/drc_runset.drc — ASAP7 DRC runset 模板
  • references/asap7_klayout_tech.md
  • Gotcha/klayout_pitfalls.md

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<一句话说清『这个 skill 做什么 + 何时调用』。把最关键的触发场景放最前面。结尾给 2-3 个用户会说的关键词。>

The English summary is being prepared. Showing the original description.

amoslee2026/Babel49Updated Aug 4, 2026

从粗略 idea 设计芯片或功能模块架构,输出专业架构文档到 spec_arch 目录。Trigger: 芯片架构设计, IC架构, 电路模块设计, 硬件架构. Generate IC/Chip architecture specification from rough ideas.

The English summary is being prepared. Showing the original description.

amoslee2026/Babel49Updated Aug 4, 2026

基于 AST 检查 CDC/RDC 违例:对比 MAS clock_domains 找跨域信号,检查是否被 2ff-sync CBB 保护。触发场景:(1) bba-guru-synthesis 综合前;(2) 显式 /bb-check-cdc。

The English summary is being prepared. Showing the original description.

amoslee2026/Babel49Updated Aug 4, 2026

调用 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。

The English summary is being prepared. Showing the original description.

amoslee2026/Babel49Updated Aug 4, 2026

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.

The English summary is being prepared. Showing the original description.

amoslee2026/Babel49Updated Aug 4, 2026

对抗性代码评审:代码质量 / 可维护性 / 时序风险 / 综合友好度 / MAS 对齐度。默认 ruthless 模式,找 EVERY flaw。触发场景:(1) RTL lint 后;(2) 显式 /bb-code-review。

The English summary is being prepared. Showing the original description.

amoslee2026/Babel49Updated Aug 4, 2026

See all skills by amoslee2026

Report a problem with this skill