# kanishkm08/gem5_hds-kvm architecture

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

- Interactive diagram: https://gitdiagram.com/kanishkm08/gem5_hds-kvm
- Repository: https://github.com/kanishkm08/gem5_hds-kvm

## Overview

gem5 is a configurable computer-system simulator. The documented workflow is to configure and launch a full-system simulation, optionally using KVM before switching to a timing CPU, then inspect the guest’s serial output. The graph also preserves the documented Ruby/network setup and major configuration/runtime layers. Some configuration and simulator internals were not excerpted; edges for documented workflow steps cite the README, and internal links use SOURCE INDEX references rather than assumptions about unsampled code.

Main entry points: [`gem5-23.0.0.1/configs/common/Simulation.py`](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/Simulation.py) (Run configuration), [`gem5-23.0.0.1/configs/common/FileSystemConfig.py`](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/FileSystemConfig.py) (Full-system setup), [`gem5-23.0.0.1/configs/common/MemConfig.py`](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/MemConfig.py) (Memory setup), [`gem5-23.0.0.1/configs/common/ObjectList.py`](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/ObjectList.py) (Object registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Simulation configuration"]
  node_sim_config["Run configuration<br/>[Simulation.py]"]
  node_fs_config["Full-system setup"]
  node_memory_config["Memory setup<br/>[MemConfig.py]"]
  node_object_list["Object registry<br/>[ObjectList.py]"]
  node_ruby_config["Ruby coherence<br/>[Ruby.py]"]
  node_topology["Network topology<br/>[BaseTopology.py]"]
end

subgraph group_runtime["Simulator runtime"]
  node_params["Parameter system<br/>[params.py]"]
  node_simobjects["SimObject model<br/>[SimObject.py]"]
  node_runtime_api["Runtime API<br/>[runtime.py]"]
  node_stats["Statistics storage<br/>[storage.cc]"]
end

subgraph group_models["System models"]
  node_minor_cpu["Minor CPU pipeline<br/>[pipeline.cc]"]
  node_gpu_memory["GPU memory pipeline"]
  node_sdma["GPU SDMA engine<br/>[sdma_engine.cc]"]
  node_pci_copy["PCI copy engine<br/>[copy_engine.cc]"]
end

subgraph group_interfaces["Guest and host interfaces"]
  node_kvm["KVM acceleration"]
  node_guest["Guest system"]
  node_terminal["Serial terminal"]
end

node_user(("Simulation user"))

node_user -->|"configures and launches"| node_sim_config
node_sim_config -.->|"configures guest"| node_fs_config
node_sim_config -.->|"configures memory"| node_memory_config
node_sim_config -->|"selects Ruby"| node_ruby_config
node_sim_config -->|"selects topology"| node_topology
node_memory_config -->|"uses registry"| node_object_list
node_object_list -->|"queries runtime"| node_runtime_api
node_fs_config -->|"configures objects"| node_simobjects
node_sim_config -->|"enables acceleration"| node_kvm
node_sim_config -->|"switches to timing CPU"| node_minor_cpu
node_sim_config -->|"starts full-system run"| node_guest
node_guest -->|"emits serial output"| node_terminal
node_user -->|"connects to port"| node_terminal

click node_sim_config "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/Simulation.py"
click node_fs_config "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/FileSystemConfig.py"
click node_memory_config "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/MemConfig.py"
click node_object_list "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/ObjectList.py"
click node_ruby_config "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/ruby/Ruby.py"
click node_topology "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/topologies/BaseTopology.py"
click node_params "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/python/m5/params.py"
click node_simobjects "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/python/m5/SimObject.py"
click node_runtime_api "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/python/gem5/runtime.py"
click node_minor_cpu "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/cpu/minor/pipeline.cc"
click node_gpu_memory "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/gpu-compute/global_memory_pipeline.cc"
click node_sdma "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/dev/amdgpu/sdma_engine.cc"
click node_pci_copy "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/dev/pci/copy_engine.cc"
click node_stats "https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/base/stats/storage.cc"

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_sim_config,node_fs_config,node_memory_config,node_object_list,node_ruby_config,node_topology,node_user toneBlue
class node_params,node_simobjects,node_runtime_api,node_stats toneAmber
class node_minor_cpu,node_gpu_memory,node_sdma,node_pci_copy toneMint
class node_kvm,node_guest,node_terminal toneRose
```

## Components

### Simulation configuration

- [Run configuration](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/Simulation.py): `gem5-23.0.0.1/configs/common/Simulation.py`
- [Full-system setup](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/FileSystemConfig.py): `gem5-23.0.0.1/configs/common/FileSystemConfig.py`
- [Memory setup](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/MemConfig.py): `gem5-23.0.0.1/configs/common/MemConfig.py`
- [Object registry](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/common/ObjectList.py): `gem5-23.0.0.1/configs/common/ObjectList.py`
- [Ruby coherence](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/ruby/Ruby.py): `gem5-23.0.0.1/configs/ruby/Ruby.py`
- [Network topology](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/configs/topologies/BaseTopology.py): `gem5-23.0.0.1/configs/topologies/BaseTopology.py`

### Simulator runtime

- [Parameter system](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/python/m5/params.py): `gem5-23.0.0.1/src/python/m5/params.py`
- [SimObject model](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/python/m5/SimObject.py): `gem5-23.0.0.1/src/python/m5/SimObject.py`
- [Runtime API](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/python/gem5/runtime.py): `gem5-23.0.0.1/src/python/gem5/runtime.py`
- [Statistics storage](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/base/stats/storage.cc): `gem5-23.0.0.1/src/base/stats/storage.cc`

### System models

- [Minor CPU pipeline](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/cpu/minor/pipeline.cc): `gem5-23.0.0.1/src/cpu/minor/pipeline.cc`
- [GPU memory pipeline](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/gpu-compute/global_memory_pipeline.cc): `gem5-23.0.0.1/src/gpu-compute/global_memory_pipeline.cc`
- [GPU SDMA engine](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/dev/amdgpu/sdma_engine.cc): `gem5-23.0.0.1/src/dev/amdgpu/sdma_engine.cc`
- [PCI copy engine](https://github.com/kanishkm08/gem5_hds-kvm/blob/main/gem5-23.0.0.1/src/dev/pci/copy_engine.cc): `gem5-23.0.0.1/src/dev/pci/copy_engine.cc`

### Guest and host interfaces

- **KVM acceleration**
- **Guest system**
- **Serial terminal**

### Other components

- **Simulation user**

## Connections

- Simulation user → Run configuration: configures and launches
- Run configuration → Full-system setup: configures guest
- Run configuration → Memory setup: configures memory
- Run configuration → Ruby coherence: selects Ruby
- Run configuration → Network topology: selects topology
- Memory setup → Object registry: uses registry (evidence: `gem5-23.0.0.1/configs/common/MemConfig.py`)
- Object registry → Runtime API: queries runtime (evidence: `gem5-23.0.0.1/configs/common/ObjectList.py`)
- Full-system setup → SimObject model: configures objects (evidence: `gem5-23.0.0.1/configs/common/FileSystemConfig.py`)
- Run configuration → KVM acceleration: enables acceleration
- Run configuration → Minor CPU pipeline: switches to timing CPU
- Run configuration → Guest system: starts full-system run
- Guest system → Serial terminal: emits serial output
- Simulation user → Serial terminal: connects to port
