Rtl p5s uvm policy

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

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

How to use this skill

Skill file

UVM Verification Policy

UVM Naming Conventions

UVM environment code MUST follow the project coding conventions (CLAUDE.md):

Coverage Targets (Enforced by the Coverage Analysis Gate)

| Coverage Type | Target | Tool Flag (VCS) | Notes |

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

| Line | ≥ 90% | -cm line | Every executable line exercised |

| Toggle | ≥ 80% | -cm tgl | Signal 0→1 and 1→0 transitions |

| FSM | ≥ 70% | -cm fsm | State and transition coverage |

| Branch | ≥ 80% | -cm cond | if/case branch coverage |

| Functional | ≥ 95% | UVM covergroups | Architect-defined coverpoints |

Code coverage is always enabled during regression (-cm line+cond+fsm+tgl+branch for VCS,

-coverage all for Xcelium, -coverage for Questa). Merged from all seeds before evaluation.

Functional coverage is collected via uvm_subscriber-based coverage collectors in the

testbench. Covergroups must be mapped to requirements (REQ-U-*).

The regression runner enforces that every dispatched seed produces coverage and that the

vendor merge command succeeds. It records coverage_status and the reference targets in

the aggregate JSON. coverage-analyst owns percentage extraction and target enforcement.

Coverage-Driven Verification (CDV) Feedback Loop

When merged coverage falls below targets after regression, run a structured 3-round loop:

Round N: coverage-analyst → CDTG feedback table (gap analysis)
         test-plan-writer  → systematic test plan (ECP/BVA for config-dependent gaps)
         testbench-dev    → directed UVM sequences per gap row + test plan
         eda-runner       → regression with new tests → re-merge coverage
Round N+1: coverage-analyst re-analyzes → new guidance for remaining gaps
  1. coverage-analyst identifies uncovered bins, states, branches. Produces CDTG feedback table:

```

| Gap ID | Uncovered Bin | REQ | Constraint | Sequence | Expected |

```

  1. test-plan-writer applies ECP/BVA methodology for config-dependent gaps (parameter combinations)
  2. testbench-dev writes directed UVM sequences per gap row using the systematic test plan
  3. Re-run regression with new tests → re-merge → re-analyze
  4. Maximum 3 iterations. Convergence detection: 2 consecutive rounds with < 0.5% improvement
  5. On convergence: apply Coverage Exclusion Protocol per rtl-p5s-coverage-policy

(classify remaining bins as STIMULUS_GAP/STRUCTURAL_DEAD/INFRA_CODE, generate exclusion artifacts)

  1. If post-exclusion targets still not met after 3 rounds → escalate to user

UVM Stimulus-to-DUT Connectivity Verification

Before running regression, verify stimulus actually reaches the DUT:

  1. Randomization check: All rand fields in test class must be randomized
  1. DUT connectivity check: Every test knob must have a path to DUT port
  1. Effectiveness gate (after first iteration): verify coverage CHANGED across seeds

Enforcement in Orchestrator

p5s-uvm-orchestrator checks coverage delta after first regression iteration (Step 4).

If delta < 0.1% across seeds → invoke uvm-reviewer to diagnose stimulus connectivity

before running additional iterations.

Regression Runner

Use the UVM regression runner ({plugin_root} = plugin root resolved from .rat/state/spawn-context.json) for multi-seed regression:

bash {plugin_root}/skills/rtl-p5s-uvm-verify/scripts/run_regression_uvm.sh --sim vcs --seeds "42 123 456 789 1337" --module {module}

Escalation & Stop Conditions

Final Checklist

UVM Component Naming and Simulator-Specific Flags

UVM component naming conventions (aligned with project style):

Simulator-specific coverage flags — both compile and run must enable coverage:

# VCS — compile + run
vcs -full64 -sverilog -ntb_opts uvm-1.2 \
    -cm line+cond+fsm+tgl+branch \
    -cm_hier sim/uvm/coverage/hier.cfg \
    -timescale=1ns/1ps -f rtl/filelist_top.f \
    sim/uvm/agents/*/*.sv sim/uvm/env/*.sv sim/uvm/seq/*.sv \
    sim/uvm/tests/*.sv sim/uvm/tb/*.sv -o simv
./simv +UVM_TESTNAME={test} +ntb_random_seed={seed} \
    -cm line+cond+fsm+tgl+branch -cm_dir sim/uvm/coverage/seed_{seed}.vdb

# VCS — merge (text + XML for coverage-analyst parsing)
urg -dir sim/uvm/coverage/seed_*.vdb -report sim/uvm/coverage/merged \
    -elfile sim/uvm/coverage/exclusion.el -format both

# Questa — compile (MUST include +cover) + run
vlog -sv +cover=bcestf +incdir+sim/uvm \
    -f rtl/filelist_top.f sim/uvm/agents/*/*.sv sim/uvm/env/*.sv \
    sim/uvm/seq/*.sv sim/uvm/tests/*.sv sim/uvm/tb/*.sv
vsim -c -coverage tb_top +UVM_TESTNAME={test} -sv_seed {seed} \
    -do "coverage save -onexit sim/uvm/coverage/seed_{seed}.ucdb; run -all; quit -f"

# Questa — merge
vcover merge sim/uvm/coverage/merged.ucdb sim/uvm/coverage/seed_*.ucdb
vcover report -details sim/uvm/coverage/merged.ucdb

# Xcelium — compile + elaborate + run (separate phases)
xrun -sv -uvm -compile -coverage all -timescale 1ns/1ps \
    -f rtl/filelist_top.f sim/uvm/agents/*/*.sv sim/uvm/env/*.sv \
    sim/uvm/seq/*.sv sim/uvm/tests/*.sv sim/uvm/tb/*.sv \
    -xmlibdirpath build/xcelium
xrun -sv -uvm -elaborate -coverage all -timescale 1ns/1ps \
    -f rtl/filelist_top.f sim/uvm/agents/*/*.sv sim/uvm/env/*.sv \
    sim/uvm/seq/*.sv sim/uvm/tests/*.sv sim/uvm/tb/*.sv \
    -top tb_top -xmlibdirpath build/xcelium
xrun -R +UVM_TESTNAME={test} -seed {seed} \
    -coverage all -covworkdir sim/uvm/coverage/seed_{seed}/cov_work -covscope tb_top \
    -xmlibdirpath build/xcelium

# Xcelium — merge (via imc TCL script)
imc -exec merge_script.tcl   # merge -run seed_*/cov_work → report

Common mistakes to avoid:

See {plugin_root}/skills/rtl-p5s-uvm-verify/references/uvm-architecture.md for complete UVM class hierarchy, phase order,

and common UVM mistakes to avoid.

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.