# simplessd/simplessd-standalone architecture

> Architecture diagram of the GitHub repository simplessd/simplessd-standalone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/simplessd/simplessd-standalone
- Repository: https://github.com/simplessd/simplessd-standalone

## Overview

##### Project type and purpose
- SimpleSSD v2.0 is an educational SSD simulator (a command-line, full-system evaluation tool), not a web app or database system. It simulates SSD controller logic, NAND interfaces, DRAM power modeling, and traces/generators for I/O workloads.
- The README confirms that it is an “Open-Source Licensed Educational SSD Simulator for High-Performance Storage and Full-System Evaluations.”

##### File structure
- Top-level directories:
- bil/            – Bus Interface Layer (entry points, schedulers)
- igl/            – I/O Generator Layer (request and trace generators and replayers)
- sil/            – Storage Interface Layer (device-level simulation: none or NVMe)
- sim/            – Core simulation engine (config reader, engine, signals, main)
- lib/drampower/  – DRAM Power modeling library and its tests
- util/           – helper utilities (time measurement, printing, conversions)
- config/         – sample configuration file(s)
- Build system: CMakeLists.txt at the root configures all modules.
- No GUI or network-facing code—pure compute/simulation.

##### README for additional insights
- No deeper architecture section, but description implies modular layers for bus, I/O, storage device, and DRAM power modeling.
- Libraries and test directories reinforce the layering.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Configuration Layer
    subgraph "Configuration" 
        CFG1["global_config"]:::sim
        CFG2["cfg_reader"]:::sim
        CFG3["sample.cfg"]:::sim
    end

    %% Simulation Engine Layer
    subgraph "Simulation Engine"
        MAIN["main"]:::sim
        ENG["Engine"]:::sim
        SIG["Signal"]:::sim
    end

    %% I/O Generator Layer
    subgraph "I/O Generator (IGL)"
        IO_GEN["io_gen"]:::igl
        REQ_GEN["request_generator"]:::igl
        REQ_CFG["request_config"]:::igl
        TRACE_REP["trace_replayer"]:::igl
        TRACE_CFG["trace_config"]:::igl
    end

    %% Bus Interface Layer
    subgraph "Bus Interface Layer (BIL)"
        ENTRY["entry"]:::bil
        SCH["scheduler"]:::bil
        NOOP["noop_scheduler"]:::bil
        IFACE["interface"]:::bil
    end

    %% Storage Interface Layer
    subgraph "Storage Interface Layer (SIL)"
        NONE["none"]:::sil
        NVME["nvme"]:::sil
        PRP["prp"]:::sil
        QUEUE["queue"]:::sil
    end

    %% DRAM Power Model
    subgraph "DRAM Power Model (libdrampower)"
        POWER["MemoryPowerModel & libs"]:::ext
    end

    %% Utilities
    subgraph "Utilities"
        CONV["convert"]:::utils
        PRINT["print"]:::utils
        SW["stopwatch"]:::utils
    end

    %% Build System
    CMAKE["CMakeLists.txt"]:::ext

    %% Data Flows
    MAIN -->|load config| CFG2
    CFG2 -->|read file| CFG3
    CFG2 -->|config data| ENG
    ENG -->|invoke I/O| IO_GEN
    IO_GEN -->|SSD_Request| ENTRY
    ENTRY -->|schedule| SCH
    SCH -->|use scheduler| NOOP
    SCH -->|to interface| IFACE
    IFACE -->|to stub| NONE
    IFACE -->|to NVMe| NVME
    NVME -->|PRP ops| PRP
    NVME -->|queue ops| QUEUE
    NVME -->|Completion Event| ENTRY
    ENTRY -->|response| ENG
    ENG -->|power query| POWER

    %% Utility Usage
    MAIN -->|logging| PRINT
    ENG -->|timing| SW
    IO_GEN -->|convert data| CONV

    %% Build Orchestration
    CMAKE --> CFG1
    CMAKE --> CFG2
    CMAKE --> CFG3
    CMAKE --> MAIN
    CMAKE --> ENG
    CMAKE --> SIG
    CMAKE --> IO_GEN
    CMAKE --> REQ_GEN
    CMAKE --> REQ_CFG
    CMAKE --> TRACE_REP
    CMAKE --> TRACE_CFG
    CMAKE --> ENTRY
    CMAKE --> SCH
    CMAKE --> NOOP
    CMAKE --> IFACE
    CMAKE --> NONE
    CMAKE --> NVME
    CMAKE --> PRP
    CMAKE --> QUEUE
    CMAKE --> POWER
    CMAKE --> CONV
    CMAKE --> PRINT
    CMAKE --> SW

    %% Click Events
    click CFG1 "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/global_config.hh"
    click CFG1 "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/global_config.cc"
    click CFG2 "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/cfg_reader.hh"
    click CFG2 "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/cfg_reader.cc"
    click CFG3 "https://github.com/simplessd/simplessd-standalone/blob/2.0/config/sample.cfg"
    click MAIN "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/main.cc"
    click ENG "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/engine.hh"
    click ENG "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/engine.cc"
    click SIG "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/signal.hh"
    click SIG "https://github.com/simplessd/simplessd-standalone/blob/2.0/sim/signal.cc"
    click ENTRY "https://github.com/simplessd/simplessd-standalone/blob/2.0/bil/entry.hh"
    click ENTRY "https://github.com/simplessd/simplessd-standalone/blob/2.0/bil/entry.cc"
    click SCH "https://github.com/simplessd/simplessd-standalone/blob/2.0/bil/scheduler.hh"
    click NOOP "https://github.com/simplessd/simplessd-standalone/blob/2.0/bil/noop_scheduler.hh"
    click NOOP "https://github.com/simplessd/simplessd-standalone/blob/2.0/bil/noop_scheduler.cc"
    click IFACE "https://github.com/simplessd/simplessd-standalone/blob/2.0/bil/interface.hh"
    click IO_GEN "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/io_gen.hh"
    click REQ_GEN "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/request/request_generator.hh"
    click REQ_GEN "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/request/request_generator.cc"
    click REQ_CFG "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/request/request_config.hh"
    click REQ_CFG "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/request/request_config.cc"
    click TRACE_REP "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/trace/trace_replayer.hh"
    click TRACE_REP "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/trace/trace_replayer.cc"
    click TRACE_CFG "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/trace/trace_config.hh"
    click TRACE_CFG "https://github.com/simplessd/simplessd-standalone/blob/2.0/igl/trace/trace_config.cc"
    click NONE "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/none/none.hh"
    click NONE "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/none/none.cc"
    click NVME "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/nvme/nvme.hh"
    click NVME "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/nvme/nvme.cc"
    click PRP "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/nvme/prp.hh"
    click PRP "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/nvme/prp.cc"
    click QUEUE "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/nvme/queue.hh"
    click QUEUE "https://github.com/simplessd/simplessd-standalone/blob/2.0/sil/nvme/queue.cc"
    click POWER "https://github.com/simplessd/simplessd-standalone/blob/2.0/lib/drampower/src/MemoryPowerModel.h"
    click POWER "https://github.com/simplessd/simplessd-standalone/blob/2.0/lib/drampower/src/MemoryPowerModel.cc"
    click CONV "https://github.com/simplessd/simplessd-standalone/blob/2.0/util/convert.hh"
    click CONV "https://github.com/simplessd/simplessd-standalone/blob/2.0/util/convert.cc"
    click PRINT "https://github.com/simplessd/simplessd-standalone/blob/2.0/util/print.hh"
    click PRINT "https://github.com/simplessd/simplessd-standalone/blob/2.0/util/print.cc"
    click SW "https://github.com/simplessd/simplessd-standalone/blob/2.0/util/stopwatch.hh"
    click SW "https://github.com/simplessd/simplessd-standalone/blob/2.0/util/stopwatch.cc"

    %% Styles
    classDef sim fill:#D8BFD8,stroke:#9370DB,color:#000
    classDef igl fill:#98FB98,stroke:#2E8B57,color:#000
    classDef bil fill:#ADD8E6,stroke:#1E90FF,color:#000
    classDef sil fill:#FFDAB9,stroke:#FF8C00,color:#000
    classDef utils fill:#D3D3D3,stroke:#A9A9A9,color:#000
    classDef ext fill:#F5F5F5,stroke:#696969,color:#000,stroke-dasharray: 5 5
```
