# openvvvf/rte architecture

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

## Overview

RTE is a model-based motor-drive development toolchain: users edit a control graph, generate and insert code into a platform firmware image, build and flash it, then run the resulting control application. The README documents graph serialization and timing validation, code generation, Studio, automation and protocol capabilities; the sampled CLI source confirms orchestration of emission, building and flashing. Firmware evidence is partial, so runtime links are limited to documented capabilities and the sampled control, fault, command and startup modules.

Main entry points: [`Source/RTECLI/src/Main.cpp`](https://github.com/openvvvf/rte/blob/main/Source/RTECLI/src/Main.cpp) (RTE CLI), [`Source/NodeGUI`](https://github.com/openvvvf/rte/tree/main/Source/NodeGUI) (RTE Studio), [`Source/RTECodeEmitter`](https://github.com/openvvvf/rte/tree/main/Source/RTECodeEmitter) (Firmware emitter), [`Images/Gen6FW/Src/Inverter/Control/FocControlManager.cpp`](https://github.com/openvvvf/rte/blob/main/Images/Gen6FW/Src/Inverter/Control/FocControlManager.cpp) (FOC control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["Graph design"]
  node_studio["RTE Studio"]
  node_nodeapi["Graph model"]
  node_templates["Node templates"]
  node_examples["Example graphs"]
  node_validation["Timing validation"]
end

subgraph group_generation["Firmware generation"]
  node_codegen["C++ codegen"]
  node_emitter["Firmware emitter"]
  node_builder["Firmware builder"]
end

subgraph group_automation["Host automation"]
  node_cli["RTE CLI<br/>[Main.cpp]"]
  node_automationlib["Automation backend"]
  node_flasher["Device flasher"]
  node_studio_live["Live device session"]
  node_mcp["MCP interface"]
end

subgraph group_device["Inverter firmware"]
  node_basefw["Base firmware"]
  node_foc["FOC control"]
  node_calibration["Motor calibration"]
  node_faults["Fault manager<br/>[FaultManager.h]"]
  node_commands["Shell commands<br/>[CommandManager.cpp]"]
  node_telemetry["Telemetry protocol"]
end

node_engineer(("Drive developer"))
node_target{{"Motor-drive hardware"}}

node_engineer -->|"edits graph"| node_studio
node_engineer -->|"runs automation"| node_cli
node_studio -->|"edits model"| node_nodeapi
node_studio -->|"uses templates"| node_templates
node_studio -.->|"opens graphs"| node_examples
node_nodeapi -->|"validates timing"| node_validation
node_cli -->|"validates graph"| node_validation
node_cli -->|"runs emission"| node_emitter
node_emitter -->|"generates code"| node_codegen
node_emitter -->|"inserts code"| node_basefw
node_cli -->|"runs build"| node_builder
node_cli -->|"requests flash"| node_flasher
node_cli -->|"uses automation"| node_automationlib
node_flasher -->|"programs firmware"| node_target
node_basefw -->|"runs control"| node_foc
node_foc -->|"uses calibration"| node_calibration
node_foc -->|"raises faults"| node_faults
node_commands -->|"emits responses"| node_telemetry
node_target -->|"sends frames"| node_telemetry
node_studio -->|"manages live state"| node_studio_live
node_studio_live -->|"connects device"| node_target
node_cli -->|"serves MCP"| node_mcp

click node_studio "https://github.com/openvvvf/rte/tree/main/Source/NodeGUI"
click node_nodeapi "https://github.com/openvvvf/rte/tree/main/Lib/NodeAPI"
click node_templates "https://github.com/openvvvf/rte/tree/main/Assets/NodeTemplates"
click node_examples "https://github.com/openvvvf/rte/tree/main/Assets/Examples"
click node_validation "https://github.com/openvvvf/rte/tree/main/Lib/NodeAPI"
click node_codegen "https://github.com/openvvvf/rte/tree/main/Lib/InverterCodegen"
click node_emitter "https://github.com/openvvvf/rte/tree/main/Source/RTECodeEmitter"
click node_basefw "https://github.com/openvvvf/rte/tree/main/Images/Gen6FW"
click node_builder "https://github.com/openvvvf/rte/tree/main/Source/RTEFirmwareBuilder"
click node_cli "https://github.com/openvvvf/rte/blob/main/Source/RTECLI/src/Main.cpp"
click node_automationlib "https://github.com/openvvvf/rte/tree/main/Source/RTEAutomation"
click node_flasher "https://github.com/openvvvf/rte/tree/main/Source/RTEAutomation"
click node_foc "https://github.com/openvvvf/rte/blob/main/Images/Gen6FW/Src/Inverter/Control/FocControlManager.cpp"
click node_calibration "https://github.com/openvvvf/rte/tree/main/Images/Gen6FW"
click node_faults "https://github.com/openvvvf/rte/blob/main/Images/Gen6FW/Inc/Inverter/Control/FaultManager.h"
click node_commands "https://github.com/openvvvf/rte/blob/main/Images/Gen6FW/Src/Inverter/Command/CommandManager.cpp"
click node_telemetry "https://github.com/openvvvf/rte/tree/main/Lib/InverterProtocol"
click node_studio_live "https://github.com/openvvvf/rte/tree/main/Source/NodeGUI"
click node_mcp "https://github.com/openvvvf/rte/tree/main/Source/RTECLI"

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_studio,node_nodeapi,node_templates,node_examples,node_validation toneBlue
class node_codegen,node_emitter,node_builder toneAmber
class node_cli,node_automationlib,node_flasher,node_studio_live,node_mcp toneMint
class node_basefw,node_foc,node_calibration,node_faults,node_commands,node_telemetry toneRose
class node_engineer,node_target toneIndigo
```

## Components

### Graph design

- [RTE Studio](https://github.com/openvvvf/rte/tree/main/Source/NodeGUI): `Source/NodeGUI`
- [Graph model](https://github.com/openvvvf/rte/tree/main/Lib/NodeAPI): `Lib/NodeAPI`
- [Node templates](https://github.com/openvvvf/rte/tree/main/Assets/NodeTemplates): `Assets/NodeTemplates`
- [Example graphs](https://github.com/openvvvf/rte/tree/main/Assets/Examples): `Assets/Examples`
- [Timing validation](https://github.com/openvvvf/rte/tree/main/Lib/NodeAPI): `Lib/NodeAPI`

### Firmware generation

- [C++ codegen](https://github.com/openvvvf/rte/tree/main/Lib/InverterCodegen): `Lib/InverterCodegen`
- [Firmware emitter](https://github.com/openvvvf/rte/tree/main/Source/RTECodeEmitter): `Source/RTECodeEmitter`
- [Firmware builder](https://github.com/openvvvf/rte/tree/main/Source/RTEFirmwareBuilder): `Source/RTEFirmwareBuilder`

### Host automation

- [RTE CLI](https://github.com/openvvvf/rte/blob/main/Source/RTECLI/src/Main.cpp): `Source/RTECLI/src/Main.cpp`
- [Automation backend](https://github.com/openvvvf/rte/tree/main/Source/RTEAutomation): `Source/RTEAutomation`
- [Device flasher](https://github.com/openvvvf/rte/tree/main/Source/RTEAutomation): `Source/RTEAutomation`
- [Live device session](https://github.com/openvvvf/rte/tree/main/Source/NodeGUI): `Source/NodeGUI`
- [MCP interface](https://github.com/openvvvf/rte/tree/main/Source/RTECLI): `Source/RTECLI`

### Inverter firmware

- [Base firmware](https://github.com/openvvvf/rte/tree/main/Images/Gen6FW): `Images/Gen6FW`
- [FOC control](https://github.com/openvvvf/rte/blob/main/Images/Gen6FW/Src/Inverter/Control/FocControlManager.cpp): `Images/Gen6FW/Src/Inverter/Control/FocControlManager.cpp`
- [Motor calibration](https://github.com/openvvvf/rte/tree/main/Images/Gen6FW): `Images/Gen6FW`
- [Fault manager](https://github.com/openvvvf/rte/blob/main/Images/Gen6FW/Inc/Inverter/Control/FaultManager.h): `Images/Gen6FW/Inc/Inverter/Control/FaultManager.h`
- [Shell commands](https://github.com/openvvvf/rte/blob/main/Images/Gen6FW/Src/Inverter/Command/CommandManager.cpp): `Images/Gen6FW/Src/Inverter/Command/CommandManager.cpp`
- [Telemetry protocol](https://github.com/openvvvf/rte/tree/main/Lib/InverterProtocol): `Lib/InverterProtocol`

### Other components

- **Drive developer**
- **Motor-drive hardware**

## Connections

- Drive developer → RTE Studio: edits graph
- Drive developer → RTE CLI: runs automation
- RTE Studio → Graph model: edits model
- RTE Studio → Node templates: uses templates
- RTE Studio → Example graphs: opens graphs
- Graph model → Timing validation: validates timing
- RTE CLI → Timing validation: validates graph
- RTE CLI → Firmware emitter: runs emission
- Firmware emitter → C++ codegen: generates code
- Firmware emitter → Base firmware: inserts code
- RTE CLI → Firmware builder: runs build
- RTE CLI → Device flasher: requests flash
- RTE CLI → Automation backend: uses automation
- Device flasher → Motor-drive hardware: programs firmware
- Base firmware → FOC control: runs control
- FOC control → Motor calibration: uses calibration
- FOC control → Fault manager: raises faults
- Shell commands → Telemetry protocol: emits responses
- Motor-drive hardware → Telemetry protocol: sends frames
- RTE Studio → Live device session: manages live state
- Live device session → Motor-drive hardware: connects device
- RTE CLI → MCP interface: serves MCP
