# ntue2719-commits/image-dsp-benchmark architecture

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

- Interactive diagram: https://gitdiagram.com/ntue2719-commits/image-dsp-benchmark
- Repository: https://github.com/ntue2719-commits/image-dsp-benchmark

## Overview

This repository benchmarks an integer-only image-processing pipeline with Python, C, and Verilog implementations. Its principal workflow generates or loads an image, converts it to grayscale, adds reproducible salt-and-pepper noise, filters it, computes Sobel magnitude, and thresholds the result into an edge image. The Python golden model orchestrates the sampled stages and emits vectors used by the documented C/RTL comparison. The README also documents CPU/FPGA benchmarking across three boards. C, board projects, and verification internals were not sampled, so their wiring is shown only where documented.

Main entry points: [`python/golden_model.py`](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/golden_model.py) (Golden model), [`README.md`](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/README.md) (Platform benchmarks), [`c`](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/c) (C implementation), [`rtl`](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/rtl) (RTL pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reference["Python reference"]
  node_golden["Golden model<br/>[golden_model.py]"]
  node_gray["Grayscale<br/>[preprocess.py]"]
  node_noise["Noise injection<br/>[noise.py]"]
  node_median["Median filter<br/>[median.py]"]
  node_sobel["Sobel threshold<br/>[sobel.py]"]
  node_vectors["Golden vectors<br/>[golden_model.py]"]
end

subgraph group_implementations["Compute implementations"]
  node_c_impl["C implementation"]
  node_rtl["RTL pipeline"]
  node_line_buffer["Line buffer<br/>[line_buffer.v]"]
  node_window["3×3 window<br/>[window_3x3.v]"]
  node_median_rtl["RTL median<br/>[median_3x3.v]"]
  node_sobel_rtl["RTL Sobel<br/>[sobel_3x3.v]"]
  node_magnitude["Gradient magnitude<br/>[gradient_mag.v]"]
  node_threshold["RTL threshold<br/>[Threshold.v]"]
end

subgraph group_hardware["FPGA platforms"]
  node_ebaz["EBAZ4205"]
  node_kr260["Kria KR260"]
  node_zero["Orange Pi Zero<br/>[README.md]"]
end

subgraph group_evaluation["Verification and benchmarks"]
  node_verification["Bit-exact checks"]
  node_benchmark["Platform benchmarks<br/>[README.md]"]
  node_results["Benchmark results"]
end

node_user(("Image provider"))

node_user -->|"supplies image"| node_golden
node_golden -->|"calls"| node_gray
node_golden -->|"calls"| node_noise
node_golden -->|"calls"| node_median
node_golden -->|"calls"| node_sobel
node_golden -->|"writes vectors"| node_vectors
node_vectors -->|"input vectors"| node_c_impl
node_vectors -->|"input vectors"| node_rtl
node_c_impl -->|"compared against"| node_verification
node_rtl -->|"compared against"| node_verification
node_ebaz -->|"benchmarked on"| node_benchmark
node_kr260 -->|"benchmarked on"| node_benchmark
node_zero -->|"benchmarked on"| node_benchmark
node_benchmark -->|"records metrics"| node_results

click node_golden "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/golden_model.py"
click node_gray "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/preprocess.py"
click node_noise "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/noise.py"
click node_median "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/median.py"
click node_sobel "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/sobel.py"
click node_vectors "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/golden_model.py"
click node_c_impl "https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/c"
click node_rtl "https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/rtl"
click node_line_buffer "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/line_buffer.v"
click node_window "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/window_3x3.v"
click node_median_rtl "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/median_3x3.v"
click node_sobel_rtl "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/sobel_3x3.v"
click node_magnitude "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/gradient_mag.v"
click node_threshold "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/Threshold.v"
click node_ebaz "https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/fpga/ebaz"
click node_kr260 "https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/fpga/kr260"
click node_zero "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/README.md"
click node_verification "https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/python"
click node_benchmark "https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/README.md"
click node_results "https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/results"

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_golden,node_gray,node_noise,node_median,node_sobel,node_vectors toneBlue
class node_c_impl,node_rtl,node_line_buffer,node_window,node_median_rtl,node_sobel_rtl,node_magnitude,node_threshold toneAmber
class node_ebaz,node_kr260,node_zero toneMint
class node_verification,node_benchmark,node_results toneRose
class node_user toneIndigo
```

## Components

### Python reference

- [Golden model](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/golden_model.py): `python/golden_model.py`
- [Grayscale](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/preprocess.py): `python/preprocess.py`
- [Noise injection](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/noise.py): `python/noise.py`
- [Median filter](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/median.py): `python/median.py`
- [Sobel threshold](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/sobel.py): `python/sobel.py`
- [Golden vectors](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/python/golden_model.py): `python/golden_model.py`

### Compute implementations

- [C implementation](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/c): `c`
- [RTL pipeline](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/rtl): `rtl`
- [Line buffer](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/line_buffer.v): `rtl/line_buffer.v`
- [3×3 window](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/window_3x3.v): `rtl/window_3x3.v`
- [RTL median](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/median_3x3.v): `rtl/median_3x3.v`
- [RTL Sobel](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/sobel_3x3.v): `rtl/sobel_3x3.v`
- [Gradient magnitude](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/gradient_mag.v): `rtl/gradient_mag.v`
- [RTL threshold](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/rtl/Threshold.v): `rtl/Threshold.v`

### FPGA platforms

- [EBAZ4205](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/fpga/ebaz): `fpga/ebaz`
- [Kria KR260](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/fpga/kr260): `fpga/kr260`
- [Orange Pi Zero](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/README.md): `README.md`

### Verification and benchmarks

- [Bit-exact checks](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/python): `python`
- [Platform benchmarks](https://github.com/ntue2719-commits/image-dsp-benchmark/blob/main/README.md): `README.md`
- [Benchmark results](https://github.com/ntue2719-commits/image-dsp-benchmark/tree/main/results): `results`

### Other components

- **Image provider**

## Connections

- Image provider → Golden model: supplies image
- Golden model → Grayscale: calls
- Golden model → Noise injection: calls
- Golden model → Median filter: calls
- Golden model → Sobel threshold: calls
- Golden model → Golden vectors: writes vectors
- Golden vectors → C implementation: input vectors
- Golden vectors → RTL pipeline: input vectors
- C implementation → Bit-exact checks: compared against
- RTL pipeline → Bit-exact checks: compared against
- EBAZ4205 → Platform benchmarks: benchmarked on
- Kria KR260 → Platform benchmarks: benchmarked on
- Orange Pi Zero → Platform benchmarks: benchmarked on
- Platform benchmarks → Benchmark results: records metrics
