How openhwgroup/cva6-sdk works
Project Type and Purpose
• Type: Embedded toolchain & SDK for the OpenHW CVA6 RISC-V core
• Purpose:
– Provide all host-side tools (Spike ISA simulator, FESVR, riscv-tests), firmware (OpenSBI, U-Boot), patches (Linux, Agilex, Altera SD card), and a root filesystem (Buildroot + Busybox)
– Enable building FPGA boot images (Genesys II, Agilex7) and simulation images (Spike + OpenSBI + Linux)
File Structure
Top-level components:
• Submodules: opensbi, riscv-isa-sim, riscv-tests, u-boot
• Patches: linux_patch/, agilex_patch/, altera-sd-card/
• Build orchestrator: Makefile, configs/, container/Dockerfile
• Buildroot + rootfs: buildroot/, rootfs/
• Utility: cachetest/, vitetris (example apps)
README for Insights
• Build targets: images, vmlinux, uImage.bin, fw_payload.bin, isa-sim, spike_payload, flash-sdcard
• Supported platforms: fpga/ariane (Genesys II), fpga/cva6-altera (Agilex7)
• Docker container to standardize host environment
Main Components & Their Relationships
a. Host Environment
– Native host (Ubuntu/Fedora) or Docker container
– Build orchestrator (Makefile + configs + patches)
– Submodules (cloned via git submodule)
– Buildroot toolchain (cross-compiler, binutils, libraries)
b. Build System Flow
1. Apply patches (linux_patch/, agilex_patch/)
2. Build subcomponents:
• OpenSBI → firmware (SBI)
• U-Boot → bootloader
• Linux kernel → vmlinux, uImage
• Buildroot → rootfs/initramfs, host tools (in install$(XLEN)/bin)
• Spike → ISA simulator
• riscv-tests, riscv-fesvr → tests & sim tether
3. Link & package images: fw_payload.bin (OpenSBI+U-Boot), uImage.bin (kernel), rootfs, partition table
4. Output to install$(XLEN)/ and/or flash to SD card
c. Target Execution Environments
• FPGA board (Genesys II, Agilex7) via boot from SD card
• Spike simulator (uses riscv-fesvr to handle syscalls)
Architectural Patterns & Design Principles
• Modular, submodule-based: each tool lives in its own directory/submodule
• Makefile-driven monorepo orchestration
• Layered boot architecture: Hardware → OpenSBI → U-Boot → Linux → Userspace
• Cross-compile buildroot host tools vs. target rootfs separation