跳到正文
cccskills
免费在 GitHub 公开

bb-generate-tb

根据 MAS + verification_plan + RTL 接口描述生成 SystemVerilog UVM 或 cocotb 测试平台与 test cases 清单。

触发场景:(1) bba-guru-verification 在 plan 完成后;(2) 补充 corner case TB;(3) 显式 /bb-generate-tb。

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(10)

  • SKILL.md3.2 KB
  • assets/coverage.sv.tmpl273 B
  • assets/seq.sv.tmpl168 B
  • assets/tb_top.sv.tmpl555 B
  • Gotcha/sv_uvm_pitfalls.md619 B
  • references/cocotb_quickref.md701 B
  • references/uvm_quickref.md502 B
  • scripts/parse_tb_lint.py1.1 KB
  • scripts/render_tb_py.py674 B
  • scripts/run_gen_tb.py3.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

bb-generate-tb

职责

读 MAS 接口表 + verification_plan FTP 列表 + rtl_artifact 模块清单,生成 TB 顶层 + base sequence + per-FTP sequence + covergroup,并跑 verilator lint-only 预检。

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

Input Args

argtyperequired默认说明
mas_pathpathtrue—designs/<name>/mas/mas.json
verif_planpathtrue—designs/<name>/verif/verification_plan.md
rtl_artifactpathtrue—designs/<name>/rtl/rtl_artifact.json
design_namestringtrue——
tb_styleenumfalseuvmuvm | cocotb
stampstringfalse<auto>—

Output Contract

field值
artifact_pathdesigns/<name>/tb/ (目录)
tb_topdesigns/<name>/tb/tb_top.sv
tb_fileslist[path]
test_casesint
lint_cleanbool(verilator --lint-only 通过)
validbool
errorstring|null

产物结构

designs/<name>/
├── tb/
│   ├── tb_top.sv
│   ├── seq_base.sv
│   ├── seq_<FTP-id>.sv  (每 FTP 一个)
│   └── coverage.sv      (covergroups 与 plan 对齐)
└── verif/
    └── test_cases.md    (FTP → seq 映射)

4-Phase 执行

Phase 1 — render_tb_py

scripts/render_tb_py.py:

import json
mas_io = json.load(open(rtl_artifact))["interfaces"]
ftps = parse_ftps_from_md(verif_plan)
for ftp in ftps:
    write_sv_sequence(ftp, mas_io, tb_style, out_dir="designs/<name>/tb/")
write_tb_top(mas_io, ftps, tb_style)
write_coverage(ftps, verif_plan)

Phase 2 — run_gen_tb

timeout 300 uv run python <script_path> > <log> 2>&1

Phase 3 — lint_check

verilator --lint-only -sv -f designs/<name>/file_list.f designs/<name>/tb/tb_top.sv 2>&1

scripts/parse_tb_lint.py:

  • tb_files = ls designs/<name>/tb/*.sv
  • test_cases = len(ftps)
  • lint_clean = (verilator 退出 0 且无 %Error)

Phase 4 — return

返回 JSON。bba-guru-verification 据此触发 bb-invoke-verilator。

收敛 / 失败

状态行动
valid=true进 verilator 跑 sim
lint_clean=false重生成 1 次
重生成仍失败error="TB lint persistent";人工介入

资源索引

  • scripts/render_tb_py.py、scripts/run_gen_tb.py、scripts/parse_tb_lint.py
  • assets/tb_top.sv.tmpl、assets/seq.sv.tmpl、assets/coverage.sv.tmpl
  • references/uvm_quickref.md、references/cocotb_quickref.md
  • Gotcha/sv_uvm_pitfalls.md

项目级 Coding Style 参考:

  • wiki/codingstyle/systemverilog_styleguide.md — SystemVerilog Style Guide (systemverilog.io)
  • wiki/codingstyle/freescale_verilog_standard.md — Freescale Verilog HDL Coding Standard SRS V3.2

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

<一句话说清『这个 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 的全部技能

报告此技能的问题