bb-create-floorplan

SkillDev tools

Generates a Magic floorplan TCL from MAS (io_ring/pad_list/clock_plan) plus the synthesized netlist, and hands it to bb-invoke-magic for execution. Trigger scenarios: (1) floorplanning after bba-guru-pd synthesis; (2) regenerating with adjusted utilization after a DRC failure; (3) explicit /bb-creat

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the bb-create-floorplan skill

What this skill tells your AI

The instructions your AI receives, as published by amoslee2026/babel in .claude/skills/bb-create-floorplan/SKILL.md and read by ahel’s review.

职责

按 MAS IO ring + clock plan + utilization/aspect_ratio 参数渲染 Magic floorplan TCL。

  • 调用者:bba-guru-pd
  • 上游:bb-mas(MAS json)、bb-invoke-yosys(netlist)
  • 下游:bb-invoke-magic(action=place)
  • 禁止使用:Task / Agent / Skill

Input Args

argtyperequired默认说明
mas_pathpathtruedesigns/<name>/mas/mas.json
netlist_vpathtruedesigns/<name>/synth/netlist.v
tech_filepathtrueASAP7 Magic tech file
design_namestringtrue
utilizationfloatfalse0.65目标利用率
aspect_ratiofloatfalse1.0宽高比
stampstringfalse<auto>

Output Contract

field
artifact_pathdesigns/<name>/pd/floorplan_<stamp>.magic.tcl
script_pathdesigns/<name>/pd/gen_fp_<stamp>.py
io_countint
utilizationfloat
validbool
errorstring|null

Floorplan TCL 结构

# Auto-generated by bb-create-floorplan
# design: <name>  util: <util>  aspect: <ar>
# Read LEF for technology/cell definitions
readspice <netlist_spice>
# Or if using DEF-based flow:
# def read <design>.def
tech load <tech_file>
floorplan -utilization <util> -aspectratio <ar>

# IO placement (from MAS.pad_list / io_ring)
place_io -side N -pads { vdd vss }
place_io -side E -pads { rx_data[7:0] }
# ...

# Clock buffers (from MAS.clock_plan)
add_clock_buffer -net clk -buffer BUFX4_ASAP7

4-Phase 执行

Phase 1 — render_fp_py

scripts/render_fp_py.py 渲染 Python:

import json
mas = json.load(open(mas_path))
io_ring   = mas["io_ring"]
pad_list  = mas["pad_list"]
clk_plan  = mas.get("clock_plan", {})
# 按 io_ring side 分组 pads,渲染 TCL

Phase 2 — run_fp_gen

timeout 120 uv run python <script_path> > <artifact_path> 2> <log>

Phase 3 — parse_fp

scripts/parse_fp.py

  • 计 TCL 中 place_io 行数 → io_count
  • 与 MAS.pad_list 数量比对一致
  • 简单 tokenize check:括号配对、命令名合法

Phase 4 — return

返回 JSON。bba-guru-pdbb-invoke-magic(action=place, layout_input=artifact)。

收敛 / 失败

状态行动
valid=true进 Magic place
io_count 不匹配修正参数映射重试
DRC fail(下游反馈)调 utilization/aspect_ratio 重生成

资源索引

  • scripts/render_fp_py.pyscripts/run_fp_gen.pyscripts/parse_fp.py
  • assets/floorplan.tcl.tmpl
  • references/asap7_io_pads.md — ASAP7 可用 pad 单元
  • Gotcha/floorplan_pitfalls.md

Signals

GitHub stars
42
Forks
10
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
bb-create-floorplan
Source
github.com/amoslee2026/babel