bb-trace-signal-path
SkillMonitoring & opsPerforms signal path tracing on AST JSON: extracts propagation paths from source to sink across module hierarchy and determines whether a path crosses clock domains. Intended for CDC violation root-cause analysis and critical path assistance. Trigger scenarios: (1) bb-check-cdc reports a violation a
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the bb-trace-signal-path skill
What this skill tells your AI
The instructions your AI receives, as published by amoslee2026/babel in .claude/skills/bb-trace-signal-path/SKILL.md and read by ahel’s review.
职责
读取 bb-parse-ast 产出的 AST JSON,DFS 跟踪 source 信号到 sink 的赋值/连线链,输出路径节点列表 + CDC 标记。
- 调用者:
bba-guru-synthesis、bb-check-cdc - 上游:
bb-parse-ast(或 fallback) - 禁止使用:Task / Agent / Skill
Input Args
| arg | type | required | 默认 | 说明 |
|---|---|---|---|---|
| ast_path | path | true | — | AST JSON |
| source_signal | string | true | — | 完整 hierarchical path:top.inst.sub.sig 或 模块本地:<module>.<signal>(fix M-11) |
| sink_signal | string | true | — | 同 source_signal 格式 |
| design_name | string | true | — | — |
| max_depth | int | false | 50 | DFS 深度上限(防环) |
| stamp | string | false | <auto> | — |
接受两种 source 格式:
- hierarchical:
top.u_rx.fifo.wr_data— 全局唯一 - module-local:
uart_rx.rx_data— 当跨同名实例时歧义,trace 在歧义时返回多条 path
Output Contract
| field | 值 |
|---|---|
artifact_path | designs/<name>/ast/signal_path_<stamp>.json |
script_path | designs/<name>/ast/trace_<stamp>.py |
source | str |
sink | str |
path | [{module, signal, line, op}] |
crosses_clock_domain | bool |
valid | bool |
error | string|null |
4-Phase 执行
Phase 1 — render_trace_py
scripts/render_trace_py.py 渲染 Python:
import json
ast = json.load(open(ast_path))
path, cdc = trace(ast, source_signal, sink_signal, max_depth)
json.dump({"path": path, "crosses_clock_domain": cdc}, open(out, "w"))
trace() 实现:以 source 为起点,按 cont_assign / non_blocking_assign / port_connection 边 DFS,记录每跳的 module/signal/line/op。
Phase 2 — run_trace
scripts/run_trace.py:timeout 300 uv run python <script_path> > <log> 2>&1
Phase 3 — parse_trace
scripts/parse_trace.py:
- 输出 JSON 解析;
path == []→error="path not found" - 任一跳的
clk_domain与下一跳不同 →crosses_clock_domain=true
Phase 4 — return
返回 JSON。调用方据 crosses_clock_domain + path 决定开 CDC issue 或调整 RTL。
收敛 / 失败
| 状态 | 行动 |
|---|---|
| valid=true | 提供详细 path |
path not found | AST 不完整 / 信号名错;切 fallback 重解析 |
| 超 max_depth | error="trace depth exceeded"(疑似环) |
资源索引
scripts/render_trace_py.py、scripts/run_trace.py、scripts/parse_trace.pylib/cdc_classifier.py— 节点 clock domain 推断references/ast_traversal_rules.md
Signals
- GitHub stars
- 44
- Forks
- 10
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
bb-trace-signal-path- Source
- github.com/amoslee2026/babel