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

bb-collect-coverage

解析 Verilator coverage.dat + sim log,输出 functional + code coverage 数值,判断是否 100% 达标。触发场景:(1) bb-invoke-verilator 后;(2) 每次回归后;(3) 显式 /bb-collect-coverage。

インストール方法を見る

含まれるファイル(6)

  • SKILL.md3.8 KB
  • Gotcha/coverage_pitfalls.md760 B
  • references/verilator_coverage_format.md512 B
  • scripts/parse_cov.py3.0 KB
  • scripts/render_cov_sh.py748 B
  • scripts/run_cov.py1.2 KB

SKILL.md(原文)

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

bb-collect-coverage

职责

读 coverage.dat(verilator)+ sim log(covergroup hits),输出 line/branch/toggle/functional 百分比与未覆盖 bin 列表。

  • 调用者:bba-guru-verification
  • 上游:bb-invoke-verilator
  • 禁止使用:Task / Agent / Skill

Input Args

argtyperequired默认说明
sim_logpathtrue—designs/<name>/sim_results/<stamp>.log
coverage_datpathfalse同 sim_resultsverilator coverage 数据库
design_namestringtrue——
target_pctfloatfalse100.0functional & code 阈值
stampstringfalse<auto>—

Output Contract

写到 designs/<name>/coverage.json(中间文件)和 designs/<name>/test_report.json(按 .claude/schemas/test_report.schema.json 的嵌套结构)。

field值
artifact_pathdesigns/<name>/test_report.json
coverage_jsondesigns/<name>/coverage.json
script_pathdesigns/<name>/sim_results/parse_cov_<stamp>.sh
log_pathdesigns/<name>/sim_results/cov_<stamp>.log
functional_coveragefloat(0..100)
code_coverage{line: float, branch: float, toggle: float} (NESTED, fix C-01)
meets_targetbool(functional == 100 AND line == 100 AND branch >= 95 AND toggle >= 90,与 test gate 一致)
tests[{name, status, log}](test_report.schema 必填;逐用例结果)
iteration_countint 0..8(test_report.schema 必填)
uncovered_bins[{group, bin, hits}]
validbool

4-Phase 执行

Phase 1 — render_cov_sh

#!/bin/bash
verilator_coverage --annotate designs/<name>/sim_results/annotate/ <coverage_dat>

Phase 2 — run_cov

timeout 300 bash <script_path> > <log> 2>&1

Phase 3 — parse_cov

scripts/parse_cov.py:

  • annotate 输出含 LCOV:hit/total 标记 → code_coverage.line/branch/toggle
  • sim_log 中 covergroup Coverage: <pct>% → functional_coverage
  • 列举 hits==0 的 bin → uncovered_bins
  • meets_target = functional_coverage >= target_pct AND code_coverage.line >= target_pct AND code_coverage.branch >= 95 AND code_coverage.toggle >= 90
    • 100% branch/toggle coverage is often unreachable due to defensive error-handling code. Targets of 95%/90% allow for documented unreachable bins while maintaining high quality.
  • 写 coverage.json(含 inputs[]:{path,sha256} 引用 sim_log + rtl_artifact.json)
  • 同时生成 test_report.json,遵循 .claude/schemas/test_report.schema.json 嵌套结构(fix C-01);必须填齐 schema required 字段:functional_coverage、code_coverage{line,branch,toggle}、tests[]:{name,status,log}(逐用例结果,由 verification 汇总)、inputs[]:{path,sha256}、iteration_count(fix M-03)

Phase 4 — return

返回 JSON。bba-guru-verification:

  • meets_target=true → signoff,开 ready-for-synth
  • meets_target=false → 把 uncovered_bins 反馈,追加 corner-case 用例重 sim

收敛 / 失败

状态行动
meets_target=true进 synth
meets_target=falseoptimization loop(追加 seed / corner test)
解析失败重试 1 次
iter > 10escalate arch-needs-fix(不可达 bin)

资源索引

  • scripts/render_cov_sh.py、scripts/run_cov.py、scripts/parse_cov.py
  • references/verilator_coverage_format.md
  • Gotcha/coverage_pitfalls.md — unreachable code / dead branch

レビュー

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

同じリポジトリのスキル

概要と使いどころ

<一句话说清『这个 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 のスキルをすべて見る

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