# set-scheduling-project/gemini-hpca2024 architecture

> Architecture diagram of the GitHub repository set-scheduling-project/gemini-hpca2024, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/set-scheduling-project/gemini-hpca2024
- Repository: https://github.com/set-scheduling-project/gemini-hpca2024

## Overview

##### Project type and purpose
- This is a research-grade command-line tool (Gemini) for design-space exploration (DSE) of large-scale DNN chiplet accelerators.
- It is implemented in C++ (core mapping engine) with Python orchestration scripts for batch DSE and result post-processing.
- It reads front-end IRs (JSON descriptions of DNNs), explores mapping/partition/placement/spatial-mapping strategies, computes cost models, and outputs performance/cost results.

##### File structure
- Top-level:
- `.sh` scripts (e.g., `72tops_dse13.sh`): orchestrate parameter sweeps.
- `makefile`: builds the C++ binary.
- `src/`, `include/`: core engine sources and headers.
- `src/front_end_IRs/`: sample DNN JSON models (e.g., SSD, VGG16).
- `pyscripts/`: Python utilities for converting logs to CSV/XLSX and for “best architecture” selection.
- Key modules under `include/` & `src/`:
- IR parsing (`json/`, `front_end_IRs`)
- Network definitions (`nns/`)
- Core mapping (`coremapping`), clustering (`cluster`), data-layout (`datalayout`)
- Partitioning, placement, spatial mapping (`spatial_mapping/DP`, `light_placement`, `segmentation`)
- Cost modeling (`cost`, `bufferusage`, packaging cost via references)
- NoC modeling (`noc`)
- Main driver (`main.cpp`)
- Configuration/inputs: JSON IRs, `.sh` DSE scripts, Python `requirements.txt`.

##### README for additional insights
- Describes supported process nodes, DRAM types, D2D interfaces, packaging technologies.
- Explains build/run steps: `make`, `pip install -r requirements.txt`, run a DSE shell script.
- Notes that foundational code is shared with the SET framework.

a. Main components
1. DSE Orchestrator (Shell scripts + Python wrappers)
2. C++ Mapping Engine (CLI executable)
3. Front-end IR Loader (JSON parser + IR models)
4. Mapping Pipeline:
– Partition Module
– Placement Module
– Spatial-Mapping Module
– Core-Mapping & Clustering Module
5. Cost & Performance Model (cost, bufferusage, NoC)
6. Result Generator (log files)
7. Post-Processing Python Tools (`csv2xlsx`, `log2csv`, `best_arch.py`)
b. Relationships and interactions
- The DSE Orchestrator invokes the C++ engine repeatedly with varying parameters.
- The C++ engine reads a JSON IR, runs pipeline modules in sequence, writes textual logs.
- Python post-processors consume log files, produce CSV/XLSX summaries and best-arch selection.
c. Architectural patterns/design principles
- Pipeline pattern: sequential modules transforming an IR.
- Plugin-style front-end: new networks added via JSON and `nns/` implementations.
- File-based orchestration: loose coupling between DSE driver, engine, and analysis tools.
d. Technologies/frameworks
- C++17, Makefile build
- JSON for Modern C++ (`include/json`, `src/json`)
- Python 3 for orchestration and post-processing
- Shell scripting for parameter sweeps

## Diagram (Mermaid)

```mermaid
flowchart TB
    classDef orchestration fill:#b3e6b3,stroke:#2d662d,color:#000
    classDef core fill:#cce0ff,stroke:#194d99,color:#000
    classDef data fill:#fff2b3,stroke:#997a00,color:#000

    subgraph Orchestration Layer
        direction TB
        S1["72tops_dse13.sh"]:::orchestration
        S2["512tops_dse13.sh"]:::orchestration
        S3["128tops_dse.sh"]:::orchestration
        S4["summary.sh"]:::orchestration
        P1["log2csv.py"]:::orchestration
        P2["csv2xlsx.py"]:::orchestration
        P3["best_arch.py"]:::orchestration
    end

    S1-->E
    S2-->E
    S3-->E
    S4-->E

    subgraph "C++ Core Engine"
        direction TB
        E["CLI Executable"]:::core
        subgraph "Front-end IR Loader"
            direction TB
            JP["JSON Parser"]:::core
            JS["JSON Models"]:::core
            IM["IR Model Files"]:::core
        end
        ND["Network Definitions"]:::core
        PT["Partition Module"]:::core
        PL["Placement Module"]:::core
        SM["Spatial-Mapping Module"]:::core
        CC["Core-Mapping & Clustering"]:::core
        DL["Data-Layout Module"]:::core
        CP["Cost & Performance Model"]:::core
        RG["Result Generator"]:::core
    end

    json["JSON IRs"]:::data
    log["Log Files"]:::data
    csv["CSV Reports"]:::data
    xlsx["XLSX Reports"]:::data
    best["Best-Arch Report"]:::data

    json-->IM
    IM-->JP
    JP-->PT
    PT-->PL
    PL-->SM
    SM-->CC
    CC-->DL
    DL-->CP
    CP-->RG
    RG-->log

    log-->P1
    P1-->csv
    csv-->P2
    P2-->xlsx
    log-->P3
    P3-->best

    click S1 "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/72tops_dse13.sh"
    click S2 "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/512tops_dse13.sh"
    click S3 "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/128tops_dse.sh"
    click S4 "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/summary.sh"
    click P1 "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/pyscripts/log2csv.py"
    click P2 "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/pyscripts/csv2xlsx.py"
    click P3 "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/pyscripts/best_arch.py"
    click E "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/src/main.cpp"
    click JP "https://github.com/set-scheduling-project/gemini-hpca2024/tree/master/include/json/"
    click JS "https://github.com/set-scheduling-project/gemini-hpca2024/tree/master/src/json/"
    click IM "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/src/front_end_IRs/*.json"
    click ND "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/include/nns/nns.h"
    click PT "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/include/partition.h"
    click PL "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/include/placement.h"
    click SM "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/include/spatial_mapping/DP.h"
    click CC "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/include/coremapping.h"
    click DL "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/include/datalayout.h"
    click CP "https://github.com/set-scheduling-project/gemini-hpca2024/blob/master/include/cost.h"
    class E,JP,JS,IM,ND,PT,PL,SM,CC,DL,CP orchestration
```
