๐Ÿ”ฒ Chip Design Institute
Educational Resources

RISC-V

The open-source instruction set architecture reshaping the semiconductor industry. Free to implement, free to extend, designed from clean-slate principles by UC Berkeley researchers.

ISA Overview

RISC-V (pronounced "risk-five") is an open, free instruction set architecture (ISA) that originated at UC Berkeley in 2010. Created by Krste Asanovic, Andrew Waterman, and Yunsup Lee, it was the fifth RISC ISA designed at Berkeley (after RISC-I, RISC-II, SOAR, and SPUR). Unlike ARM or x86, RISC-V is not owned by any company โ€” it is governed by RISC-V International, a non-profit foundation with 4,000+ member organizations.

Why RISC-V Matters

x86-64
CISC
Variable-length
400+ instructions
Intel/AMD only
ARM
RISC-ish
Fixed 32-bit
~1000 instructions
License required
RISC-V
Pure RISC
Fixed 32-bit
47 base instructions
Open & free

RISC-V vs ARM vs x86

🔓 RISC-V is like an open-source recipe for making CPUs. Normally, if you want to make a chip, you have to pay companies like ARM millions of dollars for their designs. RISC-V is FREE for anyone to use โ€” like Wikipedia but for chip designs! Students, startups, and even countries are using it to build their own processors.

Base Integer Instructions (RV32I)

RV32I is the base 32-bit integer instruction set. It defines 47 instructions, 32 integer registers (x0-x31, each 32 bits wide), and a 32-bit program counter. Register x0 is hardwired to zero โ€” reads always return 0, writes are discarded. This simplifies instruction encoding and eliminates the need for a separate "move" instruction (use add rd, rs, x0).

RV32I / RV64I — Base Integer (47 instructions)
M — Mul/Div
A — Atomics
F/D — Float
C — Compressed
V — Vector
Custom ext.

Instruction Categories

RV64I

The 64-bit variant. Registers are 64 bits wide. Adds word-sized variants: ADDW, SUBW, SLLW, SRLW, SRAW (operate on the lower 32 bits and sign-extend the result), plus LWU (load word unsigned) and LD/SD (load/store doubleword). RV64I is the target for Linux-capable application processors.

Standard Extensions

ExtensionNameDescription
MMultiply/DivideMUL, MULH, MULHU, MULHSU, DIV, DIVU, REM, REMU. Hardware integer multiplication and division. Essential for general-purpose computing.
AAtomicLR (Load-Reserved), SC (Store-Conditional), and AMO (Atomic Memory Operations: AMOSWAP, AMOADD, AMOAND, AMOOR, AMOXOR, AMOMAX, AMOMIN). For multi-core synchronization, mutexes, lock-free data structures.
FSingle-Precision Float32 floating-point registers (f0-f31). FADD.S, FSUB.S, FMUL.S, FDIV.S, FSQRT.S, FMA (fused multiply-add), comparisons, conversions. IEEE 754 compliant.
DDouble-Precision FloatExtends F to 64-bit doubles. Same operations with .D suffix. f registers are 64 bits wide. Requires F extension.
CCompressed16-bit encodings for common instructions. Reduces code size by 25-30% with minimal hardware cost. A 16-bit C instruction maps to exactly one 32-bit base instruction. Mixed 16/32-bit instruction stream.
VVectorScalable vector extension. Variable-length vectors (implementation chooses VLEN: 128-65536 bits). VADD, VMUL, VFMA, masked operations, strided/indexed loads. For SIMD, machine learning, DSP.
ZicsrCSR InstructionsCSRRW, CSRRS, CSRRC (read/write/set/clear Control and Status Registers). Access performance counters, interrupt configuration, etc.
ZifenceiInstruction FenceFENCE.I instruction for synchronizing instruction and data memory. Needed for self-modifying code, JIT compilers.
BBit ManipulationZba (address generation), Zbb (basic bit manipulation: CLZ, CTZ, CPOP, REV8, ORC.B), Zbc (carry-less multiply), Zbs (single-bit operations). Ratified 2024.

The "G" Shorthand

RV32G = RV32IMAFDZicsr_Zifencei โ€” the "general-purpose" ISA combining the base integer ISA with multiply, atomics, single and double float, CSR access, and instruction fence. This is the standard target for Linux-capable processors. RV64G is the 64-bit equivalent.

Custom Extensions

RISC-V explicitly reserves opcode space for custom extensions (four major opcodes reserved). Companies can add domain-specific instructions without conflicting with standard extensions. Examples: Qualcomm Hexagon-style VLIW extensions, AI accelerator instructions, cryptographic instructions. Custom extensions are a key advantage over ARM and x86, where adding instructions requires vendor approval.

