# xarc/harv architecture

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

- Interactive diagram: https://gitdiagram.com/xarc/harv
- Repository: https://github.com/xarc/harv

## Overview

HARV is a fault-tolerant RISC-V processor core implementing RV32I integer instructions, with system calls excluded. Its documented reliability approach uses Triple-Modular Redundancy (TMR) and Hamming coding to mitigate or correct single-event effects. The tree identifies processor, execution, control, and fault-tolerance modules, but no source excerpts were provided; therefore, internal call and data-flow relationships cannot be verified. The README supports only the core’s ISA scope and its use of both reliability techniques.

Main entry points: [`hdl/harv.vhd`](https://github.com/xarc/harv/blob/main/hdl/harv.vhd) (HARV core)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Processor core"]
  node_harv["HARV core<br/>[harv.vhd]"]
  node_alu["ALU<br/>[alu.vhd]"]
  node_control["Control<br/>[control.vhd]"]
  node_csr["CSR<br/>[csr.vhd]"]
  node_fetch["Instruction fetch<br/>[instr_fetch.vhd]"]
  node_regfile["Register file<br/>[regfile.vhd]"]
end

subgraph group_ft["Fault tolerance"]
  node_alu_tmr["TMR ALU<br/>[alu_tmr.vhd]"]
  node_control_tmr["TMR control<br/>[control_tmr.vhd]"]
  node_hamming_encoder["Hamming encoder"]
  node_hamming_decoder["Hamming decoder"]
  node_hamming_register["Hamming register"]
end

subgraph group_shared["Shared definitions"]
  node_harv_pkg["HARV definitions<br/>[harv_pkg.vhd]"]
  node_hamming_pkg["Hamming definitions<br/>[hamming_pkg.vhd]"]
end

node_rv32i["RV32I integer ISA"]
node_tmr["TMR resilience"]
node_hamming["Hamming resilience"]

node_harv -->|"implements"| node_rv32i
node_harv -->|"uses"| node_tmr
node_harv -->|"uses"| node_hamming

click node_harv "https://github.com/xarc/harv/blob/main/hdl/harv.vhd"
click node_alu "https://github.com/xarc/harv/blob/main/hdl/alu.vhd"
click node_control "https://github.com/xarc/harv/blob/main/hdl/control.vhd"
click node_csr "https://github.com/xarc/harv/blob/main/hdl/csr.vhd"
click node_fetch "https://github.com/xarc/harv/blob/main/hdl/instr_fetch.vhd"
click node_regfile "https://github.com/xarc/harv/blob/main/hdl/regfile.vhd"
click node_alu_tmr "https://github.com/xarc/harv/blob/main/hdl/ft_components/alu_tmr.vhd"
click node_control_tmr "https://github.com/xarc/harv/blob/main/hdl/ft_components/control_tmr.vhd"
click node_hamming_encoder "https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_encoder.vhd"
click node_hamming_decoder "https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_decoder.vhd"
click node_hamming_register "https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_register.vhd"
click node_harv_pkg "https://github.com/xarc/harv/blob/main/hdl/harv_pkg.vhd"
click node_hamming_pkg "https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_pkg.vhd"

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_harv,node_alu,node_control,node_csr,node_fetch,node_regfile toneBlue
class node_alu_tmr,node_control_tmr,node_hamming_encoder,node_hamming_decoder,node_hamming_register toneAmber
class node_harv_pkg,node_hamming_pkg toneMint
class node_rv32i,node_tmr,node_hamming toneIndigo
```

## Components

### Processor core

- [HARV core](https://github.com/xarc/harv/blob/main/hdl/harv.vhd): `hdl/harv.vhd`
- [ALU](https://github.com/xarc/harv/blob/main/hdl/alu.vhd): `hdl/alu.vhd`
- [Control](https://github.com/xarc/harv/blob/main/hdl/control.vhd): `hdl/control.vhd`
- [CSR](https://github.com/xarc/harv/blob/main/hdl/csr.vhd): `hdl/csr.vhd`
- [Instruction fetch](https://github.com/xarc/harv/blob/main/hdl/instr_fetch.vhd): `hdl/instr_fetch.vhd`
- [Register file](https://github.com/xarc/harv/blob/main/hdl/regfile.vhd): `hdl/regfile.vhd`

### Fault tolerance

- [TMR ALU](https://github.com/xarc/harv/blob/main/hdl/ft_components/alu_tmr.vhd): `hdl/ft_components/alu_tmr.vhd`
- [TMR control](https://github.com/xarc/harv/blob/main/hdl/ft_components/control_tmr.vhd): `hdl/ft_components/control_tmr.vhd`
- [Hamming encoder](https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_encoder.vhd): `hdl/ft_components/hamming_encoder.vhd`
- [Hamming decoder](https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_decoder.vhd): `hdl/ft_components/hamming_decoder.vhd`
- [Hamming register](https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_register.vhd): `hdl/ft_components/hamming_register.vhd`

### Shared definitions

- [HARV definitions](https://github.com/xarc/harv/blob/main/hdl/harv_pkg.vhd): `hdl/harv_pkg.vhd`
- [Hamming definitions](https://github.com/xarc/harv/blob/main/hdl/ft_components/hamming_pkg.vhd): `hdl/ft_components/hamming_pkg.vhd`

### Other components

- **RV32I integer ISA**
- **TMR resilience**
- **Hamming resilience**

## Connections

- HARV core → RV32I integer ISA: implements (evidence: `README.md`)
- HARV core → TMR resilience: uses (evidence: `README.md`)
- HARV core → Hamming resilience: uses (evidence: `README.md`)
