# autoas/ssas-public architecture

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

- Interactive diagram: https://gitdiagram.com/autoas/ssas-public
- Repository: https://github.com/autoas/ssas-public

## Overview

##### Main Components

a. Infrastructure Layer (infras/)
- Communication Stack
- AUTOSAR Communication Modules (CanIf, CanTp, LinIf, LinTp, PduR, Com)
- Network Protocols (SOME/IP, DoIP, SD, TCP/IP)
- Diagnostic Stack (Dcm, Dem)
- Memory Stack (NvM, Fee, Ea)
- System Services (OS, File System, Shell, Timer, Trace)
- Libraries (CRC, DDS, Memory Pool, Utils)

b. MCAL Layer (infras/mcal/)
- Hardware Abstraction (Eep, Fls)

c. Application Layer (app/)
- Main Application
- Bootloader
- Platform-specific code
- Example Applications

d. Tools Layer (tools/)
- Generators
- GUI Tools (asone)
- Libraries (CanLib, LinLib, DevLib)
- JSON Editor

**┌─────────────────────────────────────────────────────────┐**
- Application Layer                       │
- (Application, Bootloader, Examples)                    │
- ┤
- RTE Layer                              │
- ┤
- Services Layer                           │
- ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐  │
- Communication│ │  Diagnostics │ │  Memory Services │  │
- (COM/NM)   │ │  (DCM/DEM)  │ │    (NVM/FEE)    │  │
- ┘ └──────────────┘ └──────────────────┘  │
- ┤
- MCAL Layer                             │
- (Hardware Abstraction - CAN, LIN, EEP, FLS)         │
- ┘

##### Key Relationships

- Data flow between communication modules (CAN/LIN → TP → PDU Router → COM/DCM)
- Diagnostic request/response paths
- Memory management flow
- Tool integration points

##### Additional Elements

- Version information (AUTOSAR 4.4)
- External interfaces (hardware abstraction points)
- Configuration flow from tools to modules

##### Implementation Details

