Skip to content
cccskills
FreePublished on GitHub

bb-invoke-magic

调用 Magic 8.3.641 执行 PD 操作:floorplan / place / DRC / layout extraction。

触发场景:(1) bba-guru-pd 做 floorplan 与 placement;(2) routing 后做 DRC;(3) LVS 前 extract SPICE;(4) 显式 /bb-invoke-magic。

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

See how to install

Files included (6)

  • SKILL.md3.3 KB
  • Gotcha/magic_pitfalls.md2.5 KB
  • references/asap7_magic_tech.md1.5 KB
  • scripts/parse_magic.py2.9 KB
  • scripts/render_magic_tcl.py3.0 KB
  • scripts/run_magic.py3.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

bb-invoke-magic

职责

按 action 切换四种模式调 Magic:floorplan / place / drc / extract。

注(M-05 dedup):action=floorplan 在本 skill 中保留为底层入口;bba-guru-pd 实际不直接调 floorplan,而是先调 bb-create-floorplan 生成 TCL,再以 action=place 把 TCL 执行(floorplan TCL 被 place_design 流程 source)。action=floorplan 仅供 ad-hoc 调试场景使用。

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

Input Args

argtyperequired说明
tech_filepathtrueASAP7 Magic tech file(.tech)
layout_inputpathtruefloorplan/place:.tcl;drc/extract:.def/.mag
actionenumtruefloorplan | place | drc | extract
design_namestringtrue—
top_modulestringtrue—
stampstringfalse<auto>

Output Contract

field值(按 action)
artifact_pathdrc→designs/<name>/pd/drc_report.txt;place→pd/placed.def;floorplan→pd/floorplan.mag;extract→pd/extracted.spice
script_pathdesigns/<name>/pd/magic_<action>_<stamp>.tcl
log_pathdesigns/<name>/pd/magic_<action>_<stamp>.log
violationsint(drc)
violation_list[{type,layer,coord}](drc)
cleanbool(drc:violations==0)
validbool
errorstring|null

4-Phase 执行

Phase 1 — render_magic_tcl

scripts/render_magic_tcl.py 按 action 生成 TCL:

# action=drc
tech load <tech_file>
load designs/<name>/pd/routed.def
drc check
drc count
drc find
writeall force
quit
# action=place
source <layout_input>
place_design
write_def designs/<name>/pd/placed.def
quit
# action=extract
tech load <tech_file>
load designs/<name>/pd/<top>.mag
extract all
ext2spice -o designs/<name>/pd/extracted.spice
quit

Phase 2 — run_magic

scripts/run_magic.py:

  1. source ~/wrk/eda_opensources/eda_env.sh
  2. magic --version | grep "8.3" 否则 VERSION_MISMATCH
  3. timeout 1800 magic -dnull -noconsole -T <tech_file> -rcfile /dev/null < <tcl> > <log> 2>&1

Phase 3 — parse_magic

  • drc:正则 DRC style.*?(\d+) error,violation 列表 (\w+) at (\d+),(\d+) layer (\w+)
  • place:检查 placed.def 存在 + size>0
  • floorplan:log 无 Error:
  • extract:extracted.spice 存在

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

Phase 4 — return

按 action 返回对应字段。bba-guru-pd:

  • drc.clean=false → optimization loop(调整 utilization)
  • place.valid=false → 重 floorplan
  • extract → 触发 bb-invoke-netgen

收敛 / 失败

action通过
drcviolations == 0
placeplaced.def 存在
floorplanlog 无 Error
extractextracted.spice 存在

失败 ≤5 次重试;超出开 synth-needs-fix。

资源索引

  • scripts/render_magic_tcl.py、scripts/run_magic.py、scripts/parse_magic.py
  • references/asap7_magic_tech.md
  • Gotcha/magic_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