# thalesgroup/cva6-softcore-contest architecture

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

- Interactive diagram: https://gitdiagram.com/thalesgroup/cva6-softcore-contest
- Repository: https://github.com/thalesgroup/cva6-softcore-contest

## Overview

This repository is a CVA6/CV32A6 contest platform and software workspace, with QOA audio encoding as its primary workload. The principal workflow is to encode the supplied clip, compare the stream with a reference, and measure cycles/instructions; the README documents building and running applications on the Zybo FPGA through JTAG, with UART console output. The graph also preserves the shorter simulation workload and boot-ROM/platform support. Evidence is limited to the supplied excerpts, source index, and README; unsampled implementation details and internal processor wiring are not inferred.

Main entry points: [`sw/app/qoa_encoder/main.c`](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/main.c) (QOA encoder app), [`sw/app/qoa_encoder_1s/main.c`](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder_1s/main.c) (One-second app), [`corev_apu/fpga`](https://github.com/thalesgroup/cva6-softcore-contest/tree/cv32a6_contest_26_27/corev_apu/fpga) (Zybo CV32A6), [`corev_apu/fpga/src/bootrom/src/main.c`](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/fpga/src/bootrom/src/main.c) (FPGA boot ROM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workload["QOA workloads"]
  node_qoa_app["QOA encoder app<br/>[main.c]"]
  node_qoa_impl["QOA implementation<br/>[qoa.h]"]
  node_audio["Audio corpus<br/>[corpus.h]"]
  node_reference["Golden stream<br/>[golden.h]"]
  node_short_app["One-second app<br/>[main.c]"]
  node_short_audio["Short corpus<br/>[corpus.h]"]
  node_short_ref["Short reference<br/>[golden.h]"]
end

subgraph group_platform["FPGA platform"]
  node_fpga["Zybo CV32A6"]
  node_jtag["JTAG debug link<br/>[remote_bitbang.cc]"]
  node_uart["UART console<br/>[uart.c]"]
  node_bsp["Software BSP"]
  node_sim_runner["Simulation runner<br/>[cva6.py]"]
  node_spike_trace["Spike trace parser"]
end

subgraph group_boot["Boot support"]
  node_bootrom["FPGA boot ROM<br/>[main.c]"]
  node_sd["SD access<br/>[sd.c]"]
  node_gpt["Partition lookup<br/>[gpt.c]"]
end

node_engineer(("Contest engineer"))
node_host(("Development host"))

node_qoa_app -->|"calls encoder"| node_qoa_impl
node_qoa_app -->|"encodes samples"| node_audio
node_qoa_app -->|"checks output"| node_reference
node_short_app -->|"encodes samples"| node_short_audio
node_short_app -->|"checks output"| node_short_ref
node_short_app -->|"uses encoder"| node_qoa_impl
node_engineer -->|"builds application"| node_host
node_host -->|"connects through"| node_jtag
node_jtag -->|"programs and debugs"| node_fpga
node_qoa_app -->|"runs on"| node_fpga
node_fpga -->|"outputs console"| node_uart
node_qoa_app -.->|"uses platform support"| node_bsp
node_bootrom -->|"initializes and prints"| node_uart
node_bootrom -.->|"partition lookup"| node_gpt
node_gpt -.->|"reads partition data"| node_sd
node_engineer -->|"runs simulations"| node_sim_runner
node_sim_runner -->|"converts trace logs"| node_spike_trace

click node_qoa_app "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/main.c"
click node_qoa_impl "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/qoa.h"
click node_audio "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/corpus.h"
click node_reference "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/golden.h"
click node_short_app "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder_1s/main.c"
click node_short_audio "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder_1s/corpus.h"
click node_short_ref "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder_1s/golden.h"
click node_fpga "https://github.com/thalesgroup/cva6-softcore-contest/tree/cv32a6_contest_26_27/corev_apu/fpga"
click node_jtag "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/tb/dpi/remote_bitbang.cc"
click node_uart "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/bsp/drivers/uart/uart.c"
click node_bsp "https://github.com/thalesgroup/cva6-softcore-contest/tree/cv32a6_contest_26_27/sw/bsp"
click node_bootrom "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/fpga/src/bootrom/src/main.c"
click node_sd "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/fpga/src/bootrom/src/sd.c"
click node_gpt "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/fpga/src/bootrom/src/gpt.c"
click node_sim_runner "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/verif/sim/cva6.py"
click node_spike_trace "https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/verif/sim/cva6_spike_log_to_trace_csv.py"

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_qoa_app,node_qoa_impl,node_audio,node_reference,node_short_app,node_short_audio,node_short_ref toneBlue
class node_fpga,node_jtag,node_uart,node_bsp,node_sim_runner,node_spike_trace toneAmber
class node_bootrom,node_sd,node_gpt toneMint
class node_engineer,node_host toneIndigo
```

## Components

### QOA workloads

- [QOA encoder app](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/main.c): `sw/app/qoa_encoder/main.c`
- [QOA implementation](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/qoa.h): `sw/app/qoa_encoder/qoa.h`
- [Audio corpus](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/corpus.h): `sw/app/qoa_encoder/corpus.h`
- [Golden stream](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder/golden.h): `sw/app/qoa_encoder/golden.h`
- [One-second app](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder_1s/main.c): `sw/app/qoa_encoder_1s/main.c`
- [Short corpus](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder_1s/corpus.h): `sw/app/qoa_encoder_1s/corpus.h`
- [Short reference](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/app/qoa_encoder_1s/golden.h): `sw/app/qoa_encoder_1s/golden.h`

### FPGA platform

- [Zybo CV32A6](https://github.com/thalesgroup/cva6-softcore-contest/tree/cv32a6_contest_26_27/corev_apu/fpga): `corev_apu/fpga`
- [JTAG debug link](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/tb/dpi/remote_bitbang.cc): `corev_apu/tb/dpi/remote_bitbang.cc`
- [UART console](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/sw/bsp/drivers/uart/uart.c): `sw/bsp/drivers/uart/uart.c`
- [Software BSP](https://github.com/thalesgroup/cva6-softcore-contest/tree/cv32a6_contest_26_27/sw/bsp): `sw/bsp`
- [Simulation runner](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/verif/sim/cva6.py): `verif/sim/cva6.py`
- [Spike trace parser](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/verif/sim/cva6_spike_log_to_trace_csv.py): `verif/sim/cva6_spike_log_to_trace_csv.py`

### Boot support

- [FPGA boot ROM](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/fpga/src/bootrom/src/main.c): `corev_apu/fpga/src/bootrom/src/main.c`
- [SD access](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/fpga/src/bootrom/src/sd.c): `corev_apu/fpga/src/bootrom/src/sd.c`
- [Partition lookup](https://github.com/thalesgroup/cva6-softcore-contest/blob/cv32a6_contest_26_27/corev_apu/fpga/src/bootrom/src/gpt.c): `corev_apu/fpga/src/bootrom/src/gpt.c`

### Other components

- **Contest engineer**
- **Development host**

## Connections

- QOA encoder app → QOA implementation: calls encoder (evidence: `sw/app/qoa_encoder/main.c`)
- QOA encoder app → Audio corpus: encodes samples (evidence: `sw/app/qoa_encoder/main.c`)
- QOA encoder app → Golden stream: checks output (evidence: `sw/app/qoa_encoder/main.c`)
- One-second app → Short corpus: encodes samples (evidence: `sw/app/qoa_encoder_1s/main.c`)
- One-second app → Short reference: checks output (evidence: `sw/app/qoa_encoder_1s/main.c`)
- One-second app → QOA implementation: uses encoder (evidence: `sw/app/qoa_encoder_1s/main.c`)
- Contest engineer → Development host: builds application (evidence: `README.md`)
- Development host → JTAG debug link: connects through (evidence: `README.md`)
- JTAG debug link → Zybo CV32A6: programs and debugs (evidence: `README.md`)
- QOA encoder app → Zybo CV32A6: runs on (evidence: `README.md`)
- Zybo CV32A6 → UART console: outputs console (evidence: `README.md`)
- QOA encoder app → Software BSP: uses platform support
- FPGA boot ROM → UART console: initializes and prints (evidence: `corev_apu/fpga/src/bootrom/src/main.c`)
- FPGA boot ROM → Partition lookup: partition lookup
- Partition lookup → SD access: reads partition data
- Contest engineer → Simulation runner: runs simulations (evidence: `README.md`)
- Simulation runner → Spike trace parser: converts trace logs (evidence: `verif/sim/cva6.py`)
