# openbmc/pldm architecture

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

- Interactive diagram: https://gitdiagram.com/openbmc/pldm
- Repository: https://github.com/openbmc/pldm

## Overview

##### Main Components

a) Core Components:
- PLDM Daemon (pldmd)
- libpldmresponder
- Request/Response Handler System
- PDR (Platform Descriptor Records) Repository
- BIOS Management System
- Transport Layer (MCTP)

b) Supporting Components:
- Configuration Management
- OEM Extensions
- Tools and Utilities
- Event Management System

##### Architectural Layers

**Top Layer: Applications & Tools**

**Middle Layer: Core PLDM Services**

**Bottom Layer: Transport & System Integration**

##### Key Relationships

a) Message Flow:
- Bidirectional communication between PLDM daemon and MCTP transport
- Request/response paths between components
- Event propagation paths

b) Data Flow:
- PDR data flow from JSON configurations to repository
- BIOS attribute flow from JSON to BIOS tables
- FRU data management paths

##### Specific Design Elements

**┌─ PLDM Core Services ─────────────────┐**
- ┌─────────────┐ ┌──────────────────┐ │
- Base Handler│ │ Platform Handler  │ │
- ┘ └──────────────────┘ │
- ┌─────────────┐ ┌──────────────────┐ │
- BIOS Handler │ │ FRU Handler      │ │
- ┘ └──────────────────┘ │
- ┘

b) Configuration Management:
**┌─ Configuration ──────┐**
- ┌─────────┐         │
- PDR JSON │         │
- ┘         │
- ┌─────────┐         │
- BIOS JSON│         │
- ┘         │
- ┘

##### Notes Section

Technical notes for:
- System requirements
- Configuration dependencies
- Runtime behavior
- Extension mechanisms

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Applications
        Tools["Tools & Utilities"]:::tools
        PDRVis["PDR Visualization"]:::tools
        FWUpdate["FW Update Tool"]:::tools
    end

    subgraph CoreServices
        PLDMD["PLDM Daemon"]:::core
        ReqHandler["Request/Response Handler"]:::core
        LibPLDM["libpldmresponder"]:::core
        EventMgr["Event Management"]:::core
        EventParser["Event Parser"]:::core
        PlatformMgr["Platform Manager"]:::core
    end

    subgraph Handlers
        BaseHandler["Base Handler"]:::handler
        BIOSHandler["BIOS Handler"]:::handler
        FRUHandler["FRU Handler"]:::handler
        PlatformHandler["Platform Handler"]:::handler
        StateHandler["Platform State Handler"]:::handler
    end

    subgraph Configuration
        PDRRepo["PDR Repository"]:::config
        BIOSConfig["BIOS Configuration"]:::config
        ConfigMgmt["Configuration Management"]:::config
    end

    subgraph OEMExtensions
        IBMExt["IBM Extensions"]:::oem
        AmpereExt["Ampere Extensions"]:::oem
    end

    subgraph Transport
        MCTP["MCTP Transport Layer"]:::transport
    end

    %% Core Relationships
    PLDMD --> ReqHandler
    ReqHandler --> LibPLDM
    LibPLDM --> BaseHandler
    LibPLDM --> BIOSHandler
    LibPLDM --> FRUHandler
    LibPLDM --> PlatformHandler
    LibPLDM --> StateHandler
    PLDMD --> MCTP

    %% Configuration Flow
    PDRRepo --> ConfigMgmt
    BIOSConfig --> BIOSHandler
    ConfigMgmt --> PLDMD

    %% Event Flow
    EventMgr --> PLDMD
    EventParser --> EventMgr
    PlatformMgr --> EventMgr

    %% OEM Integration
    IBMExt -.-> LibPLDM
    AmpereExt -.-> LibPLDM

    %% Tools Integration
    Tools --> PLDMD
    PDRVis --> PDRRepo
    FWUpdate --> PLDMD

    %% Styling
    classDef core fill:#2374ab
    classDef handler fill:#048ba8
    classDef config fill:#16db93
    classDef transport fill:#efea5a
    classDef tools fill:#f29e4c
    classDef oem fill:#f1c453

    %% Click Events
    click PLDMD "https://github.com/openbmc/pldm/blob/master/pldmd/pldmd.cpp"
    click ReqHandler "https://github.com/openbmc/pldm/blob/master/pldmd/handler.hpp"
    click LibPLDM "https://github.com/openbmc/pldm/blob/master/libpldmresponder/base.hpp"
    click PDRRepo "https://github.com/openbmc/pldm/tree/master/configurations/pdr/"
    click BIOSHandler "https://github.com/openbmc/pldm/blob/master/libpldmresponder/bios.hpp"
    click MCTP "https://github.com/openbmc/pldm/blob/master/common/transport.hpp"
    click ConfigMgmt "https://github.com/openbmc/pldm/tree/master/configurations/"
    click EventMgr "https://github.com/openbmc/pldm/blob/master/platform-mc/event_manager.hpp"
    click IBMExt "https://github.com/openbmc/pldm/tree/master/oem/ibm/"
    click AmpereExt "https://github.com/openbmc/pldm/tree/master/oem/ampere/"
    click FRUHandler "https://github.com/openbmc/pldm/blob/master/libpldmresponder/fru.hpp"
    click PlatformMgr "https://github.com/openbmc/pldm/blob/master/platform-mc/platform_manager.hpp"
    click FWUpdate "https://github.com/openbmc/pldm/tree/master/tools/fw-update/"
    click PDRVis "https://github.com/openbmc/pldm/tree/master/tools/visualize-pdr/"
    click BIOSConfig "https://github.com/openbmc/pldm/blob/master/libpldmresponder/bios_config.hpp"
    click EventParser "https://github.com/openbmc/pldm/blob/master/libpldmresponder/event_parser.hpp"
    click StateHandler "https://github.com/openbmc/pldm/blob/master/libpldmresponder/platform_state_effecter.hpp"
```
