Rtl p4s unit test

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

Rtl p4s unit test is an AI agent skill from the GitHub repository babyworm/rtl-agent-team. P4 Tier 2 unit tests: verify each RTL module against its uarch spec and C reference model. Use after lint+smoke pass, before Tier 3 regression.

How to use this skill

Skill file

<Purpose>

Write and run unit tests that verify each RTL module implements its microarchitecture

specification correctly. Compares RTL output against the C reference model for functional

correctness. Goes beyond Tier 1 smoke testing (rtl-p4-implement Wave 6) to exercise key features

at uarch level: FSM state transitions, pipeline stage behavior, data transformation accuracy.

Testing Tier Context:

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

Outputs: sim/{module}/tb_{module}.sv testbench files + sim/{module}/{module}_unit_results.json.

</Purpose>

<Use_When>

</Use_When>

<Do_Not_Use_When>

</Do_Not_Use_When>

<Why_This_Exists>

Tier 1 (smoke) only verifies connectivity and basic I/O. Tier 2 unit tests verify that each

module implements its uarch spec — FSM states, pipeline stages, data transformations — using

the C reference model as the golden oracle. This catches behavioral bugs that smoke tests miss,

while remaining faster and more targeted than full regression (Tier 3).

</Why_This_Exists>

<Delegation>

The orchestrator writes testbenches per module (parallel via testbench-dev), selects

reference comparison mode (DPI-C or file-based), runs simulations, and handles

failure triage with waveform analysis.

All coding conventions, reference mode rules, escalation criteria, and result schemas

are defined in the rtl-p4s-unit-test-policy skill (loaded via the orchestrator's skills: field).

Execution

Task(subagent_type="rtl-agent-team:p4s-unit-test-orchestrator",

prompt="Execute Tier 2 unit testing. User input: $ARGUMENTS")

Do not perform any work directly.

The orchestrator agent manages testbench generation, simulation, and failure triage.

Output

</Delegation>

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.