# asiggel/rwu-rv64iv2.0 architecture

> Architecture diagram of the GitHub repository asiggel/rwu-rv64iv2.0, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asiggel/rwu-rv64iv2.0
- Repository: https://github.com/asiggel/rwu-rv64iv2.0

## Overview

This repository contains RWU-RV, an RV64I processor design and related hardware IP. The README’s principal workflow is running a single-cycle core simulation against programs, with instruction/data memory and a GPIP peripheral. The tree also documents a pipelined cache/forwarding variant and shared peripherals, but the supplied excerpts do not expose their RTL wiring. The graph therefore captures the documented single-cycle behavior and testing path while leaving internal hardware connections unasserted; sampled trap-test code is test infrastructure, not a runtime product stage.

Main entry points: [`RWU_RV/RV_PipelineCacheFwd/src`](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/RWU_RV/RV_PipelineCacheFwd/src) (Pipelined cache variant), [`RWU_RV/RV_NoPipeline/cocotb/trap_tests.py`](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/cocotb/trap_tests.py) (Directed trap tests), [`RWU_RV/RV_NoPipeline/sim/sim_main.cpp`](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/sim/sim_main.cpp) (Simulation entry), [`RWU_RV/RV_NoPipeline/src/asCPUx.sv`](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asCPUx.sv) (Single-cycle CPU)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["RV64I Core"]
  node_single["Single-cycle CPU<br/>[asCPUx.sv]"]
  node_decode["Instruction decode<br/>[asInstrDecode.sv]"]
  node_alu["ALU and branch<br/>[asAlu.sv]"]
  node_regs["Register file<br/>[asRegFile.sv]"]
  node_trapcsr["Trap and CSR IP"]
  node_pipeline["Pipelined cache variant"]
end

subgraph group_memory["Memory and Peripherals"]
  node_imem[("Instruction memory<br/>[asIMem.sv]")]
  node_dmem[("Data memory")]
  node_gpio["GPIP peripheral"]
  node_cache["Instruction/data caches"]
  node_memorysystem["Memory system IP"]
  node_qspi["QSPI peripheral"]
  node_uart["UART peripheral"]
end

subgraph group_verification["Verification"]
  node_cocotb["Directed trap tests<br/>[trap_tests.py]"]
  node_encoder["RV instruction encoder<br/>[rvenc.py]"]
  node_iss["Instruction-set model<br/>[iss.py]"]
  node_programs["Simulation programs"]
  node_runner["Simulation entry<br/>[sim_main.cpp]"]
end

node_engineer(("Engineer"))

node_engineer -->|"runs simulation"| node_runner
node_runner -.->|"executes tests"| node_programs
node_engineer -.->|"runs trap checks"| node_cocotb
node_cocotb -->|"encodes instructions"| node_encoder
node_cocotb -->|"checks traps"| node_single
node_cocotb -->|"checks CSRs"| node_trapcsr
node_pipeline -.->|"uses caches"| node_cache
node_pipeline -.->|"uses memory IP"| node_memorysystem
node_pipeline -.->|"supports QSPI"| node_qspi
node_pipeline -.->|"supports UART"| node_uart

click node_single "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asCPUx.sv"
click node_decode "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asInstrDecode.sv"
click node_alu "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asAlu.sv"
click node_regs "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asRegFile.sv"
click node_imem "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asIMem.sv"
click node_dmem "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_dmem/src"
click node_gpio "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_gpio/src"
click node_trapcsr "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_trapcsr/src"
click node_cocotb "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/cocotb/trap_tests.py"
click node_encoder "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/cocotb/rvenc.py"
click node_iss "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/cocotb/iss.py"
click node_programs "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/RWU_RV/RV_NoPipeline/rv64Sim"
click node_runner "https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/sim/sim_main.cpp"
click node_pipeline "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/RWU_RV/RV_PipelineCacheFwd/src"
click node_cache "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_icache/src"
click node_memorysystem "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_memsyst/src"
click node_qspi "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_qspi/src"
click node_uart "https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_uart/src"

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_single,node_decode,node_alu,node_regs,node_trapcsr,node_pipeline toneBlue
class node_imem,node_dmem,node_gpio,node_cache,node_memorysystem,node_qspi,node_uart toneAmber
class node_cocotb,node_encoder,node_iss,node_programs,node_runner toneMint
class node_engineer toneIndigo
```

## Components

### RV64I Core

- [Single-cycle CPU](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asCPUx.sv): `RWU_RV/RV_NoPipeline/src/asCPUx.sv`
- [Instruction decode](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asInstrDecode.sv): `RWU_RV/RV_NoPipeline/src/asInstrDecode.sv`
- [ALU and branch](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asAlu.sv): `RWU_RV/RV_NoPipeline/src/asAlu.sv`
- [Register file](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asRegFile.sv): `RWU_RV/RV_NoPipeline/src/asRegFile.sv`
- [Trap and CSR IP](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_trapcsr/src): `ip_trapcsr/src`
- [Pipelined cache variant](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/RWU_RV/RV_PipelineCacheFwd/src): `RWU_RV/RV_PipelineCacheFwd/src`

### Memory and Peripherals

- [Instruction memory](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/src/asIMem.sv): `RWU_RV/RV_NoPipeline/src/asIMem.sv`
- [Data memory](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_dmem/src): `ip_dmem/src`
- [GPIP peripheral](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_gpio/src): `ip_gpio/src`
- [Instruction/data caches](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_icache/src): `ip_icache/src`
- [Memory system IP](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_memsyst/src): `ip_memsyst/src`
- [QSPI peripheral](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_qspi/src): `ip_qspi/src`
- [UART peripheral](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/ip_uart/src): `ip_uart/src`

### Verification

- [Directed trap tests](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/cocotb/trap_tests.py): `RWU_RV/RV_NoPipeline/cocotb/trap_tests.py`
- [RV instruction encoder](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/cocotb/rvenc.py): `RWU_RV/RV_NoPipeline/cocotb/rvenc.py`
- [Instruction-set model](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/cocotb/iss.py): `RWU_RV/RV_NoPipeline/cocotb/iss.py`
- [Simulation programs](https://github.com/asiggel/rwu-rv64iv2.0/tree/main/RWU_RV/RV_NoPipeline/rv64Sim): `RWU_RV/RV_NoPipeline/rv64Sim`
- [Simulation entry](https://github.com/asiggel/rwu-rv64iv2.0/blob/main/RWU_RV/RV_NoPipeline/sim/sim_main.cpp): `RWU_RV/RV_NoPipeline/sim/sim_main.cpp`

### Other components

- **Engineer**

## Connections

- Engineer → Simulation entry: runs simulation (evidence: `README.md`)
- Simulation entry → Simulation programs: executes tests
- Engineer → Directed trap tests: runs trap checks
- Directed trap tests → RV instruction encoder: encodes instructions (evidence: `RWU_RV/RV_NoPipeline/cocotb/trap_tests.py`)
- Directed trap tests → Single-cycle CPU: checks traps (evidence: `RWU_RV/RV_NoPipeline/cocotb/trap_tests.py`)
- Directed trap tests → Trap and CSR IP: checks CSRs (evidence: `RWU_RV/RV_NoPipeline/cocotb/trap_tests.py`)
- Pipelined cache variant → Instruction/data caches: uses caches
- Pipelined cache variant → Memory system IP: uses memory IP
- Pipelined cache variant → QSPI peripheral: supports QSPI
- Pipelined cache variant → UART peripheral: supports UART
