# mortbopet/ripes architecture

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

- Interactive diagram: https://gitdiagram.com/mortbopet/ripes
- Repository: https://github.com/mortbopet/ripes

## Overview

##### Main Components Identification
The system can be broken down into these major components:

a. Core Components:
- Processor Simulation Engine (src/processors/)
- Assembler (src/assembler/)
- Cache Simulator (src/cachesim/)
- I/O System (src/io/)
- Editor System (src/editor/)

b. Supporting Components:
- CLI Interface (src/cli/)
- GUI Components (src/*)
- System Call Interface (src/syscall/)

**┌─────────────────────── User Interface Layer ───────────────────────┐**

- ┌─────────────┐  ┌──────────────┐  ┌───────────┐  ┌──────────┐  │
- Editor    │  │  Memory View │  │  Console  │  │ IO View  │  │
- ┘  └──────────────┘  └───────────┘  └──────────┘  │

- Core Logic Layer ─────────────────────────┐ │

- ┌─────────────┐  ┌──────────────┐  ┌───────────────────────┐ │ │
- Assembler  │  │   Processor  │  │    Cache Simulator    │ │ │
- System    │◄─►│  Simulation │◄─►│                     │ │ │
- ┘  └──────────────┘  └───────────────────────┘ │ │
- ▲                  ▲                     ▲             │ │

- ┌─────────────┐  ┌──────────────┐  ┌───────────────────────┐ │ │
- ISA      │  │     I/O      │  │    System Calls      │ │ │
- Handlers   │  │   Manager    │  │      Handler         │ │ │
- ┘  └──────────────┘  └───────────────────────┘ │ │

- ┘

##### Key Relationships to Highlight

a. Data Flow:
- Editor → Assembler → Processor Simulation
- Processor Simulation ↔ Cache Simulator
- Processor Simulation ↔ I/O Manager
- System Calls ↔ Processor Simulation

b. Control Flow:
- User Interface → Core Components
- ISA Handlers → Processor Simulation
- I/O Manager → User Interface

##### Important Implementation Details

- Multiple processor model support (RV32IMC/RV64IMC)
- Cache configuration flexibility
- Memory-mapped I/O system
- Integration between C/Assembly code editing and simulation
- System call interface for OS-like functionality

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        Editor["Editor System"]
        MemView["Memory View"]
        Console["Console"]
        IOView["I/O View"]
    end

    subgraph Core["Core Logic Layer"]
        Assembler["Assembler System"]
        Processor["Processor Simulation"]
        Cache["Cache Simulator"]
        ISA["ISA Handlers"]
        IO["I/O Manager"]
        Syscall["System Calls Handler"]
    end

    %% Relationships
    Editor --> Assembler
    Assembler <--> Processor
    Processor <--> Cache
    Processor <--> IO
    IO --> IOView
    Processor <--> Syscall
    ISA --> Processor
    Console --> Syscall

    %% Click events
    click Editor "https://github.com/mortbopet/Ripes/tree/master/src/editor/"
    click Assembler "https://github.com/mortbopet/Ripes/tree/master/src/assembler/"
    click Processor "https://github.com/mortbopet/Ripes/tree/master/src/processors/"
    click Cache "https://github.com/mortbopet/Ripes/tree/master/src/cachesim/"
    click IO "https://github.com/mortbopet/Ripes/tree/master/src/io/"
    click Syscall "https://github.com/mortbopet/Ripes/tree/master/src/syscall/"
    click ISA "https://github.com/mortbopet/Ripes/tree/master/src/isa/"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef support fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#e67e22,stroke:#d35400,color:white

    class Editor,MemView,Console,IOView ui
    class Assembler,Processor,Cache core
    class ISA,IO,Syscall support

    %% Legend
    subgraph Legend
        UI_Comp["UI Component"]:::ui
        Core_Comp["Core Component"]:::core
        Support_Comp["Support System"]:::support
    end
```
