/claude-for-hardware:hdl-module-designfrom claude-for-hardware
Designs parameterized, validated, and exhaustively testable HDL modules (Verilog, VHDL, Chisel, ROHD, SpinalHDL) with typed configs and build-time assertions.
Ships in claude-for-hardware. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A hardware module is an interface plus an implementation. Get the interface and its configuration right and the implementation stays swappable, testable, and reusable across an FPGA and an ASIC.
Core principle: A module should declare exactly what it needs as typed configuration, validate it at build time, and be exhaustively testable in isolation. If you can't construct and test it without the rest of the SoC, the boundary is wrong.
int/String/bool constructor argsSkip for throwaway testbench glue or a one-line wire rename.
Hardware bugs are expensive, so push errors as early as possible: ideally a type error, otherwise a build-time assertion, never a silent miscompile.
BusKind.axi4 not "axi4". A typo becomes a compile error instead of a wrong build.addrWidth is a function of depth, compute it. Don't make the caller pass both and hope they agree.// ROHD-flavored, but the shape is language-neutral.
class FifoConfig {
final int depth;
final int width;
const FifoConfig({required this.depth, required this.width});
// build-time validation, names the bad field
void validate() {
if (depth <= 0 || (depth & (depth - 1)) != 0) {
throw ArgumentError('FifoConfig.depth must be a power of two, got $depth');
}
if (width <= 0) {
throw ArgumentError('FifoConfig.width must be positive, got $width');
}
}
int get addrWidth => depth.bitLength - 1; // derived, not passed in
}
The module and its elaboration logic live in the library. The CLI, build script, or generator is a thin wrapper that parses args and calls library methods. This keeps the module usable by other code (other generators, tests, third parties) and keeps the surface testable without spawning a process.
If you find yourself reaching into a module's internals from the CLI, lift that into a library method.
This is going to silicon. A miss is a respin.
lib/components/fifo.dart -> test/components/fifo_test.dart, lib/config/... -> test/config/.... Anyone can find the test for a unit.ignore/skip/ERROR_ON_X=false knob to make a violating design pass. Fix the design. See [[failures-should-fail]] in the silicon-grade-discipline skill.| Smell | Do instead |
|---|---|
8 positional int args | One typed config object |
mode == "fast" | mode == Mode.fast (enum) |
| Width mismatch caught in sim | Assert it at config construction |
| Logic in the CLI command | Library method, CLI calls it |
| Only top-level tests | One test file per component, mirrored layout |
skipDrc = true to get a pass | Fix the design |
const constructors with final fields.rohd-rtl-gotchas. See silicon-grade-discipline for the failures-should-fail and no-over-engineering rules this leans on.usb-fs-softphy-dfu-silicon-bugs.md in this directory: a worked catalogue of the silicon-grade bugs in a full-speed USB soft-PHY + EP0/DFU engine + SPI-NOR write engine (clock-recovery sample point, consecutive-SE0 EOP, async-FIFO data-storage and back-pressure, SET_ADDRESS/ZLP/toggle/SETUP-catch, flash erase/program arbitration), each one a happy-path-passing trap caught only by adversarial review.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
hdl, hardware-design, module-design, ip-block, parameterized-module
14 skills in this plugin
/bare-metal-bringupUse when bringing up bare-metal or kernel code on a new architecture, SoC, or board (RISC-V, ARM, x86, ESP32) and it won't boot, hangs after boot, or faults early; covers trap vectors, MMU/PMP, syscall ABI, and boot ordering/codegen-validationUse when building or debugging a compiler backend, codegen, or assembler and you need to prove the generated machine code is correct by executing it on a real CPU or a fast emulator, not just inspecting the output/differential-verificationUse when verifying a hardware DUT (a CPU core, FPGA, or netlist) against a golden reference model, building coverage-guided fuzzing, or detecting where silicon diverges from a simulator like Spike, an emulator, or SPICE/firmware-boot-chainUse when building or debugging a firmware and boot chain (RISC-V SBI, UEFI, ACPI, a bootloader handoff like Limine to an OS) or adding measured boot with a TPM, and a stage fails to hand off to the next/fpga-bringupUse when loading a bitstream onto a physical FPGA and driving or observing it over JTAG or GPIO, especially bit-banged JTAG from a host like a Raspberry Pi, or when configuration silently fails/fpga-synthesis-fitUse when synthesizing RTL to an FPGA with yosys/nextpnr (ECP5/Lattice and similar), fighting area or routing congestion, measuring Fmax, deciding why a design won't fit or route, or instantiating block RAM; covers the pre-pack vs post-pack metric trapnpx claudepluginhub lilithsemi/claude-for-hardware --plugin claude-for-hardwareOther plugins' skills for the same job