用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/babyworm/rtl-agent-team --skill rtl-p5s-coverage-policy命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | rtl-p5s-coverage-policy |
| description | Internal reference: rtl p5s coverage policy (agent-loaded; do not invoke). |
| user-invocable | false |
| Metric | Target | Evaluated On |
|---|---|---|
| Line coverage | ≥ 90% | Post-exclusion |
| Toggle coverage | ≥ 80% | Post-exclusion |
| FSM coverage | ≥ 70% | Post-exclusion |
Raw coverage is always reported alongside post-exclusion numbers for transparency.
Coverage coverpoint extraction and test generation must iterate at least 3 times:
Each round produces a progress note at .rat/scratch/phase-5/coverage-iteration-r{N}.md.
When coverage-analyst identifies HIGH/CRITICAL gaps, it must produce a Directed Test Guidance table that testbench-dev can directly consume. This closes the Coverage-Driven Test Generation loop with structured, actionable feedback — not just gap descriptions.
The canonical table format (columns: Gap ID | Uncovered Bin | Constraint | Sequence | Expected Behavior) is OWNED by the coverage-analyst agent prompt ("Directed Test Guidance" output format) — the producer. Field semantics:
testbench-dev reads the Directed Test Guidance table and generates one cocotb test function per row. Each test:
Round N: coverage-analyst → Directed Test Guidance table
test-plan-writer → systematic test plan (ECP/BVA for config-dependent gaps)
testbench-dev → test_coverage_fill_rN.py (one test per guidance row + plan)
eda-runner → regression with new tests → updated coverage
Round N+1: coverage-analyst re-analyzes → new guidance for remaining gaps
This iterates until coverage targets are met or all remaining gaps are justified as waived.
When coverage gaps depend on configuration/parameter combinations (e.g., PPS settings, QP values, pixel formats, buffer sizes), test-plan-writer applies systematic test design methodology before testbench-dev generates tests:
Equivalence Class Partitioning (ECP): Partition each parameter into equivalence classes that produce the same coverage behavior. Example for a rate control module:
Boundary Value Analysis (BVA): For each parameter, test at min, min+1, nominal, max-1, max
Combination strategy: Use pairwise/all-pairs for 3+ parameters to keep test count manageable while covering all 2-way interactions
Trigger condition: coverage-analyst identifies gaps that correlate with specific parameter configurations (e.g., "toggle coverage low on RC buffer overflow path — only reachable when bits_per_pixel < 4 AND initial_qp > 45") → test-plan-writer is invoked for systematic parameter space partitioning
test-plan-writer produces sim/{module}/coverage/directed_test_plan.md which testbench-dev
consumes alongside the Directed Test Guidance table.
When coverage-driven regression converges without meeting targets:
coverage-exclusions.json)
listing each excluded bin. Per-tool export: Verilator/lcov --remove filter, VCS URG -elfile,
Xcelium IMC exclusion file, or Questa UCDB exclusion as applicablereviews/phase-5-verify/{module}-coverage-exclusions.md
with: bin name, module, reason, approver| Category | Example | Action | Approval |
|---|---|---|---|
| UVM/TB infrastructure | uvm_pkg, tb_*, axi4s_if | Always exclude | Auto (coverage-analyst) |
| Parameter guards | if (BPC > 16) | Exclude (dead by design) | Auto (coverage-analyst) |
| Toggle on wide buses | 128-bit output upper bits | Exclude if functionally verified | Auto (coverage-analyst) |
| Unimplemented features | 4:2:2 chroma paths (out-of-scope) | Exclude only if explicitly out-of-scope or parameter-disabled; escalate if required by spec | User (AskUserQuestion) |
| Ambiguous spec applicability | Any bin where it is unclear whether the spec requires coverage | Escalate — exclude only with explicit confirmation | User (AskUserQuestion) |
Coverage data processing with Verilator:
# Annotate source files with coverage data
verilator_coverage --annotate coverage_annotated/ coverage.dat
# Convert to lcov for HTML reports
verilator_coverage --write-info coverage.info coverage.dat
genhtml coverage.info -o sim/coverage/html/
Gap prioritization heuristics:
Not all uncovered bins indicate missing tests. Before generating directed tests, coverage-analyst must classify each gap as critical (requires test) or benign (can be documented and accepted):
| Condition | Classification | Action |
|---|---|---|
| DUT structurally cannot produce the stimulus (e.g., input idle never asserted because DUT always drives ready) | Benign | Document with RTL evidence (file:line) |
| Gap requires specific config that is out-of-scope | Benign | Document as config-excluded |
| Gap is reachable but requires rare multi-cycle sequence | Critical | test-plan-writer designs directed stimulus |
| Gap correlates with a specific parameter configuration | Critical | test-plan-writer applies ECP/BVA on config space |
| Gap involves cross-module data flow not exercised | Critical | Escalate to integration-verifier |
Benign gaps are recorded in the coverage report with justification (not silently excluded).
Track convergence independently for each coverage metric:
| Metric | Tracked Separately | Why |
|---|---|---|
| Line | Yes | May converge early (often 90%+ in first iteration) |
| Toggle | Yes | Wide buses converge slowly; upper bits rarely toggle |
| FSM | Yes | Small state space; usually converges quickly |
| Branch | Yes | Conditional paths may need config-specific tests |
| Functional | Yes | Depends on covergroup design quality |
A metric is converged when 2 consecutive rounds show < 0.5% improvement FOR THAT METRIC. Overall convergence requires ALL metrics either meeting target or individually converged. This prevents aggregate convergence masking a single lagging metric.
When toggle coverage converges below target despite diverse stimulus:
When coverage-analyst observes a module where:
rtl-p3-uarch-policy.When designs have configurable parameters that activate different code paths (e.g., PPS settings in codecs, mode registers in processors, feature enables in peripherals):
test-plan-writer must identify which parameters control which code paths, as a mapping
table with columns | Parameter | Value Range | Code Path Activated | Coverage Impact |
(e.g., mode_reg = BYPASS → bypass datapath activated → branch coverage in {module}_ctrl)
coverage-analyst uses this mapping to diagnose coverage gaps:
testbench-dev generates test variants with config constraints matched to uncovered paths
Convergence estimation: if N random seeds cover M% of bins, estimate additional seeds needed using the formula: seeds_needed ≈ N × ln(100/(100-target)) / ln(100/(100-M)). This is approximate — directed tests are always more efficient for specific uncovered bins.
基于 SOC 职业分类