Skip to content
cccskills
FreePublished on GitHub

bb-parse-ast

解析 SystemVerilog RTL 为 AST JSON,供 CDC 检查 / signal path tracing / module dep 分析。统一 4 个后端 (babel-lsp / pyverilog / verible / slang),auto 模式自动降级。

触发场景:(1) bba-guru-synthesis CDC 前;(2) bb-trace-signal-path / bb-find-module-deps 之前;(3) 显式 /bb-parse-ast。

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

See how to install

Files included (12)

  • SKILL.md3.8 KB
  • Gotcha/sv_syntax_unsupported.md2.2 KB
  • references/fallback/ast_schema.md1.3 KB
  • references/pyverilog_quickref.md1.6 KB
  • scripts/normalize_slang.py1.8 KB
  • scripts/normalize_verible.py2.3 KB
  • scripts/parse_ast_output.py1.4 KB
  • scripts/parse_fallback_output.py2.2 KB
  • scripts/render_fallback_sh.py1.6 KB
  • scripts/render_parser_py.py993 B
  • scripts/run_fallback.py4.7 KB
  • scripts/run_parser.py1.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

bb-parse-ast

解析 RTL 为 AST JSON。统一 4 个后端,对下游透明。

职责

  • 调用者:bba-guru-synthesis、bb-check-cdc、bb-trace-signal-path、bb-find-module-deps
  • 输出 schema 对所有 backend 一致(下游无需感知差异)
  • 禁止使用:Task / Agent / Skill

Backend 选择(2026-07-21 新增 babel-lsp)

backend触发条件实现
auto默认按 babel-lsp → pyverilog → verible → slang 顺序尝试
babel-lsp显式指定或 auto 首选Babel-LSP sv-analyzer,基于 slang 引擎(IEEE 1800-2023)
pyverilog显式指定纯 Python,覆盖 SystemVerilog 2012 子集
verible显式指定或 pyverilog 失败verible-verilog-syntax,覆盖 SV 2017
slang显式指定或前两者都失败slang,覆盖 SV 2017 + UVM

Input Args

argtyperequired默认说明
file_listpathtrue—file_list.f
design_namestringtrue——
backendenumfalseautoauto|babel-lsp|pyverilog|verible|slang
output_formatenumfalsejsonjson|pickle
stampstringfalse<auto>—

Output Contract

field值
artifact_pathdesigns/<name>/ast/ast_<stamp>.json
script_pathdesigns/<name>/ast/parse_ast_<stamp>.{py|sh}
backend_usedpyverilog|verible|slang
validbool
errorstring (e.g. UNSUPPORTED_SV_SYNTAX)

4-Phase 执行

Phase 1 — Render

  • backend=pyverilog → scripts/render_parser_py.py
  • backend=verible → scripts/render_fallback_sh.py(参数 --backend verible)
  • backend=slang → scripts/render_fallback_sh.py(参数 --backend slang)
  • backend=auto → 内部 try/except 链,先 pyverilog 再 verible 再 slang

Phase 2 — Run

timeout 600 uv run python <script_path> 或 bash <script_path>(verible/slang 是 shell)。

Phase 3 — Parse

  • scripts/parse_ast_output.py(pyverilog 输出归一化)
  • scripts/parse_fallback_output.py + scripts/normalize_{verible,slang}.py(verible/slang 输出归一化)

归一化输出 schema 对所有 backend 一致,下游可直接消费。

Phase 4 — Return

返回 JSON。error=UNSUPPORTED_SV_SYNTAX 仅在 backend=pyverilog 且 auto 模式禁用时返回。

资源索引

  • scripts/render_parser_py.py — pyverilog 渲染
  • scripts/parse_ast_output.py — pyverilog 输出归一化
  • scripts/run_parser.py — pyverilog 驱动
  • scripts/render_fallback_sh.py — verible/slang 渲染(shell wrapper)
  • scripts/parse_fallback_output.py — verible/slang 输出归一化主入口
  • scripts/normalize_verible.py / scripts/normalize_slang.py — 后端特定归一化
  • references/fallback/*.md — verible / slang 后端文档
  • Gotcha/ — pyverilog 已知陷阱

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