Skip to content
cccskills
FreePublished on GitHub

bb-trace-signal-path

在 AST JSON 上做信号路径追踪:source → sink 提取跨模块层次的传播路径,判定是否跨时钟域。供 CDC violation 根因分析与 critical path 辅助。

触发场景:(1) bb-check-cdc 报 violation 需取证;(2) 综合 critical path 分析;(3) 显式 /bb-trace-signal-path。

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

See how to install

Files included (5)

  • SKILL.md3.0 KB
  • references/ast_traversal_rules.md1.4 KB
  • scripts/parse_trace.py1.1 KB
  • scripts/render_trace_py.py1.4 KB
  • scripts/run_trace.py2.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

bb-trace-signal-path

职责

读取 bb-parse-ast 产出的 AST JSON,DFS 跟踪 source 信号到 sink 的赋值/连线链,输出路径节点列表 + CDC 标记。

  • 调用者:bba-guru-synthesis、bb-check-cdc
  • 上游:bb-parse-ast(或 fallback)
  • 禁止使用:Task / Agent / Skill

Input Args

argtyperequired默认说明
ast_pathpathtrue—AST JSON
source_signalstringtrue—完整 hierarchical path:top.inst.sub.sig 或 模块本地:<module>.<signal>(fix M-11)
sink_signalstringtrue—同 source_signal 格式
design_namestringtrue——
max_depthintfalse50DFS 深度上限(防环)
stampstringfalse<auto>—

接受两种 source 格式:

  • hierarchical: top.u_rx.fifo.wr_data — 全局唯一
  • module-local: uart_rx.rx_data — 当跨同名实例时歧义,trace 在歧义时返回多条 path

Output Contract

field值
artifact_pathdesigns/<name>/ast/signal_path_<stamp>.json
script_pathdesigns/<name>/ast/trace_<stamp>.py
sourcestr
sinkstr
path[{module, signal, line, op}]
crosses_clock_domainbool
validbool
errorstring|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 foundAST 不完整 / 信号名错;切 fallback 重解析
超 max_deptherror="trace depth exceeded"(疑似环)

资源索引

  • scripts/render_trace_py.py、scripts/run_trace.py、scripts/parse_trace.py
  • lib/cdc_classifier.py — 节点 clock domain 推断
  • references/ast_traversal_rules.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