Remember to include the tools layer as a separate section showing how it interfaces with the main architecture, particularly the configuration and simulation aspects.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef app fill:#f9f,stroke:#333,stroke-width:2px
    classDef comm fill:#9cf,stroke:#333,stroke-width:2px
    classDef diag fill:#9f9,stroke:#333,stroke-width:2px
    classDef mem fill:#ff9,stroke:#333,stroke-width:2px
    classDef sys fill:#ddd,stroke:#333,stroke-width:2px
    classDef mcal fill:#f90,stroke:#333,stroke-width:2px
    classDef tools fill:#fc9,stroke:#333,stroke-width:2px
    classDef lib fill:#ccc,stroke:#333,stroke-width:2px

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        App["Main Application"]:::app
        Boot["Bootloader"]:::app
        Examples["Examples"]:::app
        Platform["Platform"]:::app
    end

    %% Infrastructure Layer - Communication
    subgraph CommStack["Communication Stack"]
        CanIf["CAN Interface"]:::comm
        CanTp["CAN Transport"]:::comm
        LinIf["LIN Interface"]:::comm
        LinTp["LIN Transport"]:::comm
        PduR["PDU Router"]:::comm
        Com["COM"]:::comm
        SomeIp["SOME/IP"]:::comm
        DoIP["DoIP"]:::comm
        Sd["Service Discovery"]:::comm
        TcpIp["TCP/IP"]:::comm
    end

    %% Infrastructure Layer - Diagnostic
    subgraph DiagStack["Diagnostic Stack"]
        Dcm["DCM"]:::diag
        Dem["DEM"]:::diag
    end

    %% Infrastructure Layer - Memory
    subgraph MemStack["Memory Stack"]
        NvM["NVM"]:::mem
        Fee["FEE"]:::mem
        Ea["EA"]:::mem
    end

    %% System Services
    subgraph SysServices["System Services"]
        OS["Operating System"]:::sys
        FS["File System"]:::sys
        Shell["Shell"]:::sys
        Timer["Timer"]:::sys
        Trace["Trace"]:::sys
    end

    %% MCAL Layer
    subgraph McalLayer["MCAL Layer"]
        Eep["EEPROM Driver"]:::mcal
        Fls["Flash Driver"]:::mcal
    end

    %% Tools Layer
    subgraph ToolsLayer["Tools Layer"]
        Asone["GUI Tool (asone)"]:::tools
        Generator["Generators"]:::tools
        JsonEditor["JSON Editor"]:::tools
        ToolLibs["Libraries"]:::tools
    end

    %% Libraries
    subgraph Libs["Libraries"]
        Crc["CRC"]:::lib
        Dds["DDS"]:::lib
        Mempool["Memory Pool"]:::lib
        Utils["Utils"]:::lib
    end

    %% Relationships
    CanIf --> CanTp
    LinIf --> LinTp
    CanTp & LinTp --> PduR
    PduR --> Com
    PduR --> Dcm
    SomeIp & DoIP --> TcpIp
    Sd --> SomeIp
    Dcm --> Dem
    NvM --> Fee
    Fee --> Ea
    Fee & Ea --> Eep
    Fee & Ea --> Fls

    %% Click events
    click App "https://github.com/autoas/ssas-public/tree/master/app/app/"
    click Boot "https://github.com/autoas/ssas-public/tree/master/app/bootloader/"
    click Examples "https://github.com/autoas/ssas-public/tree/master/app/examples/"
    click Platform "https://github.com/autoas/ssas-public/tree/master/app/platform/"
    click CanIf "https://github.com/autoas/ssas-public/tree/master/infras/communication/CanIf/"
    click CanTp "https://github.com/autoas/ssas-public/tree/master/infras/communication/CanTp/"
    click LinIf "https://github.com/autoas/ssas-public/tree/master/infras/communication/LinIf/"
    click LinTp "https://github.com/autoas/ssas-public/tree/master/infras/communication/LinTp/"
    click PduR "https://github.com/autoas/ssas-public/tree/master/infras/communication/PduR/"
    click Com "https://github.com/autoas/ssas-public/tree/master/infras/communication/Com/"
    click SomeIp "https://github.com/autoas/ssas-public/tree/master/infras/communication/SomeIp/"
    click DoIP "https://github.com/autoas/ssas-public/tree/master/infras/communication/DoIP/"
    click Sd "https://github.com/autoas/ssas-public/tree/master/infras/communication/Sd/"
    click TcpIp "https://github.com/autoas/ssas-public/tree/master/infras/communication/TcpIp/"
    click Dcm "https://github.com/autoas/ssas-public/tree/master/infras/diagnostic/Dcm/"
    click Dem "https://github.com/autoas/ssas-public/tree/master/infras/diagnostic/Dem/"
    click NvM "https://github.com/autoas/ssas-public/tree/master/infras/memory/NvM/"
    click Fee "https://github.com/autoas/ssas-public/tree/master/infras/memory/Fee/"
    click Ea "https://github.com/autoas/ssas-public/tree/master/infras/memory/Ea/"
    click OS "https://github.com/autoas/ssas-public/tree/master/infras/system/kernel/"
    click FS "https://github.com/autoas/ssas-public/tree/master/infras/system/fs/"
    click Shell "https://github.com/autoas/ssas-public/tree/master/infras/system/shell/"
    click Timer "https://github.com/autoas/ssas-public/tree/master/infras/system/timer/"
    click Trace "https://github.com/autoas/ssas-public/tree/master/infras/system/trace/"
    click Eep "https://github.com/autoas/ssas-public/tree/master/infras/mcal/Eep/"
    click Fls "https://github.com/autoas/ssas-public/tree/master/infras/mcal/Fls/"
    click Asone "https://github.com/autoas/ssas-public/tree/master/tools/asone/"
    click Generator "https://github.com/autoas/ssas-public/tree/master/tools/generator/"
    click JsonEditor "https://github.com/autoas/ssas-public/tree/master/tools/json.editor/"
    click ToolLibs "https://github.com/autoas/ssas-public/tree/master/tools/libraries/"
    click Crc "https://github.com/autoas/ssas-public/tree/master/infras/libraries/crc/"
    click Dds "https://github.com/autoas/ssas-public/tree/master/infras/libraries/dds/"
    click Mempool "https://github.com/autoas/ssas-public/tree/master/infras/libraries/mempool/"
    click Utils "https://github.com/autoas/ssas-public/tree/master/infras/libraries/utils/"
```
