# virochanmourya/coreaccel-v architecture

> Architecture diagram of the GitHub repository virochanmourya/coreaccel-v, 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/virochanmourya/coreaccel-v
- Repository: https://github.com/virochanmourya/coreaccel-v

## Overview

CoreAccel-V is an FPGA RISC-V SoC demonstrated as a real-time ECG monitor. The main workflow samples an external ADC, filters the signal and detects/classifies beats in firmware, sends ECG/BPM/status telemetry over UART, and displays it in a host GUI. The graph also includes the documented CPU pipeline, DSP/MAC, TCM, and FPGA peripherals. Firmware excerpts show the active ECG processing and telemetry path; most RTL implementation details were not sampled, so their internal connections are omitted.

Main entry points: [`rtl/cpu_pipeline_top.sv`](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/cpu_pipeline_top.sv) (RV32I Pipeline), [`firmware/main.c`](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/main.c) (ECG Processing And Classification), [`rtl/mac_unit.sv`](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/mac_unit.sv) (DSP MAC), [`firmware/ads1115_driver.c`](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/ads1115_driver.c) (ADC I2C Driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_soc["SoC RTL"]
  node_cpu["RV32I Pipeline"]
  node_pipeline_control["Pipeline Control"]
  node_hazards["Hazard And Forwarding"]
  node_mac["DSP MAC<br/>[mac_unit.sv]"]
  node_tcm[("Tightly Coupled Memory<br/>[tcm_ram.sv]")]
  node_instruction_memory[("Instruction Memory")]
  node_data_memory[("Data Memory<br/>[data_memory.sv]")]
  node_gpio_hw["GPIO Peripheral"]
  node_uart_hw["UART Transmitter<br/>[uart_tx.sv]"]
  node_display_hw["Seven-Segment Display<br/>[seg_display.sv]"]
end

subgraph group_fw["Firmware"]
  node_main["ECG Processing And Classification<br/>[main.c]"]
  node_adc_driver["ADC I2C Driver<br/>[ads1115_driver.c]"]
  node_gpio_driver["GPIO I2C Helpers<br/>[gpio.h]"]
  node_mac_intrinsics["MAC Intrinsics<br/>[mac_intrinsics.h]"]
  node_uart_driver["UART Telemetry Driver<br/>[uart_driver.c]"]
  node_display_driver["Display Driver<br/>[seg_driver.c]"]
end

subgraph group_host["Host Monitor"]
  node_serial_reader["Serial Reader<br/>[ecg_monitor.py]"]
  node_monitor["ECG Visualization And Status<br/>[ecg_monitor.py]"]
end

subgraph group_io["External I/O"]
  node_ecg_source(("ECG Front End"))
  node_adc["ADS1115 ADC"]
  node_viewer(("Monitor User"))
  node_uart_host["Host UART"]
end

node_ecg_source -.->|"analog signal"| node_adc
node_adc -.->|"converts samples"| node_adc_driver
node_main -->|"reads samples"| node_adc_driver
node_adc_driver -->|"bit-bangs I2C"| node_gpio_driver
node_main -->|"filters and classifies"| node_main
node_main -->|"sends ECG and status"| node_uart_driver
node_main -->|"updates BPM display"| node_display_driver
node_uart_driver -.->|"writes MMIO"| node_uart_hw
node_display_driver -.->|"writes MMIO"| node_display_hw
node_gpio_driver -.->|"writes MMIO"| node_gpio_hw
node_uart_hw -.->|"transmits telemetry"| node_uart_host
node_uart_host -.->|"streams data"| node_serial_reader
node_serial_reader -->|"emits parsed samples"| node_monitor
node_monitor -.->|"visualizes waveform and status"| node_viewer
node_cpu -.->|"runs pipeline control"| node_pipeline_control
node_cpu -.->|"uses forwarding and hazard detection"| node_hazards
node_cpu -.->|"dispatches custom DSP operations"| node_mac
node_mac -.->|"streams weights"| node_tcm
node_cpu -.->|"fetches instructions"| node_instruction_memory
node_cpu -.->|"accesses data"| node_data_memory
node_mac_intrinsics -.->|"encodes custom instructions"| node_mac

click node_cpu "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/cpu_pipeline_top.sv"
click node_pipeline_control "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/control_unit_pipe.sv"
click node_hazards "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/hazard_detection_unit.sv"
click node_mac "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/mac_unit.sv"
click node_tcm "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/tcm_ram.sv"
click node_instruction_memory "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/instruction_memory_pipe.sv"
click node_data_memory "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/data_memory.sv"
click node_gpio_hw "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/cpu_pipeline_top.sv"
click node_uart_hw "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/uart_tx.sv"
click node_display_hw "https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/seg_display.sv"
click node_main "https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/main.c"
click node_adc_driver "https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/ads1115_driver.c"
click node_gpio_driver "https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/gpio.h"
click node_mac_intrinsics "https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/mac_intrinsics.h"
click node_uart_driver "https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/uart_driver.c"
click node_display_driver "https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/seg_driver.c"
click node_serial_reader "https://github.com/virochanmourya/coreaccel-v/blob/main/gui/ecg_monitor.py"
click node_monitor "https://github.com/virochanmourya/coreaccel-v/blob/main/gui/ecg_monitor.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_cpu,node_pipeline_control,node_hazards,node_mac,node_tcm,node_instruction_memory,node_data_memory,node_gpio_hw,node_uart_hw,node_display_hw toneBlue
class node_main,node_adc_driver,node_gpio_driver,node_mac_intrinsics,node_uart_driver,node_display_driver toneAmber
class node_serial_reader,node_monitor toneMint
class node_ecg_source,node_adc,node_viewer,node_uart_host toneRose
```

## Components

### SoC RTL

- [RV32I Pipeline](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/cpu_pipeline_top.sv): `rtl/cpu_pipeline_top.sv`
- [Pipeline Control](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/control_unit_pipe.sv): `rtl/control_unit_pipe.sv`
- [Hazard And Forwarding](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/hazard_detection_unit.sv): `rtl/hazard_detection_unit.sv`
- [DSP MAC](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/mac_unit.sv): `rtl/mac_unit.sv`
- [Tightly Coupled Memory](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/tcm_ram.sv): `rtl/tcm_ram.sv`
- [Instruction Memory](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/instruction_memory_pipe.sv): `rtl/instruction_memory_pipe.sv`
- [Data Memory](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/data_memory.sv): `rtl/data_memory.sv`
- [GPIO Peripheral](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/cpu_pipeline_top.sv): `rtl/cpu_pipeline_top.sv`
- [UART Transmitter](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/uart_tx.sv): `rtl/uart_tx.sv`
- [Seven-Segment Display](https://github.com/virochanmourya/coreaccel-v/blob/main/rtl/seg_display.sv): `rtl/seg_display.sv`

### Firmware

- [ECG Processing And Classification](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/main.c): `firmware/main.c`
- [ADC I2C Driver](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/ads1115_driver.c): `firmware/ads1115_driver.c`
- [GPIO I2C Helpers](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/gpio.h): `firmware/gpio.h`
- [MAC Intrinsics](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/mac_intrinsics.h): `firmware/mac_intrinsics.h`
- [UART Telemetry Driver](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/uart_driver.c): `firmware/uart_driver.c`
- [Display Driver](https://github.com/virochanmourya/coreaccel-v/blob/main/firmware/seg_driver.c): `firmware/seg_driver.c`

### Host Monitor

- [Serial Reader](https://github.com/virochanmourya/coreaccel-v/blob/main/gui/ecg_monitor.py): `gui/ecg_monitor.py`
- [ECG Visualization And Status](https://github.com/virochanmourya/coreaccel-v/blob/main/gui/ecg_monitor.py): `gui/ecg_monitor.py`

### External I/O

- **ECG Front End**
- **ADS1115 ADC**
- **Monitor User**
- **Host UART**

## Connections

- ECG Front End → ADS1115 ADC: analog signal (evidence: `README.md`)
- ADS1115 ADC → ADC I2C Driver: converts samples
- ECG Processing And Classification → ADC I2C Driver: reads samples (evidence: `firmware/main.c`)
- ADC I2C Driver → GPIO I2C Helpers: bit-bangs I2C (evidence: `firmware/ads1115_driver.c`)
- ECG Processing And Classification → ECG Processing And Classification: filters and classifies (evidence: `firmware/main.c`)
- ECG Processing And Classification → UART Telemetry Driver: sends ECG and status (evidence: `firmware/main.c`)
- ECG Processing And Classification → Display Driver: updates BPM display (evidence: `firmware/main.c`)
- UART Telemetry Driver → UART Transmitter: writes MMIO (evidence: `firmware/uart_driver.c`)
- Display Driver → Seven-Segment Display: writes MMIO (evidence: `firmware/seg_driver.c`)
- GPIO I2C Helpers → GPIO Peripheral: writes MMIO (evidence: `firmware/gpio.h`)
- UART Transmitter → Host UART: transmits telemetry (evidence: `README.md`)
- Host UART → Serial Reader: streams data (evidence: `README.md`)
- Serial Reader → ECG Visualization And Status: emits parsed samples (evidence: `gui/ecg_monitor.py`)
- ECG Visualization And Status → Monitor User: visualizes waveform and status (evidence: `README.md`)
- RV32I Pipeline → Pipeline Control: runs pipeline control (evidence: `README.md`)
- RV32I Pipeline → Hazard And Forwarding: uses forwarding and hazard detection (evidence: `README.md`)
- RV32I Pipeline → DSP MAC: dispatches custom DSP operations (evidence: `README.md`)
- DSP MAC → Tightly Coupled Memory: streams weights (evidence: `README.md`)
- RV32I Pipeline → Instruction Memory: fetches instructions (evidence: `README.md`)
- RV32I Pipeline → Data Memory: accesses data (evidence: `README.md`)
- MAC Intrinsics → DSP MAC: encodes custom instructions
