# openhwfoundation/cva6-sdk architecture

> Architecture diagram of the GitHub repository openhwfoundation/cva6-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openhwfoundation/cva6-sdk
- Repository: https://github.com/openhwfoundation/cva6-sdk

## Overview

CVA6 SDK builds bootable RISC-V Linux images for Genesys 2 and Agilex 7 FPGA boards, with a QEMU target. The main workflow selects a board and XLEN, uses Buildroot to build the toolchain and boot components, packages them into an SD-card image, then boots that image through OpenSBI, U-Boot, and Linux on FPGA boards. The README also documents a simpler QEMU boot path. Relationships below follow README statements; source excerpts are limited to an unrelated cache benchmark, so implementation details beyond the documented workflow are not inferred.

Main entry points: [`buildroot`](https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot) (Buildroot), [`configs`](https://github.com/openhwfoundation/cva6-sdk/tree/master/configs) (Board configs), [`post_image.sh`](https://github.com/openhwfoundation/cva6-sdk/blob/master/post_image.sh) (Image packaging), [`fitImage.its.template`](https://github.com/openhwfoundation/cva6-sdk/blob/master/fitImage.its.template) (FIT template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Board configuration"]
  node_board_configs["Board configs"]
  node_image_config["Image layout"]
end

subgraph group_image_build["Image build"]
  node_buildroot["Buildroot"]
  node_toolchain["RISC-V toolchain"]
  node_rootfs["Root filesystem"]
  node_extra_packages["Extra packages"]
  node_fit_template["FIT template"]
  node_post_image["Image packaging<br/>[post_image.sh]"]
  node_sd_image["SD-card image"]
end

subgraph group_boot_chain["Boot chain"]
  node_opensbi["OpenSBI"]
  node_uboot["U-Boot"]
  node_linux["Linux kernel"]
  node_bootrom["Board BootROM"]
end

subgraph group_target_runtime["Target runtime"]
  node_sd_card[("SD card")]
  node_qemu["QEMU"]
  node_user_space["Linux user space"]
end

node_builder(("SDK user"))

node_builder -->|"selects board"| node_board_configs
node_builder -->|"starts build"| node_buildroot
node_board_configs -->|"configures build"| node_buildroot
node_buildroot -->|"builds"| node_toolchain
node_buildroot -->|"builds"| node_opensbi
node_buildroot -->|"builds"| node_uboot
node_buildroot -->|"builds"| node_linux
node_buildroot -->|"builds"| node_rootfs
node_buildroot -->|"includes"| node_extra_packages
node_buildroot -->|"calls"| node_post_image
node_fit_template -->|"defines FIT contents"| node_sd_image
node_image_config -->|"defines layout"| node_sd_image
node_post_image -->|"packages"| node_sd_image
node_sd_image -->|"flashed to"| node_sd_card
node_sd_card -->|"loads partition"| node_bootrom
node_bootrom -->|"loads and executes"| node_opensbi
node_opensbi -->|"executes payload"| node_uboot
node_uboot -->|"launches"| node_linux
node_linux -->|"launches init"| node_user_space
node_builder -->|"runs target"| node_qemu
node_qemu -->|"boots kernel"| node_linux
node_qemu -->|"loads initramfs"| node_user_space

click node_board_configs "https://github.com/openhwfoundation/cva6-sdk/tree/master/configs"
click node_buildroot "https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot"
click node_toolchain "https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot"
click node_opensbi "https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot"
click node_uboot "https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot"
click node_linux "https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot"
click node_rootfs "https://github.com/openhwfoundation/cva6-sdk/tree/master/rootfs"
click node_extra_packages "https://github.com/openhwfoundation/cva6-sdk/tree/master/br2-ext-tree/package"
click node_fit_template "https://github.com/openhwfoundation/cva6-sdk/blob/master/fitImage.its.template"
click node_image_config "https://github.com/openhwfoundation/cva6-sdk/tree/master/configs"
click node_post_image "https://github.com/openhwfoundation/cva6-sdk/blob/master/post_image.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_board_configs,node_image_config,node_builder toneBlue
class node_buildroot,node_toolchain,node_rootfs,node_extra_packages,node_fit_template,node_post_image,node_sd_image toneAmber
class node_opensbi,node_uboot,node_linux,node_bootrom toneMint
class node_sd_card,node_qemu,node_user_space toneRose
```

## Components

### Board configuration

- [Board configs](https://github.com/openhwfoundation/cva6-sdk/tree/master/configs): `configs`
- [Image layout](https://github.com/openhwfoundation/cva6-sdk/tree/master/configs): `configs`

### Image build

- [Buildroot](https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot): `buildroot`
- [RISC-V toolchain](https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot): `buildroot`
- [Root filesystem](https://github.com/openhwfoundation/cva6-sdk/tree/master/rootfs): `rootfs`
- [Extra packages](https://github.com/openhwfoundation/cva6-sdk/tree/master/br2-ext-tree/package): `br2-ext-tree/package`
- [FIT template](https://github.com/openhwfoundation/cva6-sdk/blob/master/fitImage.its.template): `fitImage.its.template`
- [Image packaging](https://github.com/openhwfoundation/cva6-sdk/blob/master/post_image.sh): `post_image.sh`
- **SD-card image**

### Boot chain

- [OpenSBI](https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot): `buildroot`
- [U-Boot](https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot): `buildroot`
- [Linux kernel](https://github.com/openhwfoundation/cva6-sdk/tree/master/buildroot): `buildroot`
- **Board BootROM**

### Target runtime

- **SD card**
- **QEMU**
- **Linux user space**

### Other components

- **SDK user**

## Connections

- SDK user → Board configs: selects board (evidence: `README.md`)
- SDK user → Buildroot: starts build (evidence: `README.md`)
- Board configs → Buildroot: configures build (evidence: `README.md`)
- Buildroot → RISC-V toolchain: builds (evidence: `README.md`)
- Buildroot → OpenSBI: builds (evidence: `README.md`)
- Buildroot → U-Boot: builds (evidence: `README.md`)
- Buildroot → Linux kernel: builds (evidence: `README.md`)
- Buildroot → Root filesystem: builds (evidence: `README.md`)
- Buildroot → Extra packages: includes (evidence: `README.md`)
- Buildroot → Image packaging: calls (evidence: `README.md`)
- FIT template → SD-card image: defines FIT contents (evidence: `README.md`)
- Image layout → SD-card image: defines layout (evidence: `README.md`)
- Image packaging → SD-card image: packages (evidence: `README.md`)
- SD-card image → SD card: flashed to (evidence: `README.md`)
- SD card → Board BootROM: loads partition (evidence: `README.md`)
- Board BootROM → OpenSBI: loads and executes (evidence: `README.md`)
- OpenSBI → U-Boot: executes payload (evidence: `README.md`)
- U-Boot → Linux kernel: launches (evidence: `README.md`)
- Linux kernel → Linux user space: launches init (evidence: `README.md`)
- SDK user → QEMU: runs target (evidence: `README.md`)
- QEMU → Linux kernel: boots kernel (evidence: `README.md`)
- QEMU → Linux user space: loads initramfs (evidence: `README.md`)
