본문으로 건너뛰기
cccskills
무료GitHub에 공개

vexplain

Generate documentation for any RTL module from Verilog source files

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Verilog Reader

Overview

This guide defines the workflow for generating documentation for a Verilog RTL module from its source files. The RTL is the ground truth: the generated document describes the module as implemented, accurately enough that another skill can instantiate, drive, and reason about it without reading the source (see .claude/skills/shared/ModuleDocContract.md).

Target Resolution & Name Derivation

The input is a single target module, identified by a file path or a module name. Resolve it to one top-level Verilog source file:

  • A path under ./rtl or ./lib is the target directly.
  • A bare module name resolves to ./rtl/<module>.v, or to a ./lib module — either ./lib/<module>.v (single-file) or ./lib/<module>/<module>.v (multi-file, where the top file shares the module's name).

The module name is the source file's base name. All output names derive from it, not from any partial path. Other .v files inside a multi-file ./lib/<mod>/ folder are submodules, not separate targets (see analysis order below).

If a single .v file declares more than one module, the target is the module whose name matches the file base name; the others are treated as submodules.

Before You Start — Re-run Safety

vexplain overwrites the module document. Two cases need care:

  • Existing doc — confirm first. An rtl/ doc/<module>.md may be a pre-implementation vdesign draft, and a lib/<module>.md is the canonical reference for a reusable module. Generating a missing doc is the intended use; overwriting an existing one is destructive — confirm with the user first, then regenerate wholesale from the RTL (now ground truth).
  • Unfilled backbone — stop. If the target RTL still contains //@ markers (vflow's incompleteness marker, CodingStyle §18), it is a vdesign backbone that vfill has not implemented. Stop and report; do not document empty logic. Pre-implementation intent is vdesign's job.

Step 1 - Analyze the Design

Read the target Verilog source file and determine the function of the RTL module.

Use .claude/skills/shared/CodingStyle.md to interpret signal names, bus interface prefixes, and FSM patterns in the code.

If the module instantiates submodules, follow this order:

  1. Check whether each submodule already has documentation.
  2. If documentation exists, use it to understand the submodule behavior.
  3. If documentation does not exist, read the submodule RTL code only as needed to understand the behavior of the target module.

Document only the target module. Do not duplicate documentation for submodules that are documented elsewhere — link to their <module>.md instead (ModuleDocContract Excluded Content).

After the analysis is complete, generate a new Markdown file according to the following output rules:

Output file rules:

  • The output file must use the same base name as the Verilog file (the module name).
  • The output file must use the .md extension.
  • If the target file is under ./rtl, place the output in ./doc/.
  • If the target file is under ./lib, place the output in the same folder as the Verilog file.

Step 2 - Required and Excluded Content

The generated documentation must follow the module documentation contract defined in .claude/skills/shared/ModuleDocContract.md — every required section, §1–§11, plus its Excluded Content rules.

Each section's facts live in a specific place in the RTL — extract them from there, never assume:

Contract sectionExtract from
§2 Parametersthe #(...) declaration for the actual defaults. Legal ranges and cross-parameter constraints: derive from how each parameter is used ($clog2, part-selects, replication — a bus sliced as [i*8 +: 8] implies a multiple-of-8 width). If a range cannot be inferred from the code, state the default as the only verified value — do not invent a range.
§3 Portsthe module declaration verbatim; each output's Reset Value from the reset branch of the always block that drives it.
§4 Interface Protocolthe handshake logic itself: what gates a transfer (valid && ready), whether outputs are registered or combinational relative to inputs, who may deassert what. Build the example-transaction cycle table by walking one real transaction through the implemented logic — including a stalled/back-pressured beat.
§5 Reset Behaviorthe reset compare (rst_n == RS_LV / !rst_n) and every assignment in the reset branch; note registers deliberately not reset (qualified-by-valid datapath regs, CodingStyle §5/§14).
§6 Timingcount the actual register stages from input to output (_ff registers, s0_/s1_ stage chains) — never copy a latency from a proposal or comment without confirming it in the logic.
§7/§8 Functional / FSMthe implemented behavior; FSM states from the localparam state encodings and the case transition logic, drawn as a mermaid stateDiagram-v2.
§9 Register Mapthe address decode — the case (addr) / if (addr == ...) in the write path and the read mux. Access type from the logic, not naming: write-decoded + readable = RW; read-mux-only = RO; write-decoded only = WO; self-clears on a read = RC; cleared by writing 1 = W1C. Reset values from the reset branch; word-vs-byte addressing from how the address is compared/shifted.
§10 Usage Constraintsthe guards the logic silently assumes: a config register sampled only in the IDLE state implies "configure before starting"; an input used without a holding register implies a stability requirement; the overflow/illegal-input paths show what is saturated, wrapped, dropped, or flagged.
§11 Instantiation Templatethe module declaration — mechanical; every port named, parameters at their declared defaults.

Step 3 - Self-check the Document

Before finishing, verify the document is an instantiation-accurate contract for the RTL — downstream skills drive the module from it without re-reading the source. Walk each port and parameter and confirm:

CheckPass condition
Ports complete & exactEvery port in the module declaration appears in the Ports table with matching name, direction, and width; none added, dropped, renamed, or re-widthed (ModuleDocContract §3).
Parameters complete & exactEvery parameter appears in the Parameters table with its actual default and a legal range; section omitted only if the module has none (§2).
Reset values consistentEach output's Reset Value column agrees with the reset logic in the RTL and with the Reset Behavior section (§3, §5).
Reset conventionReset is described as synchronous, active level stated against RS_LV where applicable (§5).
Timing derived from RTLLatency, pipeline depth, and throughput match the implemented register stages, not assumptions (§6).
Register map completeEvery CPU-accessible register in the RTL address decode appears in the Register Map (§9) with its address, access type (W1C/RC marked explicitly), and reset value; word/byte addressing stated. Section omitted only if the module has no registers.
Template instantiatesThe Instantiation Template (§11) matches the module declaration exactly — every port named, every parameter at its declared default.
Constraints capturedSequencing rules, input-stability assumptions, and error/boundary behavior visible in the RTL are stated in Usage Constraints (§10), or the section says "none" in one line.
Submodules linked, not duplicatedDocumented submodules are referenced by link; none re-documented inline (Excluded Content).
No excluded contentNo line-by-line code walkthrough or implementation internals (Excluded Content).

If any check fails, fix the document and re-run the check — do not leave the doc disagreeing with the RTL it describes.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

varch

무료

Decompose an IP requirement into submodules, define interfaces, and generate an architecture document plus per-module requirement files and a top-level skeleton

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

phamcuong21478/rtl-skills182026년 6월 10일 업데이트

vdebug

무료

Trace failing signals through the RTL hierarchy, classify root cause, and write a debug report per issue — no fix is proposed

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

phamcuong21478/rtl-skills182026년 6월 10일 업데이트

vdesign

무료

Generate a design proposal, documentation, and RTL backbone from a requirement file

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

phamcuong21478/rtl-skills182026년 6월 10일 업데이트

vdoc

무료

Aggregate all per-module documentation into a single comprehensive IP document

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

phamcuong21478/rtl-skills182026년 6월 10일 업데이트

vfill

무료

Implement Verilog code from an approved design proposal, then lint and simulate

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

phamcuong21478/rtl-skills182026년 6월 10일 업데이트

vflow

무료

Scan project state to determine phase completion, write flow_status.md, and orchestrate the full RTL design flow from architecture to documentation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

phamcuong21478/rtl-skills182026년 6월 10일 업데이트

phamcuong21478의 스킬 모두 보기

이 스킬의 문제 신고