# kavinv125/gnss-dev architecture

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

- Interactive diagram: https://gitdiagram.com/kavinv125/gnss-dev
- Repository: https://github.com/kavinv125/gnss-dev

## Overview

This repository contains two PicoRV32 FPGA SoC paths: a GNSS telemetry engine documented in the README, and a separate resident UART bootloader in `picorv32_bootloader`. The principal bootloader workflow is host upload, bootloader receipt and RAM copy, acknowledgement, then application execution. The README describes richer GNSS RTL capabilities, but their named modules are absent from the supplied tree; the graph limits that branch to listed RTL files and documented architecture. The source excerpts show the bootloader protocol directly; GNSS internals beyond the sampled files are not verified.

Main entry points: [`picorv32_bootloader/bootloader/main.c`](https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/bootloader/main.c) (Resident Loader), [`rtl/soc.v`](https://github.com/kavinv125/gnss-dev/blob/main/rtl/soc.v) (SoC Interconnect), [`rtl/simple_uart.v`](https://github.com/kavinv125/gnss-dev/blob/main/rtl/simple_uart.v) (UART Peripheral), [`picorv32_bootloader/host/upload.py`](https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/host/upload.py) (Image Uploader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host Upload"]
  node_uploader["Image Uploader<br/>[upload.py]"]
  node_monitor["UART Monitor<br/>[monitor_uart.py]"]
end

subgraph group_boot["Bootloader Runtime"]
  node_resident["Resident Loader<br/>[main.c]"]
  node_app["LED Application<br/>[main.c]"]
end

subgraph group_core["FPGA SoC"]
  node_app_ram[("Application RAM")]
  node_cpu["PicoRV32 Core<br/>[picorv32.v]"]
  node_soc["SoC Interconnect<br/>[soc.v]"]
  node_memory[("BRAM<br/>[bram.v]")]
  node_top["FPGA Top<br/>[picorv32_top.v]"]
end

subgraph group_gnss["GNSS Telemetry"]
  node_gnss_doc["GNSS Architecture"]
  node_uart_tx["UART Transmitter<br/>[uart_tx.v]"]
  node_uart["UART Peripheral<br/>[simple_uart.v]"]
  node_firmware["Firmware Demo<br/>[main.c]"]
end

node_operator(("Board Operator"))
node_serial["Serial Port"]

node_operator -->|"selects image"| node_uploader
node_uploader -->|"sends length and image"| node_serial
node_serial -->|"delivers upload"| node_resident
node_resident -->|"writes image"| node_app_ram
node_resident -->|"sends acknowledgement"| node_serial
node_resident -->|"jumps to app"| node_app
node_operator -->|"opens monitor"| node_monitor
node_monitor -->|"reads bytes"| node_serial
node_cpu -.->|"uses bus"| node_soc
node_soc -.->|"accesses RAM"| node_memory
node_soc -.->|"routes MMIO"| node_uart
node_top -.->|"instantiates"| node_soc
node_gnss_doc -.->|"documents transmitter"| node_uart_tx
node_firmware -->|"writes MMIO"| node_uart
node_uart -.->|"transmits output"| node_serial

click node_uploader "https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/host/upload.py"
click node_resident "https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/bootloader/main.c"
click node_app "https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/app/main.c"
click node_cpu "https://github.com/kavinv125/gnss-dev/blob/main/rtl/picorv32.v"
click node_soc "https://github.com/kavinv125/gnss-dev/blob/main/rtl/soc.v"
click node_memory "https://github.com/kavinv125/gnss-dev/blob/main/rtl/bram.v"
click node_top "https://github.com/kavinv125/gnss-dev/blob/main/rtl/picorv32_top.v"
click node_uart_tx "https://github.com/kavinv125/gnss-dev/blob/main/rtl/uart_tx.v"
click node_uart "https://github.com/kavinv125/gnss-dev/blob/main/rtl/simple_uart.v"
click node_firmware "https://github.com/kavinv125/gnss-dev/blob/main/firmware/main.c"
click node_monitor "https://github.com/kavinv125/gnss-dev/blob/main/scripts/monitor_uart.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_uploader,node_monitor toneBlue
class node_resident,node_app toneAmber
class node_app_ram,node_cpu,node_soc,node_memory,node_top toneMint
class node_gnss_doc,node_uart_tx,node_uart,node_firmware toneRose
class node_operator,node_serial toneIndigo
```

## Components

### Host Upload

- [Image Uploader](https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/host/upload.py): `picorv32_bootloader/host/upload.py`
- [UART Monitor](https://github.com/kavinv125/gnss-dev/blob/main/scripts/monitor_uart.py): `scripts/monitor_uart.py`

### Bootloader Runtime

- [Resident Loader](https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/bootloader/main.c): `picorv32_bootloader/bootloader/main.c`
- [LED Application](https://github.com/kavinv125/gnss-dev/blob/main/picorv32_bootloader/app/main.c): `picorv32_bootloader/app/main.c`

### FPGA SoC

- **Application RAM**
- [PicoRV32 Core](https://github.com/kavinv125/gnss-dev/blob/main/rtl/picorv32.v): `rtl/picorv32.v`
- [SoC Interconnect](https://github.com/kavinv125/gnss-dev/blob/main/rtl/soc.v): `rtl/soc.v`
- [BRAM](https://github.com/kavinv125/gnss-dev/blob/main/rtl/bram.v): `rtl/bram.v`
- [FPGA Top](https://github.com/kavinv125/gnss-dev/blob/main/rtl/picorv32_top.v): `rtl/picorv32_top.v`

### GNSS Telemetry

- **GNSS Architecture**
- [UART Transmitter](https://github.com/kavinv125/gnss-dev/blob/main/rtl/uart_tx.v): `rtl/uart_tx.v`
- [UART Peripheral](https://github.com/kavinv125/gnss-dev/blob/main/rtl/simple_uart.v): `rtl/simple_uart.v`
- [Firmware Demo](https://github.com/kavinv125/gnss-dev/blob/main/firmware/main.c): `firmware/main.c`

### Other components

- **Board Operator**
- **Serial Port**

## Connections

- Board Operator → Image Uploader: selects image (evidence: `picorv32_bootloader/host/upload.py`)
- Image Uploader → Serial Port: sends length and image (evidence: `picorv32_bootloader/host/upload.py`)
- Serial Port → Resident Loader: delivers upload (evidence: `picorv32_bootloader/bootloader/main.c`)
- Resident Loader → Application RAM: writes image (evidence: `picorv32_bootloader/bootloader/main.c`)
- Resident Loader → Serial Port: sends acknowledgement (evidence: `picorv32_bootloader/bootloader/main.c`)
- Resident Loader → LED Application: jumps to app (evidence: `picorv32_bootloader/bootloader/main.c`)
- Board Operator → UART Monitor: opens monitor (evidence: `scripts/monitor_uart.py`)
- UART Monitor → Serial Port: reads bytes (evidence: `scripts/monitor_uart.py`)
- PicoRV32 Core → SoC Interconnect: uses bus
- SoC Interconnect → BRAM: accesses RAM
- SoC Interconnect → UART Peripheral: routes MMIO
- FPGA Top → SoC Interconnect: instantiates
- GNSS Architecture → UART Transmitter: documents transmitter (evidence: `README.md`)
- Firmware Demo → UART Peripheral: writes MMIO (evidence: `firmware/main.c`)
- UART Peripheral → Serial Port: transmits output
