# pavan2415001/fpga-rle-image-compressor architecture

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

- Interactive diagram: https://gitdiagram.com/pavan2415001/fpga-rle-image-compressor
- Repository: https://github.com/pavan2415001/fpga-rle-image-compressor

## Overview

This is an FPGA image-compression system: an image is stored in FPGA memory, read and RLE-compressed plane by plane, then sent over UART for MATLAB reconstruction and PNG export. The README documents the color-design pipeline and a separate grayscale design; the tree identifies their RTL paths. No source excerpts were supplied, so internal blocks and wiring follow documented architecture rather than inspected RTL, and uncertain implementation details are omitted.

Main entry points: [`rtl/color/design_color_vivado.v`](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v) (Pixel reader), [`matlab/receiver.m`](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/matlab/receiver.m) (MATLAB receiver), [`matlab/generate_image_mem.m`](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/matlab/generate_image_mem.m) (Memory generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Image input"]
  node_image(("Input image"))
  node_memgen["Memory generator"]
  node_frame[("Image memory")]
end

subgraph group_compression["FPGA compression"]
  node_reader["Pixel reader"]
  node_planes["RGB plane control"]
  node_rle["RLE core"]
  node_formatter["Packet formatter"]
  node_fifo[("Output FIFO")]
end

subgraph group_transport["Serial transport"]
  node_uart["UART transmitter"]
  node_bridge["USB-UART bridge"]
end

subgraph group_host["Host reconstruction"]
  node_pc(("Host PC"))
  node_receiver["MATLAB receiver<br/>[receiver.m]"]
  node_reconstructed["Reconstructed image"]
end

subgraph group_alternate["Grayscale design"]
  node_grayscale["Grayscale RTL design<br/>[design_vivado.v]"]
end

node_image -->|"provides image"| node_memgen
node_memgen -->|"prepares memory data"| node_frame
node_frame -->|"supplies pixels"| node_reader
node_planes -->|"selects color plane"| node_reader
node_reader -->|"provides pixels"| node_rle
node_rle -->|"emits runs"| node_formatter
node_formatter -->|"writes packets"| node_fifo
node_fifo -->|"supplies bytes"| node_uart
node_uart -->|"transmits serial data"| node_bridge
node_bridge -->|"delivers serial data"| node_receiver
node_pc -->|"runs"| node_receiver
node_receiver -->|"reconstructs and exports"| node_reconstructed

click node_memgen "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/matlab/generate_image_mem.m"
click node_frame "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v"
click node_reader "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v"
click node_planes "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v"
click node_rle "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v"
click node_formatter "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v"
click node_fifo "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v"
click node_uart "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v"
click node_receiver "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/matlab/receiver.m"
click node_grayscale "https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/grayscale/design_vivado.v"

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_image,node_memgen,node_frame toneBlue
class node_reader,node_planes,node_rle,node_formatter,node_fifo toneAmber
class node_uart,node_bridge toneMint
class node_pc,node_receiver,node_reconstructed toneRose
class node_grayscale toneIndigo
```

## Components

### Image input

- **Input image**
- [Memory generator](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/matlab/generate_image_mem.m): `matlab/generate_image_mem.m`
- [Image memory](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v): `rtl/color/design_color_vivado.v`

### FPGA compression

- [Pixel reader](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v): `rtl/color/design_color_vivado.v`
- [RGB plane control](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v): `rtl/color/design_color_vivado.v`
- [RLE core](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v): `rtl/color/design_color_vivado.v`
- [Packet formatter](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v): `rtl/color/design_color_vivado.v`
- [Output FIFO](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v): `rtl/color/design_color_vivado.v`

### Serial transport

- [UART transmitter](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/color/design_color_vivado.v): `rtl/color/design_color_vivado.v`
- **USB-UART bridge**

### Host reconstruction

- **Host PC**
- [MATLAB receiver](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/matlab/receiver.m): `matlab/receiver.m`
- **Reconstructed image**

### Grayscale design

- [Grayscale RTL design](https://github.com/pavan2415001/fpga-rle-image-compressor/blob/main/rtl/grayscale/design_vivado.v): `rtl/grayscale/design_vivado.v`

## Connections

- Input image → Memory generator: provides image
- Memory generator → Image memory: prepares memory data
- Image memory → Pixel reader: supplies pixels
- RGB plane control → Pixel reader: selects color plane
- Pixel reader → RLE core: provides pixels
- RLE core → Packet formatter: emits runs
- Packet formatter → Output FIFO: writes packets
- Output FIFO → UART transmitter: supplies bytes
- UART transmitter → USB-UART bridge: transmits serial data
- USB-UART bridge → MATLAB receiver: delivers serial data
- Host PC → MATLAB receiver: runs
- MATLAB receiver → Reconstructed image: reconstructs and exports
