# darklife/darkriscv architecture

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

- Interactive diagram: https://gitdiagram.com/darklife/darkriscv
- Repository: https://github.com/darklife/darkriscv

## Overview

DarkRISCV is an open-source RISC-V FPGA softcore and surrounding SoC. Its principal workflow is executing firmware on the CPU, with the SoC fabric connecting the core to memory and I/O; board-specific configurations adapt the design to FPGA platforms. The README documents the main architecture and optional features, but RTL excerpts were not provided, so implementation-level connections beyond those documented are omitted or marked unverified.

Main entry points: [`rtl/darksocv.v`](https://github.com/darklife/darkriscv/blob/master/rtl/darksocv.v) (SoC top), [`rtl/darkriscv.v`](https://github.com/darklife/darkriscv/blob/master/rtl/darkriscv.v) (RISC-V core), [`rtl/darkio.v`](https://github.com/darklife/darkriscv/blob/master/rtl/darkio.v) (I/O interface), [`rtl/darkbridge.v`](https://github.com/darklife/darkriscv/blob/master/rtl/darkbridge.v) (DarkBridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cpu["Processor core"]
  node_core["RISC-V core<br/>[darkriscv.v]"]
  node_mac["Multiply-accumulate<br/>[darkmac.v]"]
end

subgraph group_soc["SoC fabric"]
  node_soc_top["SoC top<br/>[darksocv.v]"]
  node_bridge["DarkBridge<br/>[darkbridge.v]"]
  node_cache["Caches<br/>[darkcache.v]"]
  node_pll["Clocking<br/>[darkpll.v]"]
end

subgraph group_io["Memory and I/O"]
  node_ram["On-chip RAM<br/>[darkram.v]"]
  node_sdram["SDRAM controller"]
  node_io["I/O interface<br/>[darkio.v]"]
  node_uart["UART<br/>[darkuart.v]"]
  node_spi["SPI<br/>[darkspi.v]"]
end

subgraph group_platform["Firmware and boards"]
  node_firmware["Firmware"]
  node_boards["FPGA board targets"]
end

node_developer(("Firmware user"))

node_developer -->|"provides"| node_firmware
node_firmware -->|"executes on"| node_core
node_core -->|"integrates with"| node_soc_top
node_soc_top -.->|"uses"| node_bridge
node_soc_top -.->|"includes optionally"| node_cache
node_bridge -.->|"provides optionally"| node_cache
node_soc_top -.->|"shares memory"| node_ram
node_soc_top -.->|"supports optionally"| node_sdram
node_soc_top -.->|"connects I/O"| node_io
node_io -.->|"routes to"| node_uart
node_io -.->|"routes to"| node_spi
node_core -.->|"uses optionally"| node_mac
node_boards -.->|"targets"| node_soc_top

click node_firmware "https://github.com/darklife/darkriscv/tree/master/src"
click node_core "https://github.com/darklife/darkriscv/blob/master/rtl/darkriscv.v"
click node_soc_top "https://github.com/darklife/darkriscv/blob/master/rtl/darksocv.v"
click node_bridge "https://github.com/darklife/darkriscv/blob/master/rtl/darkbridge.v"
click node_cache "https://github.com/darklife/darkriscv/blob/master/rtl/darkcache.v"
click node_ram "https://github.com/darklife/darkriscv/blob/master/rtl/darkram.v"
click node_sdram "https://github.com/darklife/darkriscv/blob/master/rtl/lib/sdram/mt48lc16m16a2_ctrl.v"
click node_io "https://github.com/darklife/darkriscv/blob/master/rtl/darkio.v"
click node_uart "https://github.com/darklife/darkriscv/blob/master/rtl/darkuart.v"
click node_spi "https://github.com/darklife/darkriscv/blob/master/rtl/darkspi.v"
click node_mac "https://github.com/darklife/darkriscv/blob/master/rtl/darkmac.v"
click node_pll "https://github.com/darklife/darkriscv/blob/master/rtl/darkpll.v"
click node_boards "https://github.com/darklife/darkriscv/tree/master/boards"

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_core,node_mac,node_developer toneBlue
class node_soc_top,node_bridge,node_cache,node_pll toneAmber
class node_ram,node_sdram,node_io,node_uart,node_spi toneMint
class node_firmware,node_boards toneRose
```

## Components

### Processor core

- [RISC-V core](https://github.com/darklife/darkriscv/blob/master/rtl/darkriscv.v): `rtl/darkriscv.v`
- [Multiply-accumulate](https://github.com/darklife/darkriscv/blob/master/rtl/darkmac.v): `rtl/darkmac.v`

### SoC fabric

- [SoC top](https://github.com/darklife/darkriscv/blob/master/rtl/darksocv.v): `rtl/darksocv.v`
- [DarkBridge](https://github.com/darklife/darkriscv/blob/master/rtl/darkbridge.v): `rtl/darkbridge.v`
- [Caches](https://github.com/darklife/darkriscv/blob/master/rtl/darkcache.v): `rtl/darkcache.v`
- [Clocking](https://github.com/darklife/darkriscv/blob/master/rtl/darkpll.v): `rtl/darkpll.v`

### Memory and I/O

- [On-chip RAM](https://github.com/darklife/darkriscv/blob/master/rtl/darkram.v): `rtl/darkram.v`
- [SDRAM controller](https://github.com/darklife/darkriscv/blob/master/rtl/lib/sdram/mt48lc16m16a2_ctrl.v): `rtl/lib/sdram/mt48lc16m16a2_ctrl.v`
- [I/O interface](https://github.com/darklife/darkriscv/blob/master/rtl/darkio.v): `rtl/darkio.v`
- [UART](https://github.com/darklife/darkriscv/blob/master/rtl/darkuart.v): `rtl/darkuart.v`
- [SPI](https://github.com/darklife/darkriscv/blob/master/rtl/darkspi.v): `rtl/darkspi.v`

### Firmware and boards

- [Firmware](https://github.com/darklife/darkriscv/tree/master/src): `src`
- [FPGA board targets](https://github.com/darklife/darkriscv/tree/master/boards): `boards`

### Other components

- **Firmware user**

## Connections

- Firmware user → Firmware: provides (evidence: `README.md`)
- Firmware → RISC-V core: executes on (evidence: `README.md`)
- RISC-V core → SoC top: integrates with (evidence: `README.md`)
- SoC top → DarkBridge: uses
- SoC top → Caches: includes optionally (evidence: `README.md`)
- DarkBridge → Caches: provides optionally (evidence: `README.md`)
- SoC top → On-chip RAM: shares memory (evidence: `README.md`)
- SoC top → SDRAM controller: supports optionally (evidence: `README.md`)
- SoC top → I/O interface: connects I/O
- I/O interface → UART: routes to
- I/O interface → SPI: routes to
- RISC-V core → Multiply-accumulate: uses optionally (evidence: `README.md`)
- FPGA board targets → SoC top: targets (evidence: `README.md`)
