vtestgen

vtestgen is a skill for Claude Code, Codex from phamcuong21478/rtl-skills. It costs 43 tokens per session (7,001 once invoked), scanned C, original, Apache-2.0.

A generator for creating a Verilog hardware testbench project and a broad set of self-checking tests for an IP block. A testbench is supporting code that drives a circuit under test and checks its results.

In plain words
What is it for?
Use it to create a reusable CPU-bus test environment for an IP block, generate tests across the required categories, validate them, and prepare the suite for vtestrun.
Why use it?
Building a bus-controlled simulation environment and planning many tests by hand is repetitive and can leave important data interfaces uncovered. This workflow creates the bench, testcases, build files, and testcase list, then validates each test with Make.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it to create a reusable CPU-bus test environment for an IP block, generate tests across the required categories, validate them, and prepare the suite for vtestrun.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/phamcuong21478/rtl-skills/vtestgen
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add phamcuong21478/rtl-skills --skill vtestgen
Clone the repo
git clone --depth 1 https://github.com/phamcuong21478/rtl-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vtestgen

README.md
[![agentmods](https://agentmods.dev/badge/skills/phamcuong21478/rtl-skills/vtestgen/github.svg)](https://agentmods.dev/skills/phamcuong21478/rtl-skills/vtestgen)
Your own site
<a href="https://agentmods.dev/skills/phamcuong21478/rtl-skills/vtestgen"><img src="https://agentmods.dev/badge/skills/phamcuong21478/rtl-skills/vtestgen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for vtestgen

Your own site · 80×15
<a href="https://agentmods.dev/skills/phamcuong21478/rtl-skills/vtestgen"><img src="https://agentmods.dev/badge/skills/phamcuong21478/rtl-skills/vtestgen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,001 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.07001
Opus 5 $0.00022 $0.03501
Sonnet 5 $0.00009 $0.01400
Haiku 4.5 $0.00004 $0.00700

Measured 11d ago against content hash de50e1c1c061, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

vtestgen scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

> non-PASS sim dirs) or `rm -rf sim/tb_<name>` — then re-run.
skills/vtestgen/SKILL.md · 442 lines

How it starts

The opening of the file, as written. The whole thing — 442 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Verilog Testcase Generator

Overview

This skill builds the IP-level test environment in two phases:

  • Phase A — Scaffold the bench project. Parse <ip>_top, then generate a reusable, Makefile-driven simulation project under tb/<ip>/: build system, clock/reset generators, a DUT-instance core, CPU-bus BFM tasks, and one CPU-controllable stimulus driver per data interface.
  • Phase B — Plan and generate the suite. Plan testcases across six mandatory categories, write each as a thin tb_*.sv that drives the bench only through the CPU bus, validate each with make, and write tc_list.md.

vtestrun later executes the suite through the same Makefile.

The input is an IP name. The outputs are:

tb/<ip>/Makefile              top dispatcher (auto-discovers tb_*.sv)
tb/<ip>/script/library.mk     per-testcase xvlog/xelab/xsim recipe
tb/<ip>/script/rtl.f          generated RTL hierarchy filelist
tb/<ip>/script/skip.list      names of skipped testcases, excluded by the Makefile
tb/<ip>/clock.vh              parameterized clock + sync-reset generators
tb/<ip>/dut.vh                reg-map, DUT signals/instance, sti instances, CPU BFM tasks + sequences
tb/<ip>/sti_<iface>.sv        one CPU-controllable stimulus driver per data interface
tb/<ip>/sco_<iface>.sv        one CPU-controllable scoreboard per checkable stream output (optional)
tb/<ip>/tb_<name>.sv          self-checking testcases (CPU-bus only)
tb/<ip>/tc_list.md            testcase index with status
tb/<ip>/sim/<tc>/             disposable build dirs

Template files for every artifact live in templates/ next to this SKILL.md. Treat them as the canonical shape; fill the {{...}} placeholders from the parsed IP. Testbench code is SystemVerilog (.sv) — permitted under tb/ (see .claude/skills/shared/CodingStyle.md).

Central design rule — the CPU bus is the single control plane. Every testcase drives the whole bench using only cpu_write / cpu_read / cpu_read_check (and the higher-level sequences built on them in dut.vh). The DUT is configured over the CPU bus; traffic generators live in separate sti_*.sv modules that are themselves CPU-bus slaves, so the test script configures and starts stimulus with cpu_write too.

Read the full file on GitHub · 442 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 442 lines · 43 tokens per session scan C de50e1c1c061

Subscribe to this mod's changes

vtestgen is a skill published in the GitHub repository phamcuong21478/rtl-skills (11 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 43 tokens to every session and 7,001 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.