本文へ移動
cccskills
無料GitHub で公開

bb-find-module-deps

扫描 RTL 目录提取模块层次依赖,拓扑排序后写 file_list.f(叶模块在前,top 在最后),供 Yosys/Verilator 使用。触发场景:(1) bba-guru-rtl 生成 RTL 后生成 file_list;(2) 显式 /bb-find-module-deps。

インストール方法を見る

含まれるファイル(5)

  • SKILL.md3.2 KB
  • Gotcha/sv_pitfalls.md1.0 KB
  • scripts/parse_filelist.py913 B
  • scripts/render_filelist_py.py657 B
  • scripts/run_filelist.py3.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

bb-find-module-deps

职责

扫 designs/<name>/rtl/*.sv,构建 module → file 映射 + module instantiation 图,Kahn 拓扑排序,写 file_list.f。

  • 调用者:bba-guru-rtl
  • 下游:bb-check-lint、bb-invoke-yosys、bb-invoke-verilator
  • 禁止使用:Task / Agent / Skill

Input Args

argtyperequired默认说明
rtl_dirpathtrue—designs/<name>/rtl/
top_modulestringtrue—顶层名
design_namestringtrue——
include_dirslist[path]false[]+incdir+ 列表
defineslist[str]false[]+define+KEY=VAL
stampstringfalse<auto>—

Output Contract

field值
artifact_pathdesigns/<name>/file_list.f
script_pathdesigns/<name>/rtl/gen_filelist_<stamp>.py
module_countint
top_modulestr
orderlist[str](拓扑序模块名)
validbool
errorstring|null

4-Phase 执行

Phase 1 — render_filelist_py

scripts/render_filelist_py.py 生成 Python:

# 优先用 verible-verilog-syntax 解析(识别 interface/class/package 与 module,避免误判 — fix M-04)
# 失败时退到正则 fallback
try:
    import subprocess, json
    out = subprocess.check_output(["verible-verilog-syntax", "--export_json", f]).decode()
    ast = json.loads(out)
    # 遍历 ast 找 ModuleDeclaration nodes
except Exception:
    # fallback: 正则 `^\s*module\s+(\w+)` + 排除 interface/class/package 关键字
    pass

# 然后建 dep 图:parent_module → set(child_module)
# Kahn 拓扑(child 先 parent 后);检测环
# 写 file_list.f:incdir / define / 拓扑序文件

Phase 2 — run_filelist_gen

scripts/run_filelist.py:timeout 180 uv run python <script_path> > <log> 2>&1

Phase 3 — parse_filelist

scripts/parse_filelist.py:

  • 验证 file_list.f 存在
  • 验证 top_module 对应文件是最后一个
  • 计数 module_count
  • log 含 Cyclic dependency → error="cyclic: A->B->A"

Phase 4 — return

返回 JSON。bba-guru-rtl 直接把 artifact_path 传给下游。

file_list.f 格式

+incdir+designs/<name>/rtl/include
+define+TARGET_ASAP7
designs/<name>/rtl/uart_fifo.sv
designs/<name>/rtl/uart_rx.sv
designs/<name>/rtl/uart_tx.sv
designs/<name>/rtl/uart_ctrl.sv
designs/<name>/rtl/uart_top.sv

收敛 / 失败

状态行动
valid=true进 bb-check-lint
cyclic开 arch-needs-fix(模块循环必须重设计)
找不到 top_moduleerror="top not found",bba-guru-rtl 修正

资源索引

  • scripts/render_filelist_py.py、scripts/run_filelist.py、scripts/parse_filelist.py
  • lib/sv_module_regex.py — module/instantiation 正则集
  • Gotcha/sv_pitfalls.md — 接口/类等被误识别为 instantiation

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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

日本語の概要は準備中です。原文の説明を表示しています。

amoslee2026/Babel492026年8月4日 更新

bb-arch

無料

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

日本語の概要は準備中です。原文の説明を表示しています。

amoslee2026/Babel492026年8月4日 更新

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

日本語の概要は準備中です。原文の説明を表示しています。

amoslee2026/Babel492026年8月4日 更新

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

日本語の概要は準備中です。原文の説明を表示しています。

amoslee2026/Babel492026年8月4日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

amoslee2026/Babel492026年8月4日 更新

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

日本語の概要は準備中です。原文の説明を表示しています。

amoslee2026/Babel492026年8月4日 更新

amoslee2026 のスキルをすべて見る

このスキルの問題を報告する