# pulp-platform/croc architecture

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

- Interactive diagram: https://gitdiagram.com/pulp-platform/croc
- Repository: https://github.com/pulp-platform/croc

## Overview

Croc is an educational RISC-V system-on-chip, with a CVE2-based compute domain and an extensible user domain. Its principal use path is software running on the core, accessing memory-mapped peripherals over OBI and communicating through UART; JTAG is the documented boot mechanism. The graph also preserves the documented debug, timer, GPIO, DMA, SRAM, and user-domain capabilities. Hardware connections are based on the README’s architecture and memory map; most RTL was not excerpted, so internal wiring beyond those statements is not asserted.

Main entry points: [`rtl/obi/obi_xbar.sv`](https://github.com/pulp-platform/croc/blob/main/rtl/obi/obi_xbar.sv) (OBI interconnect), [`rtl/croc_domain.sv`](https://github.com/pulp-platform/croc/blob/main/rtl/croc_domain.sv) (Croc domain), [`sw/lib/src/uart.c`](https://github.com/pulp-platform/croc/blob/main/sw/lib/src/uart.c) (UART driver), [`rtl/croc_soc.sv`](https://github.com/pulp-platform/croc/blob/main/rtl/croc_soc.sv) (Croc SoC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_compute["Compute and memory"]
  node_domain["Croc domain<br/>[croc_domain.sv]"]
  node_corewrap["Core wrapper<br/>[core_wrap.sv]"]
  node_cve2["CVE2 core<br/>[cve2_core.sv]"]
  node_sram[("SRAM banks<br/>[tc_sram_impl.sv]")]
end

subgraph group_interconnect["SoC connectivity"]
  node_soc["Croc SoC<br/>[croc_soc.sv]"]
  node_obi["OBI interconnect<br/>[obi_xbar.sv]"]
  node_userdomain["User domain<br/>[user_domain.sv]"]
end

subgraph group_peripherals["Memory-mapped peripherals"]
  node_debug["JTAG debug<br/>[dm_top.sv]"]
  node_bootrom["Boot ROM<br/>[bootrom.sv]"]
  node_clint["CLINT<br/>[clint.sv]"]
  node_socctrl["SoC control<br/>[soc_ctrl_regs.sv]"]
  node_uart["UART<br/>[obi_uart.sv]"]
  node_gpio["GPIO<br/>[gpio.sv]"]
  node_timer["OBI timer<br/>[obi_timer.sv]"]
  node_dma["Optional DMA<br/>[croc_idma.sv]"]
end

subgraph group_software["Firmware interfaces"]
  node_uartdriver["UART driver<br/>[uart.c]"]
  node_print["Print library<br/>[print.c]"]
  node_clintdriver["CLINT driver<br/>[clint.c]"]
  node_gpiodriver["GPIO driver<br/>[gpio.c]"]
  node_timerdriver["Timer driver<br/>[obi_timer.c]"]
  node_dmadriver["DMA driver<br/>[idma.c]"]
end

node_firmware["Firmware<br/>[helloworld.c]"]

node_firmware -->|"initializes and writes"| node_uartdriver
node_firmware -->|"formats output"| node_print
node_print -->|"writes characters"| node_uartdriver
node_uartdriver -.->|"accesses registers"| node_uart
node_clintdriver -.->|"accesses registers"| node_clint
node_gpiodriver -.->|"accesses registers"| node_gpio
node_timerdriver -.->|"accesses registers"| node_timer
node_dmadriver -.->|"accesses registers"| node_dma
node_soc -->|"includes domain"| node_domain
node_soc -->|"connects domains"| node_userdomain
node_domain -->|"contains core"| node_cve2
node_domain -->|"contains SRAM"| node_sram
node_domain -->|"uses interconnect"| node_obi
node_obi -->|"routes address map"| node_debug
node_obi -->|"routes address map"| node_bootrom
node_obi -->|"routes address map"| node_clint
node_obi -->|"routes address map"| node_socctrl
node_obi -->|"routes address map"| node_uart
node_obi -->|"routes address map"| node_gpio
node_obi -->|"routes address map"| node_timer
node_obi -->|"routes address map"| node_dma

click node_firmware "https://github.com/pulp-platform/croc/blob/main/sw/helloworld.c"
click node_soc "https://github.com/pulp-platform/croc/blob/main/rtl/croc_soc.sv"
click node_domain "https://github.com/pulp-platform/croc/blob/main/rtl/croc_domain.sv"
click node_corewrap "https://github.com/pulp-platform/croc/blob/main/rtl/core_wrap.sv"
click node_cve2 "https://github.com/pulp-platform/croc/blob/main/rtl/cve2/cve2_core.sv"
click node_sram "https://github.com/pulp-platform/croc/blob/main/rtl/tech_cells_generic/tc_sram_impl.sv"
click node_obi "https://github.com/pulp-platform/croc/blob/main/rtl/obi/obi_xbar.sv"
click node_userdomain "https://github.com/pulp-platform/croc/blob/main/rtl/user_domain.sv"
click node_debug "https://github.com/pulp-platform/croc/blob/main/rtl/riscv-dbg/dm_top.sv"
click node_bootrom "https://github.com/pulp-platform/croc/blob/main/rtl/bootrom/bootrom.sv"
click node_clint "https://github.com/pulp-platform/croc/blob/main/rtl/clint/clint.sv"
click node_socctrl "https://github.com/pulp-platform/croc/blob/main/rtl/soc_ctrl/soc_ctrl_regs.sv"
click node_uart "https://github.com/pulp-platform/croc/blob/main/rtl/obi_uart/obi_uart.sv"
click node_gpio "https://github.com/pulp-platform/croc/blob/main/rtl/gpio/gpio.sv"
click node_timer "https://github.com/pulp-platform/croc/blob/main/rtl/obi_timer/obi_timer.sv"
click node_dma "https://github.com/pulp-platform/croc/blob/main/rtl/idma/croc_idma.sv"
click node_uartdriver "https://github.com/pulp-platform/croc/blob/main/sw/lib/src/uart.c"
click node_print "https://github.com/pulp-platform/croc/blob/main/sw/lib/src/print.c"
click node_clintdriver "https://github.com/pulp-platform/croc/blob/main/sw/lib/src/clint.c"
click node_gpiodriver "https://github.com/pulp-platform/croc/blob/main/sw/lib/src/gpio.c"
click node_timerdriver "https://github.com/pulp-platform/croc/blob/main/sw/lib/src/obi_timer.c"
click node_dmadriver "https://github.com/pulp-platform/croc/blob/main/sw/lib/src/idma.c"

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_domain,node_corewrap,node_cve2,node_sram toneBlue
class node_soc,node_obi,node_userdomain toneAmber
class node_debug,node_bootrom,node_clint,node_socctrl,node_uart,node_gpio,node_timer,node_dma toneMint
class node_uartdriver,node_print,node_clintdriver,node_gpiodriver,node_timerdriver,node_dmadriver toneRose
class node_firmware toneTeal
```

## Components

### Compute and memory

- [Croc domain](https://github.com/pulp-platform/croc/blob/main/rtl/croc_domain.sv): `rtl/croc_domain.sv`
- [Core wrapper](https://github.com/pulp-platform/croc/blob/main/rtl/core_wrap.sv): `rtl/core_wrap.sv`
- [CVE2 core](https://github.com/pulp-platform/croc/blob/main/rtl/cve2/cve2_core.sv): `rtl/cve2/cve2_core.sv`
- [SRAM banks](https://github.com/pulp-platform/croc/blob/main/rtl/tech_cells_generic/tc_sram_impl.sv): `rtl/tech_cells_generic/tc_sram_impl.sv`

### SoC connectivity

- [Croc SoC](https://github.com/pulp-platform/croc/blob/main/rtl/croc_soc.sv): `rtl/croc_soc.sv`
- [OBI interconnect](https://github.com/pulp-platform/croc/blob/main/rtl/obi/obi_xbar.sv): `rtl/obi/obi_xbar.sv`
- [User domain](https://github.com/pulp-platform/croc/blob/main/rtl/user_domain.sv): `rtl/user_domain.sv`

### Memory-mapped peripherals

- [JTAG debug](https://github.com/pulp-platform/croc/blob/main/rtl/riscv-dbg/dm_top.sv): `rtl/riscv-dbg/dm_top.sv`
- [Boot ROM](https://github.com/pulp-platform/croc/blob/main/rtl/bootrom/bootrom.sv): `rtl/bootrom/bootrom.sv`
- [CLINT](https://github.com/pulp-platform/croc/blob/main/rtl/clint/clint.sv): `rtl/clint/clint.sv`
- [SoC control](https://github.com/pulp-platform/croc/blob/main/rtl/soc_ctrl/soc_ctrl_regs.sv): `rtl/soc_ctrl/soc_ctrl_regs.sv`
- [UART](https://github.com/pulp-platform/croc/blob/main/rtl/obi_uart/obi_uart.sv): `rtl/obi_uart/obi_uart.sv`
- [GPIO](https://github.com/pulp-platform/croc/blob/main/rtl/gpio/gpio.sv): `rtl/gpio/gpio.sv`
- [OBI timer](https://github.com/pulp-platform/croc/blob/main/rtl/obi_timer/obi_timer.sv): `rtl/obi_timer/obi_timer.sv`
- [Optional DMA](https://github.com/pulp-platform/croc/blob/main/rtl/idma/croc_idma.sv): `rtl/idma/croc_idma.sv`

### Firmware interfaces

- [UART driver](https://github.com/pulp-platform/croc/blob/main/sw/lib/src/uart.c): `sw/lib/src/uart.c`
- [Print library](https://github.com/pulp-platform/croc/blob/main/sw/lib/src/print.c): `sw/lib/src/print.c`
- [CLINT driver](https://github.com/pulp-platform/croc/blob/main/sw/lib/src/clint.c): `sw/lib/src/clint.c`
- [GPIO driver](https://github.com/pulp-platform/croc/blob/main/sw/lib/src/gpio.c): `sw/lib/src/gpio.c`
- [Timer driver](https://github.com/pulp-platform/croc/blob/main/sw/lib/src/obi_timer.c): `sw/lib/src/obi_timer.c`
- [DMA driver](https://github.com/pulp-platform/croc/blob/main/sw/lib/src/idma.c): `sw/lib/src/idma.c`

### Other components

- [Firmware](https://github.com/pulp-platform/croc/blob/main/sw/helloworld.c): `sw/helloworld.c`

## Connections

- Firmware → UART driver: initializes and writes (evidence: `sw/helloworld.c`)
- Firmware → Print library: formats output (evidence: `sw/helloworld.c`)
- Print library → UART driver: writes characters (evidence: `sw/lib/src/uart.c`)
- UART driver → UART: accesses registers
- CLINT driver → CLINT: accesses registers
- GPIO driver → GPIO: accesses registers
- Timer driver → OBI timer: accesses registers
- DMA driver → Optional DMA: accesses registers
- Croc SoC → Croc domain: includes domain (evidence: `README.md`)
- Croc SoC → User domain: connects domains (evidence: `README.md`)
- Croc domain → CVE2 core: contains core (evidence: `README.md`)
- Croc domain → SRAM banks: contains SRAM (evidence: `README.md`)
- Croc domain → OBI interconnect: uses interconnect (evidence: `README.md`)
- OBI interconnect → JTAG debug: routes address map (evidence: `README.md`)
- OBI interconnect → Boot ROM: routes address map (evidence: `README.md`)
- OBI interconnect → CLINT: routes address map (evidence: `README.md`)
- OBI interconnect → SoC control: routes address map (evidence: `README.md`)
- OBI interconnect → UART: routes address map (evidence: `README.md`)
- OBI interconnect → GPIO: routes address map (evidence: `README.md`)
- OBI interconnect → OBI timer: routes address map (evidence: `README.md`)
- OBI interconnect → Optional DMA: routes address map (evidence: `README.md`)
