Bundled with Unleash skills pack. Source: C:\Users\Admin.agents\skills\firmware-hdl-review\SKILL.md
Firmware and HDL Code Review
Use this skill when a review crosses hardware register models, HDL generators/templates, generated RTL, device emulators, and driver-facing tests.
Review goals
Find merge-blocking issues in:
- Register offsets and access semantics
- Descriptor ownership and ring state
- DMA bounds, errors, byte enables, and address width
- RTL handshake and FSM behavior
- Interrupt cause/mask/ack/MSI/MSI-X paths
- Cross-model consistency
- Donor acquisition safety: live-device side effects, opt-in destructive operations, and restoration
- Untrusted artifact safety: schema/topology validation, checked arithmetic, allocation and path bounds
- Simulation, synthesis, lint, CI, and packaging integration
Workflow
1. Pin the baseline
- Resolve and record the exact base SHA.
- Inspect worktree/index state separately.
- Compare candidate files against clean base objects such as
git show <base>:<path>, not against a possibly dirty checkout.
- Normalize CRLF/LF before producing the delta inventory.
- Do not modify source during an audit unless explicitly asked.
2. Inventory every layer
Map each changed behavior through:
- Authoritative hardware or upstream-driver definitions
- Device profile and BAR/register model
- Generator code and HDL templates
- Generated HDL output
- Software/VFIO behavior model
- Unit tests, HDL lint, simulation, synthesis, and CI targets
Tests that copy constants from the implementation are not independent evidence. Validate offsets and semantics against an authoritative source.
3. Review contracts, not files in isolation
For each register or descriptor field, write down:
- Address and width
- Reset, RW, W1C, read-clear, and FSM ownership
- Which side owns and advances head/tail pointers
- Legal ring size, alignment, and wrap behavior
- Address width and upper-half programming
- Completion/error semantics
- Interrupt cause and acknowledgement path
Then confirm every implementation layer follows the same contract.
4. Exercise generated RTL
- Lint the new module alone for fast syntax feedback.
- Generate a real fixture and lint the complete top-level design.
- Confirm source allowlists/manifests include every new generated module.
- Run a functional simulation for descriptor, DMA, and interrupt behavior.
- Inspect synthesis-sensitive issues: multiple drivers, inferred latches, width truncation, unreachable states, undeclared/black-box modules, and unsupported constructs.
5. Audit DMA safety
Check zero and malformed addresses, alignment, range, upper 32-bit address handling, maximum lengths, destination capacity, counter widths, final byte enables, timeout/error propagation, and partial-completion behavior. A device-emulation feature must not silently turn malformed descriptors into writes through stale or zero addresses.
6. Differentially test models
Use a common golden byte sequence and transaction trace for RTL and software emulation. Compare exact payload bytes, descriptor status, heads/tails, interrupt causes, and error behavior. Include wrap, simultaneous submissions, busy-time submissions, nonzero upper addresses, alternate BARs/BIRs, partial DWORDs, and injected DMA failures.
7. Audit donor acquisition and untrusted inputs
- Trace every live-device write, including driver bind/unbind, FLR, PMCSR/runtime-PM changes, PCI Command writes, BAR probes, doorbells, and read/write ioctls. Diagnostic and default collection paths should be read-only; destructive actions require explicit, narrowly scoped opt-in.
- Treat restore-after-write as insufficient for W1C, read-clear, doorbell, reset, and DMA-trigger registers: their side effects are not reversible by writing the original value back.
- Validate imported donor JSON before generation: strict schema/EOF, bounded file and decoded payload sizes, config-space size/word count, BAR/BIR topology, 64-bit BAR pairing, profile offsets, MSI-X ranges, and consistency with authoritative config bytes.
- Keep size arithmetic unsigned and checked until after capping. Compatibility overrides such as
--force must never bypass overflow, topology, allocation, or path-safety limits.
- Bound reset images and generated buffers to the captured/modelled window rather than the full advertised BAR aperture.
- Before recursive cleanup, prove the output directory is tool-owned; reject roots, ambiguous existing directories, and unsafe symlink resolution.
- See
references/donor-acquisition-input-safety.md for concrete review patterns and regression tests.
8. Check integration and merge risk
- Identify what the root test target actually runs; do not assume separate cocotb/C/HDL targets are included.
- Check generated-file validators, lint source patterns, feature flags, release manifests, and archive required-file lists.
- Test textual applicability against the clean base/index, not a dirty worktree.
- Report literal merge conflicts separately from behavioral regressions.
Output format
Lead with a verdict: approve, comment, or block merge. Prioritize findings as Critical, High, Medium, and Low. Every finding must include:
- Exact candidate file and line range
- Concrete failure mode and affected environment
- Evidence or reproduction result
- Root-cause fix, not only a symptom workaround
- Missing regression test
End with commands actually run, suites not run and why, baseline SHA, conflict status, and whether any files were modified.
Reference
See references/firmware-hdl-checklist.md for detailed pitfalls and boundary cases.
1---2name: firmware-hdl-review3description: Use when reviewing firmware/HDL changes across registers, SystemVerilog, DMA, sim, CI.4license: MIT5---67> Bundled with Unleash skills pack. Source: C:\Users\Admin\.agents\skills\firmware-hdl-review\SKILL.md89# Firmware and HDL Code Review1011Use this skill when a review crosses hardware register models, HDL generators/templates, generated RTL, device emulators, and driver-facing tests.1213## Review goals1415Find merge-blocking issues in:1617- Register offsets and access semantics18- Descriptor ownership and ring state19- DMA bounds, errors, byte enables, and address width20- RTL handshake and FSM behavior21- Interrupt cause/mask/ack/MSI/MSI-X paths22- Cross-model consistency23- Donor acquisition safety: live-device side effects, opt-in destructive operations, and restoration24- Untrusted artifact safety: schema/topology validation, checked arithmetic, allocation and path bounds25- Simulation, synthesis, lint, CI, and packaging integration2627## Workflow2829### 1. Pin the baseline30311. Resolve and record the exact base SHA.322. Inspect worktree/index state separately.333. Compare candidate files against clean base objects such as `git show <base>:<path>`, not against a possibly dirty checkout.344. Normalize CRLF/LF before producing the delta inventory.355. Do not modify source during an audit unless explicitly asked.3637### 2. Inventory every layer3839Map each changed behavior through:40411. Authoritative hardware or upstream-driver definitions422. Device profile and BAR/register model433. Generator code and HDL templates444. Generated HDL output455. Software/VFIO behavior model466. Unit tests, HDL lint, simulation, synthesis, and CI targets4748Tests that copy constants from the implementation are not independent evidence. Validate offsets and semantics against an authoritative source.4950### 3. Review contracts, not files in isolation5152For each register or descriptor field, write down:5354- Address and width55- Reset, RW, W1C, read-clear, and FSM ownership56- Which side owns and advances head/tail pointers57- Legal ring size, alignment, and wrap behavior58- Address width and upper-half programming59- Completion/error semantics60- Interrupt cause and acknowledgement path6162Then confirm every implementation layer follows the same contract.6364### 4. Exercise generated RTL6566- Lint the new module alone for fast syntax feedback.67- Generate a real fixture and lint the complete top-level design.68- Confirm source allowlists/manifests include every new generated module.69- Run a functional simulation for descriptor, DMA, and interrupt behavior.70- Inspect synthesis-sensitive issues: multiple drivers, inferred latches, width truncation, unreachable states, undeclared/black-box modules, and unsupported constructs.7172### 5. Audit DMA safety7374Check zero and malformed addresses, alignment, range, upper 32-bit address handling, maximum lengths, destination capacity, counter widths, final byte enables, timeout/error propagation, and partial-completion behavior. A device-emulation feature must not silently turn malformed descriptors into writes through stale or zero addresses.7576### 6. Differentially test models7778Use a common golden byte sequence and transaction trace for RTL and software emulation. Compare exact payload bytes, descriptor status, heads/tails, interrupt causes, and error behavior. Include wrap, simultaneous submissions, busy-time submissions, nonzero upper addresses, alternate BARs/BIRs, partial DWORDs, and injected DMA failures.7980### 7. Audit donor acquisition and untrusted inputs8182- Trace every live-device write, including driver bind/unbind, FLR, PMCSR/runtime-PM changes, PCI Command writes, BAR probes, doorbells, and read/write ioctls. Diagnostic and default collection paths should be read-only; destructive actions require explicit, narrowly scoped opt-in.83- Treat restore-after-write as insufficient for W1C, read-clear, doorbell, reset, and DMA-trigger registers: their side effects are not reversible by writing the original value back.84- Validate imported donor JSON before generation: strict schema/EOF, bounded file and decoded payload sizes, config-space size/word count, BAR/BIR topology, 64-bit BAR pairing, profile offsets, MSI-X ranges, and consistency with authoritative config bytes.85- Keep size arithmetic unsigned and checked until after capping. Compatibility overrides such as `--force` must never bypass overflow, topology, allocation, or path-safety limits.86- Bound reset images and generated buffers to the captured/modelled window rather than the full advertised BAR aperture.87- Before recursive cleanup, prove the output directory is tool-owned; reject roots, ambiguous existing directories, and unsafe symlink resolution.88- See `references/donor-acquisition-input-safety.md` for concrete review patterns and regression tests.8990### 8. Check integration and merge risk9192- Identify what the root test target actually runs; do not assume separate cocotb/C/HDL targets are included.93- Check generated-file validators, lint source patterns, feature flags, release manifests, and archive required-file lists.94- Test textual applicability against the clean base/index, not a dirty worktree.95- Report literal merge conflicts separately from behavioral regressions.9697## Output format9899Lead with a verdict: approve, comment, or block merge. Prioritize findings as Critical, High, Medium, and Low. Every finding must include:100101- Exact candidate file and line range102- Concrete failure mode and affected environment103- Evidence or reproduction result104- Root-cause fix, not only a symptom workaround105- Missing regression test106107End with commands actually run, suites not run and why, baseline SHA, conflict status, and whether any files were modified.108109## Reference110111See `references/firmware-hdl-checklist.md` for detailed pitfalls and boundary cases.112