Rtl p5s coverage analyze

From babyworm/rtl-agent-team · View interactive version

Rtl p5s coverage analyze is an AI agent skill from the GitHub repository babyworm/rtl-agent-team. P5 coverage closure: prioritizes coverage gaps and generates directed tests. Triggers 'coverage gaps', 'coverage below target', 'uncovered branches'.

How to use this skill

Skill file

<Purpose>

Analyze simulation coverage data to identify uncovered lines, branches, and FSM states. Prioritize gaps by reachability and architectural significance, generate directed tests to close high-value gaps, and produce a convergence report. Outputs: reviews/phase-5-verify/{module}-coverage-report.md (gap list + PASS/FAIL verdict) and sim/coverage/test_coverage_fill.py (directed tests targeting identified gaps).

</Purpose>

<Use_When>

</Use_When>

<Do_Not_Use_When>

</Do_Not_Use_When>

<Why_This_Exists>

Raw coverage reports are verbose and hard to prioritize. coverage-analyst identifies which uncovered areas are high-value vs unreachable, and testbench-dev writes targeted tests for the high-value gaps. This makes coverage closure systematic rather than relying on ad-hoc test addition. The iterative 3-round loop ensures convergence is tracked across test additions.

</Why_This_Exists>

Prerequisites

If prerequisite is missing: WARNING — recommend running /rtl-agent-team:rtl-p5s-func-verify first. Proceed with available artifacts; orchestrator adapts scope.

<Assets>

| Path | Role |

|------|------|

| templates/coverage-gap-report.md | Gap report scaffold: summary section, high-value gap table, unreachable table, directed tests list, exclusions section. |

| scripts/parse_coverage.py | Deterministic coverage parser: reads lcov .info (from merge_coverage.sh) or raw Verilator coverage.dat, emits JSON with per-file/per-metric coverage %, ranked uncovered bins, and PASS/FAIL vs project targets. |

| references/coverage-conventions.md | Coverage targets, report schema, directed test style, exclusion approval rules, anti-patterns. |

| examples/ | Worked examples: merged.info (lcov) + coverage.dat (Verilator native) inputs with committed expected JSON — see examples/README.md. |

</Assets>

<Responsibility_Boundary>

</Responsibility_Boundary>

<Execution>

  1. Read references/coverage-conventions.md for coverage targets, report structure, and exclusion approval rules.
  2. Spawn p5s-coverage-orchestrator (see Tool_Usage) to run 3-round iterative analysis: parse the coverage report (deterministic extraction via scripts/parse_coverage.py — supports lcov .info and Verilator coverage.dat; v_user points count as the fsm metric), identify and prioritize gaps, generate directed tests, re-run simulation, and track convergence.
  3. The orchestrator writes reviews/phase-5-verify/{module}-coverage-report.md using templates/coverage-gap-report.md as scaffold, populating high-value and unreachable gap tables.
  4. The orchestrator writes sim/coverage/test_coverage_fill.py with one test function per targeted gap.
  5. Any coverage exclusion bins (unreachable items) must go through the rtl-coverage-exclusion-gate.sh approval flow — do not apply exclusions silently.
  6. Report the overall PASS/FAIL verdict and both output paths to the user.

Apply steps 1-6 to every requested module — do not stop after the first.

</Execution>

<Tool_Usage>

Coverage gap analysis orchestration:

Task(subagent_type="rtl-agent-team:p5s-coverage-orchestrator",
     prompt="Execute coverage gap analysis. User input: $ARGUMENTS")

Do not perform analysis work directly — the orchestrator manages 3-round iterative coverage analysis, directed test generation, and coverage convergence tracking.

</Tool_Usage>

<Examples>

<example index="1">

<scenario>Module has 85% line coverage and 65% FSM coverage after initial functional verification pass.</scenario>

<reference>examples/</reference>

<expected_output>Gap report identifies 3 high-value uncovered FSM transitions and 2 uncovered error-handling branches; test_coverage_fill.py adds 5 directed tests; after re-run coverage reaches 91% line and 73% FSM — overall PASS.</expected_output>

</example>

<example index="2">

<scenario>Several uncovered branches are in dead-code paths gated by a compile-time parameter.</scenario>

<reference>examples/</reference>

<expected_output>Unreachable table lists the dead-code branches with justification; exclusion request routed through rtl-coverage-exclusion-gate.sh before applying. Report notes exclusions pending user approval.</expected_output>

</example>

<example index="3">

<scenario>Coverage data file is absent — sim/coverage/coverage.xml does not exist.</scenario>

<reference>examples/</reference>

<expected_output>WARNING emitted: sim/coverage/coverage.xml not found — recommend running /rtl-agent-team:rtl-p5s-func-verify first. Skill does not proceed to gap analysis.</expected_output>

</example>

</Examples>

<Escalation_And_Stop_Conditions>

</Escalation_And_Stop_Conditions>

Output

<Final_Checklist>

</Final_Checklist>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.