rtl-p4s-unit-test

Generate and run RTL unit testbenches comparing outputs to a C reference model.

43|9|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/babyworm/rtl-agent-team --skill rtl-p4s-unit-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rtl-p4s-unit-test
Source: https://github.com/babyworm/rtl-agent-team/tree/main/skills/rtl-p4s-unit-test
Command: npx skills add https://github.com/babyworm/rtl-agent-team --skill rtl-p4s-unit-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures each RTL module faithfully implements its microarchitecture by exercising FSM transitions, pipeline behavior, and data transformations and detecting mismatches versus the golden C reference model.

Core Features & Use Cases

  • Per-module unit test generation: Produces targeted testbenches that go beyond connectivity smoke tests to validate uarch-level behaviors.
  • Reference comparison: Compares RTL outputs to a C reference model using DPI-C or file-based modes to catch semantic violations.
  • Rapid triage and regression: Generates sim/{module}/tb_{module}.sv and sim/{module}/{module}_unit_results.json to automate failure analysis, coverage checks, and regression gating.
  • Use Case: Validate a newly implemented ALU datapath FSM against the C model to catch state transition and arithmetic edge-case bugs before full regression.

Quick Start

Invoke the p4s-unit-test orchestrator to generate and run per-module testbenches and compare RTL outputs against the C reference model.

Frequently Asked Questions about rtl-p4s-unit-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify RTL modules against a C reference model?

Verify RTL modules by generating and running unit testbenches that compare RTL outputs to a C reference model using DPI-C or file-based comparison modes. This detects semantic mismatches in microarchitecture behaviors like FSM transitions and pipeline stages.

What is per-module unit testing in RTL simulation?

Per-module unit testing in RTL simulation produces targeted testbenches that go beyond connectivity smoke tests to validate microarchitecture-level behaviors, exercising FSM transitions, pipeline stages, and data transformations against expected outputs.

How do I generate a testbench for FSM transitions and pipeline behavior?

Generate a testbench for FSM transitions and pipeline behavior by invoking the unit test orchestrator, which creates sim/{module}/tb_{module}.sv files to automate failure analysis, coverage checks, and regression gating for your RTL.

Do I need lint-clean RTL and a passing smoke test before unit verification?

Yes, you need lint-clean RTL, a passing Tier 1 smoke test, access to the C reference model, and a simulation flow supporting DPI-C or file-based comparison before running unit verification testbenches.

Does RTL unit verification work with file-based comparison instead of DPI-C?

Yes, RTL unit verification supports both DPI-C and file-based comparison modes to compare RTL outputs against the C reference model, accommodating different simulation flow setups and toolchain constraints.

What is the best way to automate failure analysis for RTL module mismatches?

Automate failure analysis for RTL module mismatches by generating sim/{module}/{module}_unit_results.json files during unit testbench execution, which enables rapid triage, coverage checks, and regression gating.