# thuychinguyenn/edabk_eeg architecture

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

- Interactive diagram: https://gitdiagram.com/thuychinguyenn/edabk_eeg
- Repository: https://github.com/thuychinguyenn/edabk_eeg

## Overview

This repository is a C convolution simulator exploring output-, input-, and weight-stationary tiling, plus a conventional convolution implementation and a Python checker. The main workflow runs a strategy-specific simulator, which moves tiles between modeled DRAM and SRAM, accumulates convolution results, and writes a binary result; the checker reads those files and compares them with a PyTorch reference. The three tiling variants are separate implementations. Their internal tile helpers and orchestration are excerpted, but no README is present and some variant code is unsampled.

Main entry points: [`conv_tiling_output.c`](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c) (Output-stationary), [`conv_tiling_input.c`](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_input.c) (Input-stationary), [`conv_tiling_weight.c`](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_weight.c) (Weight-stationary), [`verify.py`](https://github.com/thuychinguyenn/edabk_eeg/blob/main/verify.py) (Binary verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sim["Convolution simulators"]
  node_config["Tile configuration<br/>[config.h]"]
  node_baseline["Standard convolution<br/>[conv.c]"]
  node_os["Output-stationary"]
  node_is["Input-stationary"]
  node_ws["Weight-stationary"]
  node_osmem[("OS DRAM/SRAM")]
  node_osload["OS tile loading"]
  node_oscompute["OS tile compute"]
  node_isload["IS tile loading"]
  node_iscompute["IS tile compute"]
  node_wload["WS tile loading"]
  node_wcompute["WS tile compute"]
  node_files["Binary outputs"]
end

subgraph group_validation["Result validation"]
  node_verify["Binary verification<br/>[verify.py]"]
  node_pytorch["PyTorch reference"]
end

node_user(("Runner"))

node_user -->|"runs"| node_baseline
node_user -->|"runs"| node_os
node_user -->|"runs"| node_is
node_user -->|"runs"| node_ws
node_os -->|"reads parameters"| node_config
node_is -->|"reads parameters"| node_config
node_ws -->|"reads parameters"| node_config
node_os -->|"calls"| node_osload
node_os -->|"calls"| node_oscompute
node_osload -->|"moves tiles"| node_osmem
node_oscompute -->|"reads and updates"| node_osmem
node_os -->|"writes binary"| node_files
node_is -->|"calls"| node_isload
node_is -->|"calls"| node_iscompute
node_is -->|"writes binary"| node_files
node_ws -->|"calls"| node_wload
node_ws -->|"calls"| node_wcompute
node_ws -->|"writes binary"| node_files
node_user -->|"runs"| node_verify
node_verify -->|"reads binaries"| node_files
node_verify -->|"computes reference"| node_pytorch

click node_config "https://github.com/thuychinguyenn/edabk_eeg/blob/main/config.h"
click node_baseline "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv/conv.c"
click node_os "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c"
click node_is "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_input.c"
click node_ws "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_weight.c"
click node_osmem "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c"
click node_osload "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c"
click node_oscompute "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c"
click node_isload "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_input.c"
click node_iscompute "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_input.c"
click node_wload "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_weight.c"
click node_wcompute "https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_weight.c"
click node_verify "https://github.com/thuychinguyenn/edabk_eeg/blob/main/verify.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_config,node_baseline,node_os,node_is,node_ws,node_osmem,node_osload,node_oscompute,node_isload,node_iscompute,node_wload,node_wcompute,node_files toneBlue
class node_verify,node_pytorch toneAmber
class node_user toneIndigo
```

## Components

### Convolution simulators

- [Tile configuration](https://github.com/thuychinguyenn/edabk_eeg/blob/main/config.h): `config.h`
- [Standard convolution](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv/conv.c): `conv/conv.c`
- [Output-stationary](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c): `conv_tiling_output.c`
- [Input-stationary](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_input.c): `conv_tiling_input.c`
- [Weight-stationary](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_weight.c): `conv_tiling_weight.c`
- [OS DRAM/SRAM](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c): `conv_tiling_output.c`
- [OS tile loading](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c): `conv_tiling_output.c`
- [OS tile compute](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_output.c): `conv_tiling_output.c`
- [IS tile loading](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_input.c): `conv_tiling_input.c`
- [IS tile compute](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_input.c): `conv_tiling_input.c`
- [WS tile loading](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_weight.c): `conv_tiling_weight.c`
- [WS tile compute](https://github.com/thuychinguyenn/edabk_eeg/blob/main/conv_tiling_weight.c): `conv_tiling_weight.c`
- **Binary outputs**

### Result validation

- [Binary verification](https://github.com/thuychinguyenn/edabk_eeg/blob/main/verify.py): `verify.py`
- **PyTorch reference**

### Other components

- **Runner**

## Connections

- Runner → Standard convolution: runs (evidence: `conv/conv.c`)
- Runner → Output-stationary: runs (evidence: `conv_tiling_output.c`)
- Runner → Input-stationary: runs (evidence: `conv_tiling_input.c`)
- Runner → Weight-stationary: runs (evidence: `conv_tiling_weight.c`)
- Output-stationary → Tile configuration: reads parameters (evidence: `conv_tiling_output.c`)
- Input-stationary → Tile configuration: reads parameters (evidence: `conv_tiling_input.c`)
- Weight-stationary → Tile configuration: reads parameters (evidence: `conv_tiling_weight.c`)
- Output-stationary → OS tile loading: calls (evidence: `conv_tiling_output.c`)
- Output-stationary → OS tile compute: calls (evidence: `conv_tiling_output.c`)
- OS tile loading → OS DRAM/SRAM: moves tiles (evidence: `conv_tiling_output.c`)
- OS tile compute → OS DRAM/SRAM: reads and updates (evidence: `conv_tiling_output.c`)
- Output-stationary → Binary outputs: writes binary (evidence: `conv_tiling_output.c`)
- Input-stationary → IS tile loading: calls (evidence: `conv_tiling_input.c`)
- Input-stationary → IS tile compute: calls (evidence: `conv_tiling_input.c`)
- Input-stationary → Binary outputs: writes binary (evidence: `conv_tiling_input.c`)
- Weight-stationary → WS tile loading: calls (evidence: `conv_tiling_weight.c`)
- Weight-stationary → WS tile compute: calls (evidence: `conv_tiling_weight.c`)
- Weight-stationary → Binary outputs: writes binary (evidence: `conv_tiling_weight.c`)
- Runner → Binary verification: runs (evidence: `verify.py`)
- Binary verification → Binary outputs: reads binaries (evidence: `verify.py`)
- Binary verification → PyTorch reference: computes reference (evidence: `verify.py`)