🧩 RISC-V is like a LEGO instruction set. The base set (RV32I) has just 47 simple instructions โ€” add, subtract, load, store, jump. Then you snap on extensions like LEGO packs: M adds multiply/divide, F adds decimal math, V adds vector math for AI. You only include what you need, so a tiny sensor chip and a supercomputer can both use RISC-V!

Instruction Formats

RISC-V uses 6 instruction formats, all 32 bits wide. The opcode field (bits 6:0) is always in the same position. Source registers (rs1, rs2) and destination register (rd) are always in the same bit positions when present. This regularity simplifies decode hardware.

Design Rationale

The consistent register field positions (rs1 at bits 19:15, rs2 at bits 24:20, rd at bits 11:7) allow the register file to be read before the instruction is fully decoded. The immediate encoding places the sign bit always at bit 31 for fast sign-extension. These seemingly minor choices significantly simplify high-performance pipeline implementations.

Privileged Architecture

The RISC-V privileged specification defines the machine modes, interrupt handling, virtual memory, and system-level features needed to run operating systems.

Privilege Levels

CSRs (Control and Status Registers)

Virtual Memory

Ecosystem

Software

SBI (Supervisor Binary Interface)

The SBI is the firmware interface between S-mode (OS kernel) and M-mode (firmware). It provides standardized services: console I/O, timer, IPI (inter-processor interrupt), remote fence, HSM (hart state management), and PMU (performance monitoring). OpenSBI is the reference open-source SBI implementation. Analogous to BIOS/UEFI services in the x86 world.

Debug Specification

RISC-V defines a standard debug interface: debug module (DM), debug transport module (DTM), and trigger module. Supports external debug (via JTAG) and self-hosted debug (ebreak). GDB connects via OpenOCD. Hardware breakpoints (up to implementation-defined count) and single-stepping are specified.

Implementations

Open-Source Cores

Rocket

In-order, 5-stage pipeline. Written in Chisel (Scala). The reference RISC-V implementation from UC Berkeley. Configurable, well-tested, and silicon-proven.

UC Berkeley | Chisel | BSD

BOOM

Berkeley Out-of-Order Machine. Superscalar, out-of-order, speculative. Written in Chisel. Research-grade implementation competitive with commercial cores.

UC Berkeley | Chisel | BSD

CVA6 (Ariane)

6-stage, single-issue, in-order pipeline. SystemVerilog. Linux-capable. Maintained by OpenHW Group. Used in academic and industrial research.

ETH Zurich | SystemVerilog | Apache 2.0

VexRiscv

Highly configurable RISC-V core. Written in SpinalHDL. From tiny (RV32E, 400 LUTs) to Linux-capable (RV32IMA, MMU). FPGA-optimized.

SpinalHDL | MIT License

PicoRV32

Tiny RISC-V core (RV32IMC). ~2000 lines of Verilog. Optimized for area (750-2000 LUTs). No pipeline โ€” multicycle. Great for learning and tiny FPGA projects.

Clifford Wolf | Verilog | ISC

NEORV32

Full-featured RISC-V processor in VHDL. RV32/RV64, M/S/U modes, MMU, FPU, peripherals included. Targets any FPGA. Excellent documentation.

VHDL | BSD | FPGA-optimized

Commercial Implementations

RISC-V in Numbers

Resources

RISC-V Specifications

Official ISA specifications. Unprivileged spec, privileged spec, debug spec, and extension ratification status. The authoritative source.

RISC-V International | Free

The RISC-V Reader

Patterson & Waterman's practical introduction to RISC-V. Concise, well-written, covers the ISA and its design rationale. Available as free PDF.

Patterson & Waterman | Free PDF

Spike ISA Simulator

The reference functional RISC-V ISA simulator. Written in C++. Supports RV32/RV64, all standard extensions, and interactive debug mode.

GitHub | BSD

RISC-V GNU Toolchain

GCC, binutils, glibc/newlib for RISC-V. Cross-compiler for bare-metal (riscv64-unknown-elf) and Linux (riscv64-unknown-linux-gnu) targets.

GitHub | Free

SiFive Learn

Free RISC-V courses and documentation from SiFive. Core architecture guides, software tutorials, and development board guides.

SiFive | Free

Five EmbedDev

Comprehensive RISC-V reference. Instruction encoding tables, CSR documentation, extension summaries. Invaluable quick reference.

Reference | Free