Each seed tests different random stimulus ordering
A module passes multi-seed regression only when ALL seeds pass
Use COCOTB_RESOLVE_X=RANDOM for X-state handling
Use RANDOM_SEED={seed} for reproducibility
Execution Strategy
Local-first runtime: default to local execution on current host (--mode local)
Default parallel budget: use max(1, nproc-2) unless user explicitly overrides --parallel
AWS usage policy: aws-batch is allowed only when the user explicitly asks to use AWS
and explicit gate/runner wiring exists (RTL_ALLOW_AWS=1, RTL_AWS_BATCH_RUNNER)
Pipelined: as each module's TB completes → immediately launch sim (don't wait for all TBs)
Module-level parallelism: each module's TB + sim runs as an independent parallel task
Multi-seed parallelism: queue 5 seeds × N modules; local active workers stay within max(1, nproc-2)
Incremental coverage: coverage-analyst starts partial analysis on completed modules
Early termination: >5% failure rate across seeds → halt and report immediately
PASS — all requirements (or acceptance criteria) verified with passing tests
PARTIAL_PASS — some Critical/High ac_ids are PARTIAL (not yet VERIFIED/FORMAL).
At Stage 1 module graduation: WARNING (proceed). At Stage 3 final audit: escalated to FAIL.
FAIL — M requirements/criteria UNTESTED, K with failing tests
Any REQ (or AC) UNTESTED → testbench-dev must generate additional tests
PARTIAL Critical/High ac_ids → WARNING at this stage, must be resolved before Stage 3
cocotb Ecosystem Quick Reference
cocotb-bus: Base classes for Driver, Monitor, and Scoreboard
cocotbext-axi: Ready-to-use AXI4/AXI4-Lite/AXI4-Stream masters and slaves
This policy ensures that test failures are immediately connected to requirements,
enabling prioritized debugging and requirement-level risk assessment.
Escalation & Stop Conditions
cocotb not installed → halt and route setup through /rtl-agent-team:rat-setup
Failure persists after 2 RTL fix rounds → escalate to rtl-architect with waveform analysis
Coverage below 80% after full regression → invoke rtl-p5s-coverage-analyze skill
cocotb signal name mismatch error → testbench-dev must fix to use i_/o_ convention
Requirements with NO TEST COVERAGE after additional test generation → escalate to user
Requirement traceability verdict FAIL with persistent test failures → escalate to rtl-p4-implement
Final Checklist
All cocotb tests use correct signal names (dut.i_*, dut.o_*, dut.sys_clk, dut.sys_rst_n)
sim/regression/seed_{seed}_results.json written per seed
Early termination applied if failure rate >5%
Requirement Traceability Matrix produced (AC-level when structured acceptance_criteria exist, REQ-level otherwise)
Every REQ-NNN in docs/phase-1-research/iron-requirements.json (canonical) or legacy docs/phase-1-research/requirements.json (fallback) covered by at least one test
When structured AC exists: every Critical/High ac_id is VERIFIED, FORMAL, or PARTIAL (PARTIAL = PARTIAL_PASS verdict at Stage 1, escalated to FAIL at Stage 3 final audit). UNTESTED = FAIL.
All covered requirements pass their tests (or failures escalated)
Traceability verdict is PASS or PARTIAL_PASS (PARTIAL_PASS = WARNING at Stage 1, escalated to FAIL at Stage 3)
1---2name: rtl-p5s-func-verify-policy3description: Internal reference: rtl p5s func verify policy (agent-loaded; do not invoke).4---56# Tier 3 Functional Verification Policy78## Testing Tier Context910```11Tier 1: Smoke Test — connectivity, R/W, basic ops (rtl-p4-implement Wave 4)12Tier 2: Unit Test — reference comparison, uarch features (rtl-p4s-unit-test)13Tier 3: Module Regr. — cocotb multi-seed (THIS POLICY)14Tier 4: Integration — cross-module, end-to-end (rtl-p5s-integration-test)15```1617Tier transition rules:18- Tier 2 PASS (rtl-p4s-unit-test) → Tier 3 eligible19- Tier 3 PASS or PARTIAL_PASS (this skill) → Tier 4 eligible (rtl-p5s-integration-test)20 (PARTIAL_PASS = some Critical/High ac_ids PARTIAL; WARNING at Stage 1, escalated to FAIL at Stage 3)21- Tier 3 FAIL → fix via rtl-p4s-bugfix, re-run Tier 2 then Tier 32223## cocotb Signal Naming Convention2425cocotb test files MUST use correct signal names matching RTL port conventions:26- Signal access: `dut.i_data` (NOT `dut.data_i`), `dut.o_valid` (NOT `dut.valid_o`)27- Clock: `dut.clk` (single domain) or `dut.sys_clk` (multiple domains) — NOT `dut.clk_i`28- Reset: `dut.rst_n` (single domain) or `dut.sys_rst_n` (multiple domains) — NOT `dut.rst_ni`29- cocotb clock utility: `cocotb.clock.Clock(dut.sys_clk, 10, units="ns")`30- Reset sequence: drive `dut.sys_rst_n.value = 0`, wait, then `dut.sys_rst_n.value = 1`3132## Multi-Seed Strategy3334- Default 5 seeds: 1, 42, 123, 1337, 65536 (configurable via `sim/regression/seed_list.txt`)35- Each seed tests different random stimulus ordering36- A module passes multi-seed regression only when ALL seeds pass37- Use `COCOTB_RESOLVE_X=RANDOM` for X-state handling38- Use `RANDOM_SEED={seed}` for reproducibility3940## Execution Strategy4142- **Local-first runtime**: default to local execution on current host (`--mode local`)43- **Default parallel budget**: use `max(1, nproc-2)` unless user explicitly overrides `--parallel`44- **AWS usage policy**: `aws-batch` is allowed only when the user explicitly asks to use AWS45 and explicit gate/runner wiring exists (`RTL_ALLOW_AWS=1`, `RTL_AWS_BATCH_RUNNER`)46- **Pipelined**: as each module's TB completes → immediately launch sim (don't wait for all TBs)47- **Module-level parallelism**: each module's TB + sim runs as an independent parallel task48- **Multi-seed parallelism**: queue 5 seeds × N modules; local active workers stay within `max(1, nproc-2)`49- **Incremental coverage**: coverage-analyst starts partial analysis on completed modules50- **Early termination**: >5% failure rate across seeds → halt and report immediately5152## Coverage Targets5354| Metric | Target |55|--------|--------|56| Line coverage | ≥ 90% |57| Toggle coverage | ≥ 80% |58| FSM coverage | ≥ 70% |5960Below target: testbench-dev generates additional tests → re-run regression.6162## Coverage Collection6364```bash65# Verilator compilation with coverage66make -C sim/{module} sim SIM=verilator EXTRA_ARGS="--coverage --trace-fst" TOPLEVEL=dut MODULE=test_dut6768# Merge multi-seed coverage data69verilator_coverage --write-info merged.info seed_*/coverage.dat7071# Coverage HTML report72genhtml sim/coverage/merged.info -o sim/coverage/html/ --title "Regression Coverage"73```7475## Regression Scripts7677```bash78# Automated multi-seed regression ({plugin_root} = plugin root resolved from .rat/state/spawn-context.json)79bash {plugin_root}/skills/rtl-p5s-func-verify/scripts/run_regression.sh \80 --mode local --seeds "1 42 123 1337 65536" --sim verilator8182# Optional override when user explicitly asks83bash {plugin_root}/skills/rtl-p5s-func-verify/scripts/run_regression.sh \84 --mode local --parallel "$(($(nproc)-2))" --seeds "1 42 123 1337 65536" --sim verilator8586# Coverage merge87bash {plugin_root}/skills/rtl-p5s-func-verify/scripts/merge_coverage.sh \88 --format verilator --output sim/coverage/merged.info89```9091## Requirement Traceability Matrix Format9293Save to `reviews/phase-5-verify/requirement-traceability.md`:9495### AC-Level Format (when structured acceptance_criteria with ac_id exist in iron-requirements)9697When `iron-requirements.json` contains structured `acceptance_criteria` entries (object arrays with `ac_id`98fields), the RTM uses AC-level granularity:99100```markdown101# Phase 5 Review: Requirement Traceability102- Date: YYYY-MM-DD103- Reviewer: func-verifier104- Upper Spec: iron-requirements.json105- Verdict: PASS | PARTIAL_PASS | FAIL106107## Feature Coverage Checklist108| REQ ID | AC ID | Description | Test Case | Status |109|--------|-------|-------------|-----------|--------|110111## Findings112### [severity] Finding-N: ...113114## Verdict115PASS | PARTIAL_PASS | FAIL: [reason]116- PASS: all Critical/High ac_ids VERIFIED or FORMAL117- PARTIAL_PASS: some Critical/High ac_ids PARTIAL (WARNING at Stage 1, escalated to FAIL at Stage 3)118- FAIL: Critical/High ac_ids UNTESTED or tests failing119```120121AC-level status values per criterion:122- `VERIFIED` — AC covered by a passing test123- `FORMAL` — AC proved by formal verification124- `PARTIAL` — AC partially covered (some test cases pass, scope limited)125- `UNTESTED` — AC exists but no test covers it126- `NOT_VERIFIABLE` — AC has `verifiable: false` (inspection-only); document in RTM, excluded from127 automated coverage tracking128129VERIFIED judgment is made at the individual criterion level when `ac_id` fields are present.130131### REQ-Level Format (backward compatible — when no structured AC)132133When `acceptance_criteria` is absent or contains a plain string array (P1/P2 format), the RTM uses134the existing REQ-level format:135136```markdown137## Feature Coverage Checklist138| REQ ID | Test Name | Result | Status |139|--------|-----------|--------|--------|140```141142Verdict rules (Tier 3 module-level, aligns with Stage 1 2-tier model):143- `PASS` — all requirements (or acceptance criteria) verified with passing tests144- `PARTIAL_PASS` — some Critical/High ac_ids are PARTIAL (not yet VERIFIED/FORMAL).145 At Stage 1 module graduation: WARNING (proceed). At Stage 3 final audit: escalated to FAIL.146- `FAIL` — M requirements/criteria UNTESTED, K with failing tests147- Any REQ (or AC) UNTESTED → testbench-dev must generate additional tests148- PARTIAL Critical/High ac_ids → WARNING at this stage, must be resolved before Stage 3149150## cocotb Ecosystem Quick Reference151152- **cocotb-bus**: Base classes for Driver, Monitor, and Scoreboard153- **cocotbext-axi**: Ready-to-use AXI4/AXI4-Lite/AXI4-Stream masters and slaves154 - Example: `AxiLiteMaster(AxiLiteBus.from_prefix(dut, "s_axi"), dut.sys_clk, dut.sys_rst_n, reset_active_level=False)`155 - Stream: `AxiStreamSource(AxiStreamBus.from_prefix(dut, "s_axis"), dut.sys_clk, dut.sys_rst_n)`156- **cocotb-coverage**: Functional coverage with `@CoverPoint` and `@CoverCross` decorators157 - Example: `@CoverPoint("top.data", bins=[range(0,64), range(64,256)])`158- **TestFactory**: Parameterized test generation159 - Example: `TestFactory(run_test).add_option("width", [8,16,32]).generate_tests()`160161See `{plugin_root}/skills/rtl-p5s-func-verify/references/cocotb-ecosystem.md` for complete API reference.162163## Tier 2 Baseline Utilization164165When Tier 2 unit test results (`sim/{module}/{module}_unit_results.json`) are available166from Phase 4, the CDTG pipeline MUST operate incrementally:1671681. **Load baseline**: Read Tier 2 coverage metrics (line_pct, fsm_pct, toggle_pct)169 and already-covered features from unit_results.json1702. **Prioritize gaps**: CDTG Round 1 focuses on uncovered FSM states, untested code171 paths, and features not exercised in Tier 21723. **Avoid duplication**: Do not regenerate test vectors that duplicate Tier 2 coverage.173 Extend coverage, not repeat it1744. **Graceful degradation**: If Tier 2 results are absent (e.g., module skipped P4 unit175 testing), proceed from zero baseline. Log warning but do not block176177Coverage targets remain unchanged: Line ≥ 90%, Toggle ≥ 80%, FSM ≥ 70%.178The baseline only affects CDTG prioritization, not target thresholds.179180## Backward Traceability Policy181182Test failure reports MUST include requirement impact analysis:183- Every failed test must list its affected req_ids and ac_ids (from `# Covers:` comments)184- Failed tests without coverage comments are flagged as UNTRACEABLE185- Failure Impact Summary table is mandatory in regression reports186- Priority classification: Critical/High → BLOCKING, Medium/Low → WARNING, unmapped → UNTRACEABLE187188This policy ensures that test failures are immediately connected to requirements,189enabling prioritized debugging and requirement-level risk assessment.190191## Escalation & Stop Conditions192193- cocotb not installed → halt and route setup through `/rtl-agent-team:rat-setup`194- Failure persists after 2 RTL fix rounds → escalate to rtl-architect with waveform analysis195- Coverage below 80% after full regression → invoke rtl-p5s-coverage-analyze skill196- cocotb signal name mismatch error → testbench-dev must fix to use `i_`/`o_` convention197- Requirements with NO TEST COVERAGE after additional test generation → escalate to user198- Requirement traceability verdict FAIL with persistent test failures → escalate to rtl-p4-implement199200## Final Checklist201202- [ ] All cocotb tests use correct signal names (`dut.i_*`, `dut.o_*`, `dut.sys_clk`, `dut.sys_rst_n`)203- [ ] All test vectors run to completion204- [ ] RTL vs ref model comparison done per vector205- [ ] Waveform analysis done for all failures206- [ ] sim/coverage/coverage.xml generated207- [ ] sim/regression/*_result.json written per test208- [ ] Multi-seed regression passed (5 seeds per module: 1, 42, 123, 1337, 65536)209- [ ] Per-module pipelined execution used (TB → sim without waiting for all TBs)210- [ ] Coverage merged across seeds (sim/coverage/merged.info or sim/coverage/coverage.xml)211- [ ] Coverage targets met: line ≥ 90%, toggle ≥ 80%, FSM ≥ 70%212- [ ] sim/regression/seed_{seed}_results.json written per seed213- [ ] Early termination applied if failure rate >5%214- [ ] Requirement Traceability Matrix produced (AC-level when structured acceptance_criteria exist, REQ-level otherwise)215- [ ] Every REQ-NNN in `docs/phase-1-research/iron-requirements.json` (canonical) or legacy `docs/phase-1-research/requirements.json` (fallback) covered by at least one test216- [ ] When structured AC exists: every Critical/High ac_id is VERIFIED, FORMAL, or PARTIAL (PARTIAL = PARTIAL_PASS verdict at Stage 1, escalated to FAIL at Stage 3 final audit). UNTESTED = FAIL.217- [ ] All covered requirements pass their tests (or failures escalated)218- [ ] Traceability verdict is PASS or PARTIAL_PASS (PARTIAL_PASS = WARNING at Stage 1, escalated to FAIL at Stage 3)219- [ ] reviews/phase-5-verify/requirement-traceability.md saved
Run npx skillmds@latest add babyworm/rtl-p5s-func-verify-policy in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Internal reference: rtl p5s func verify policy (agent-loaded; do not invoke). It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
babyworm (@babyworm) published this skill. Their other Agent Skills are listed on their SkillMD profile.