# machineware-gmbh/vcml architecture

> Architecture diagram of the GitHub repository machineware-gmbh/vcml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/machineware-gmbh/vcml
- Repository: https://github.com/machineware-gmbh/vcml

## Overview

##### Main Components

a) Core Framework Layer:
- Component System (core/component.h, core/model.h)
- Module Management (core/module.h)
- Peripheral Management (core/peripheral.h)
- Processor Abstraction (core/processor.h)
- Register Framework (core/register.h)
- System Management (core/system.h)

b) Protocol Layer:
- TLM Base Infrastructure
- Custom Protocols (CAN, GPIO, I2C, PCI, Serial, SPI, etc.)
- Protocol Adapters and Sockets

c) Models Layer:
- ARM Models (GIC, PL011, etc.)
- Generic Models (Bus, Memory, etc.)
- RISC-V Models (CLINT, PLIC, etc.)
- Peripheral Models (USB, Ethernet, etc.)
- Virtual I/O Models (VirtIO)

d) Supporting Systems:
- Debugging Infrastructure
- Logging System
- Property System
- Tracing System
- UI Components

**┌─────────────────────────────────────────────────────────────┐**
- Application Layer                        │
- (Virtual Platforms built using VCML Components)            │
- ┘
- ▲
**┌─────────────────────────────────────────────────────────────┐**
- Models Layer                           │
- ┬─────────────┬────────────────┬──────────────┤
- ARM Models │ RISC-V      │  Generic       │  Virtual I/O  │
- GIC        │ CLINT/PLIC  │  Bus/Memory    │  Models      │
- ┴─────────────┴────────────────┴──────────────┘
- ▲
**┌─────────────────────────────────────────────────────────────┐**
- Protocol Layer                           │
- ┬────────────┬────────────────┬────────────────┤
- TLM Base  │  Custom    │  Protocol      │   Socket       │
- Protocols │  Adapters      │   Management   │
- ┴────────────┴────────────────┴────────────────┘
- ▲
**┌─────────────────────────────────────────────────────────────┐**
- Core Layer                              │
- ┬────────────┬────────────────┬────────────────┤
- Component  │  Module    │  Register      │   System       │
- Framework  │  System    │  Management    │   Control      │
- ┴────────────┴────────────────┴────────────────┘
- ▲
**┌─────────────────────────────────────────────────────────────┐**
- SystemC/TLM                             │
- ┘

##### Connection Types

- Double lines: Primary data paths

##### Supporting Systems (show as side panels)

**┌─────────────┐**
- Debugging  │
- System     │──┐
- ┘  │
**┌─────────────┐  │**
- Logging    │  │
- System     │──┼─────► Main Architecture
- ┘  │
**┌─────────────┐  │**
- Property   │  │
- System     │──┘
- ┘

##### Important Notes

- Version information (from core/version.h.in)
- External dependencies (SystemC, SDL2, etc.)
- Optional components (like UI support)
- Configuration paths for different build types

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef core fill:#b3d1ff,stroke:#333
    classDef protocol fill:#b3ffb3,stroke:#333
    classDef models fill:#ffd9b3,stroke:#333
    classDef app fill:#ffffb3,stroke:#333
    classDef support fill:#e6e6e6,stroke:#333
    classDef base fill:#f2f2f2,stroke:#333

    %% Base Layer
    SystemC["SystemC/TLM"]:::base

    %% Core Layer
    subgraph CoreLayer["Core Framework Layer"]
        CompSys["Component System"]:::core
        ModMgmt["Module Management"]:::core
        PeriphMgmt["Peripheral Management"]:::core
        ProcAbs["Processor Abstraction"]:::core
        RegFw["Register Framework"]:::core
        SysMgmt["System Management"]:::core
    end

    %% Protocol Layer
    subgraph ProtocolLayer["Protocol Layer"]
        TLMBase["TLM Base"]:::protocol
        Protocols["Protocol Implementations"]:::protocol
        subgraph ProtocolTypes["Protocol Types"]
            CAN["CAN"]:::protocol
            GPIO["GPIO"]:::protocol
            I2C["I2C"]:::protocol
            PCI["PCI"]:::protocol
            Serial["Serial"]:::protocol
            SPI["SPI"]:::protocol
        end
    end

    %% Models Layer
    subgraph ModelsLayer["Models Layer"]
        ARMModels["ARM Models"]:::models
        GenericModels["Generic Models"]:::models
        RISCVModels["RISC-V Models"]:::models
        VirtIOModels["Virtual I/O Models"]:::models
    end

    %% Application Layer
    VirtualPlatforms["Virtual Platforms"]:::app

    %% Support Systems
    subgraph SupportSystems["Supporting Systems"]
        Debug["Debugging Infrastructure"]:::support
        Logging["Logging System"]:::support
        Property["Property System"]:::support
        Tracing["Tracing System"]:::support
        UI["UI Components"]:::support
    end

    %% Relationships
    SystemC --> CoreLayer
    CoreLayer --> ProtocolLayer
    ProtocolLayer --> ModelsLayer
    ModelsLayer --> VirtualPlatforms
    SupportSystems --> CoreLayer
    SupportSystems --> ProtocolLayer
    SupportSystems --> ModelsLayer

    %% Click events
    click CompSys "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/core/component.h"
    click ModMgmt "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/core/module.h"
    click PeriphMgmt "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/core/peripheral.h"
    click ProcAbs "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/core/processor.h"
    click RegFw "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/core/register.h"
    click SysMgmt "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/core/system.h"
    click TLMBase "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/protocols/tlm_base.h"
    click CAN "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/protocols/can.h"
    click GPIO "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/protocols/gpio.h"
    click I2C "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/protocols/i2c.h"
    click PCI "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/protocols/pci.h"
    click Serial "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/protocols/serial.h"
    click SPI "https://github.com/machineware-gmbh/vcml/blob/main/include/vcml/protocols/spi.h"
    click ARMModels "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/models/arm/"
    click GenericModels "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/models/generic/"
    click RISCVModels "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/models/riscv/"
    click VirtIOModels "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/models/virtio/"
    click Debug "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/debugging/"
    click Logging "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/logging/"
    click Property "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/properties/"
    click Tracing "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/tracing/"
    click UI "https://github.com/machineware-gmbh/vcml/tree/main/include/vcml/ui/"
```
