# aaaaa-ozo23/gem5 architecture

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

- Interactive diagram: https://gitdiagram.com/aaaaa-ozo23/gem5
- Repository: https://github.com/aaaaa-ozo23/gem5

## Overview

gem5 is a modular computer-system simulator for architecture research. A user configures a simulated machine and workload, gem5 instantiates and runs its CPU, memory, and device models, and statistics provide results for evaluation. The graph includes documented system- and microarchitecture capabilities, plus resource retrieval and power-analysis integrations. Sampled source confirms selected CPU, GPU-memory, DMA, configuration, and statistics behavior; unsampled subsystem connections are shown only where supported by the README or repository layout.

Main entry points: [`src`](https://github.com/aaaaa-ozo23/gem5/tree/stable/src) (System models), [`src/base/stats/storage.cc`](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/base/stats/storage.cc) (Statistics collection), [`configs/common/Simulation.py`](https://github.com/aaaaa-ozo23/gem5/blob/stable/configs/common/Simulation.py) (Machine configuration), [`src/sim`](https://github.com/aaaaa-ozo23/gem5/tree/stable/src/sim) (Simulation runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Configuration"]
  node_configs["Machine configuration<br/>[Simulation.py]"]
end

subgraph group_simulation["Simulation models"]
  node_cpu["CPU pipeline<br/>[pipeline.cc]"]
  node_memory["Memory system<br/>[TBEStorage.cc]"]
  node_gpu["GPU memory pipelines"]
  node_dma["DMA devices<br/>[copy_engine.cc]"]
  node_simulator["Simulation runtime"]
  node_system["System models"]
end

subgraph group_integration["Integrations"]
  node_resource_query["Resource query<br/>[client_query.py]"]
end

subgraph group_results["Results"]
  node_stats["Statistics collection<br/>[storage.cc]"]
  node_python_stats["Python statistics<br/>[storagetype.py]"]
  node_power["Power estimation<br/>[iocontrollers.cc]"]
end

node_researcher(("Researcher"))
node_resource_service["gem5 Resources"]
node_results_user(("Research results"))

node_researcher -->|"defines system"| node_configs
node_configs -->|"configures runtime"| node_simulator
node_simulator -->|"runs models"| node_system
node_system -->|"models processing"| node_cpu
node_system -->|"models memory"| node_memory
node_system -->|"models GPU"| node_gpu
node_system -->|"models transfers"| node_dma
node_simulator -->|"records statistics"| node_stats
node_stats -->|"exposes types"| node_python_stats
node_stats -->|"provides results"| node_results_user
node_stats -.->|"supports estimation"| node_power
node_configs -.->|"requests resources"| node_resource_query
node_resource_query -.->|"queries resources"| node_resource_service

click node_configs "https://github.com/aaaaa-ozo23/gem5/blob/stable/configs/common/Simulation.py"
click node_cpu "https://github.com/aaaaa-ozo23/gem5/blob/stable/src/cpu/minor/pipeline.cc"
click node_memory "https://github.com/aaaaa-ozo23/gem5/blob/stable/src/mem/ruby/structures/TBEStorage.cc"
click node_gpu "https://github.com/aaaaa-ozo23/gem5/blob/stable/src/gpu-compute/global_memory_pipeline.cc"
click node_dma "https://github.com/aaaaa-ozo23/gem5/blob/stable/src/dev/pci/copy_engine.cc"
click node_simulator "https://github.com/aaaaa-ozo23/gem5/tree/stable/src/sim"
click node_system "https://github.com/aaaaa-ozo23/gem5/tree/stable/src"
click node_stats "https://github.com/aaaaa-ozo23/gem5/blob/stable/src/base/stats/storage.cc"
click node_python_stats "https://github.com/aaaaa-ozo23/gem5/blob/stable/src/python/m5/ext/pystats/storagetype.py"
click node_power "https://github.com/aaaaa-ozo23/gem5/blob/stable/ext/mcpat/iocontrollers.cc"
click node_resource_query "https://github.com/aaaaa-ozo23/gem5/blob/stable/src/python/gem5/resources/client_api/client_query.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_configs toneBlue
class node_cpu,node_memory,node_gpu,node_dma,node_simulator,node_system toneAmber
class node_resource_query toneMint
class node_stats,node_python_stats,node_power toneRose
class node_researcher,node_resource_service,node_results_user toneIndigo
```

## Components

### Configuration

- [Machine configuration](https://github.com/aaaaa-ozo23/gem5/blob/stable/configs/common/Simulation.py): `configs/common/Simulation.py`

### Simulation models

- [CPU pipeline](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/cpu/minor/pipeline.cc): `src/cpu/minor/pipeline.cc`
- [Memory system](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/mem/ruby/structures/TBEStorage.cc): `src/mem/ruby/structures/TBEStorage.cc`
- [GPU memory pipelines](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/gpu-compute/global_memory_pipeline.cc): `src/gpu-compute/global_memory_pipeline.cc`
- [DMA devices](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/dev/pci/copy_engine.cc): `src/dev/pci/copy_engine.cc`
- [Simulation runtime](https://github.com/aaaaa-ozo23/gem5/tree/stable/src/sim): `src/sim`
- [System models](https://github.com/aaaaa-ozo23/gem5/tree/stable/src): `src`

### Integrations

- [Resource query](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/python/gem5/resources/client_api/client_query.py): `src/python/gem5/resources/client_api/client_query.py`

### Results

- [Statistics collection](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/base/stats/storage.cc): `src/base/stats/storage.cc`
- [Python statistics](https://github.com/aaaaa-ozo23/gem5/blob/stable/src/python/m5/ext/pystats/storagetype.py): `src/python/m5/ext/pystats/storagetype.py`
- [Power estimation](https://github.com/aaaaa-ozo23/gem5/blob/stable/ext/mcpat/iocontrollers.cc): `ext/mcpat/iocontrollers.cc`

### Other components

- **Researcher**
- **gem5 Resources**
- **Research results**

## Connections

- Researcher → Machine configuration: defines system
- Machine configuration → Simulation runtime: configures runtime
- Simulation runtime → System models: runs models
- System models → CPU pipeline: models processing
- System models → Memory system: models memory
- System models → GPU memory pipelines: models GPU
- System models → DMA devices: models transfers
- Simulation runtime → Statistics collection: records statistics
- Statistics collection → Python statistics: exposes types
- Statistics collection → Research results: provides results
- Statistics collection → Power estimation: supports estimation
- Machine configuration → Resource query: requests resources
- Resource query → gem5 Resources: queries resources
