Rtl p5s func verify policy

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

Rtl p5s func verify policy is an AI agent skill from the GitHub repository babyworm/rtl-agent-team. Internal reference: rtl p5s func verify policy (agent-loaded; do not invoke).

How to use this skill

Skill file

Tier 3 Functional Verification Policy

Testing Tier Context

Tier 1: Smoke Test     — connectivity, R/W, basic ops (rtl-p4-implement Wave 4)
Tier 2: Unit Test      — reference comparison, uarch features (rtl-p4s-unit-test)
Tier 3: Module Regr.   — cocotb multi-seed (THIS POLICY)
Tier 4: Integration    — cross-module, end-to-end (rtl-p5s-integration-test)

Tier transition rules:

(PARTIAL_PASS = some Critical/High ac_ids PARTIAL; WARNING at Stage 1, escalated to FAIL at Stage 3)

cocotb Signal Naming Convention

cocotb test files MUST use correct signal names matching RTL port conventions:

Multi-Seed Strategy

Execution Strategy

and explicit gate/runner wiring exists (RTL_ALLOW_AWS=1, RTL_AWS_BATCH_RUNNER)

Coverage Targets

| Metric | Target |

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

| Line coverage | ≥ 90% |

| Toggle coverage | ≥ 80% |

| FSM coverage | ≥ 70% |

Below target: testbench-dev generates additional tests → re-run regression.

Coverage Collection

# Verilator compilation with coverage
make -C sim/{module} sim SIM=verilator EXTRA_ARGS="--coverage --trace-fst" TOPLEVEL=dut MODULE=test_dut

# Merge multi-seed coverage data
verilator_coverage --write-info merged.info seed_*/coverage.dat

# Coverage HTML report
genhtml sim/coverage/merged.info -o sim/coverage/html/ --title "Regression Coverage"

Regression Scripts

# Automated multi-seed regression ({plugin_root} = plugin root resolved from .rat/state/spawn-context.json)
bash {plugin_root}/skills/rtl-p5s-func-verify/scripts/run_regression.sh \
  --mode local --seeds "1 42 123 1337 65536" --sim verilator

# Optional override when user explicitly asks
bash {plugin_root}/skills/rtl-p5s-func-verify/scripts/run_regression.sh \
  --mode local --parallel "$(($(nproc)-2))" --seeds "1 42 123 1337 65536" --sim verilator

# Coverage merge
bash {plugin_root}/skills/rtl-p5s-func-verify/scripts/merge_coverage.sh \
  --format verilator --output sim/coverage/merged.info

Requirement Traceability Matrix Format

Save to reviews/phase-5-verify/requirement-traceability.md:

AC-Level Format (when structured acceptance_criteria with ac_id exist in iron-requirements)

When iron-requirements.json contains structured acceptance_criteria entries (object arrays with ac_id

fields), the RTM uses AC-level granularity:

# Phase 5 Review: Requirement Traceability
- Date: YYYY-MM-DD
- Reviewer: func-verifier
- Upper Spec: iron-requirements.json
- Verdict: PASS | PARTIAL_PASS | FAIL

## Feature Coverage Checklist
| REQ ID | AC ID | Description | Test Case | Status |
|--------|-------|-------------|-----------|--------|

## Findings
### [severity] Finding-N: ...

## Verdict
PASS | PARTIAL_PASS | FAIL: [reason]
- PASS: all Critical/High ac_ids VERIFIED or FORMAL
- PARTIAL_PASS: some Critical/High ac_ids PARTIAL (WARNING at Stage 1, escalated to FAIL at Stage 3)
- FAIL: Critical/High ac_ids UNTESTED or tests failing

AC-level status values per criterion:

automated coverage tracking

VERIFIED judgment is made at the individual criterion level when ac_id fields are present.

REQ-Level Format (backward compatible — when no structured AC)

When acceptance_criteria is absent or contains a plain string array (P1/P2 format), the RTM uses

the existing REQ-level format:

## Feature Coverage Checklist
| REQ ID | Test Name | Result | Status |
|--------|-----------|--------|--------|

Verdict rules (Tier 3 module-level, aligns with Stage 1 2-tier model):

At Stage 1 module graduation: WARNING (proceed). At Stage 3 final audit: escalated to FAIL.

cocotb Ecosystem Quick Reference

See {plugin_root}/skills/rtl-p5s-func-verify/references/cocotb-ecosystem.md for complete API reference.

Tier 2 Baseline Utilization

When Tier 2 unit test results (sim/{module}/{module}_unit_results.json) are available

from Phase 4, the CDTG pipeline MUST operate incrementally:

  1. Load baseline: Read Tier 2 coverage metrics (line_pct, fsm_pct, toggle_pct)

and already-covered features from unit_results.json

  1. Prioritize gaps: CDTG Round 1 focuses on uncovered FSM states, untested code

paths, and features not exercised in Tier 2

  1. Avoid duplication: Do not regenerate test vectors that duplicate Tier 2 coverage.

Extend coverage, not repeat it

  1. Graceful degradation: If Tier 2 results are absent (e.g., module skipped P4 unit

testing), proceed from zero baseline. Log warning but do not block

Coverage targets remain unchanged: Line ≥ 90%, Toggle ≥ 80%, FSM ≥ 70%.

The baseline only affects CDTG prioritization, not target thresholds.

Backward Traceability Policy

Test failure reports MUST include requirement impact analysis:

This policy ensures that test failures are immediately connected to requirements,

enabling prioritized debugging and requirement-level risk assessment.

Escalation & Stop Conditions

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.