code-review-riscv

Identify correctness issues, ABI violations, and pitfalls in RISC-V assembly code.

7.5k|1.8k|Updated Nov 10, 2013
One-click install
npx skills add https://github.com/FastLED/FastLED --skill code-review-riscv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-review-riscv
Source: https://github.com/FastLED/FastLED/tree/main/.claude/skills/code-review-riscv
Command: npx skills add https://github.com/FastLED/FastLED --skill code-review-riscv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

RISC-V code reviews to ensure correctness, ABI adherence, and best practices after changes to assembly or inline asm code.

Core Features & Use Cases

  • Instruction correctness: verify syntax, operands, and immediate ranges.
  • Register conventions: ABI compliance, saved vs temporary registers, stack alignment.
  • Memory access: alignment, sign extension, and offset limits.
  • Control flow: branches, calls, and returns.
  • CSR operations: privilege levels, atomicity, and field types.
  • Assembler directives: sections, alignment, symbol visibility, and data placement.
  • Common issues: misalignment, stack corruption, clobbered registers, and illegal immediates.
  • Platform-specific: RV32I vs RV64I, extensions (M/A/F/D/C), and ABI variants.

Quick Start

Review the provided RISC-V assembly patch to verify correctness and ABI conformance.

Frequently Asked Questions about code-review-riscv

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

FAQPage Schema
How do I check RISC-V assembly code for ABI violations and correctness issues?

To check RISC-V assembly for ABI violations, review syntax, operands, immediate ranges, register conventions, memory alignment, and control flow. Validating calling conventions and CSR usage ensures correctness across standalone assembly files, inline asm blocks, and small modules.

What are common pitfalls when writing inline asm for RISC-V?

Common RISC-V inline asm pitfalls include misalignment, stack corruption, clobbered registers, and illegal immediates. Analyzing instruction operands, saved versus temporary register usage, and stack alignment prevents these errors and maintains ABI compliance.

Does this RISC-V assembly review cover both RV32I and RV64I with extensions?

RISC-V assembly review covers both RV32I and RV64I base ISAs alongside common extensions like M, A, F, D, and C. It validates platform-specific differences, ABI variants, and instruction correctness across these distinct architectures.

How do I validate CSR operations and assembler directives in RISC-V?

Validating CSR operations in RISC-V involves checking privilege levels, atomicity, and field types. Assembler directives are verified for correct section placement, alignment, symbol visibility, and data placement to ensure proper module assembly.

What is the best way to verify stack alignment and register conventions in RISC-V?

The best way to verify stack alignment and register conventions is to audit saved versus temporary register usage and stack frame boundaries. Checking memory access alignment, sign extension, and offset limits ensures calling convention adherence.

Why does my RISC-V assembly fail due to illegal immediates or misalignment?

RISC-V assembly fails with illegal immediates when immediate ranges exceed ISA limits, and misalignment occurs when memory access lacks proper boundaries. Reviewing instruction operands, offset limits, and data placement resolves these constraint violations.