# tactcomplabs/rev architecture

> Architecture diagram of the GitHub repository tactcomplabs/rev, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tactcomplabs/rev
- Repository: https://github.com/tactcomplabs/rev

## Overview

##### Main Components

a) Core Simulation Components:
- RevCPU (Central controller)
- RevProc (Processor implementation)
- RevHart (Hardware thread)
- RevMem (Memory subsystem)
- RevMemCtrl (Memory controller)
- RevLoader (ELF binary loader)
- RevTracer (Execution tracer)
- RevNIC (Network interface)
- RevCoProc (Co-processor interface)

b) Instruction Support:
- RV32/RV64 ISA implementations
- Extension modules (RV32/64 A/D/F/I/M/P)
- Custom instruction support

c) External Interfaces:
- SST Core Integration
- System Call Interface
- Network Interface

##### Relationships and Data Flow

- SST Core as the top-level container
- RevCPU component connecting to other SST components
- Internal flow between RevCPU → RevProc → RevHart
- Memory hierarchy: RevHart ↔ RevMem ↔ RevMemCtrl
- Instruction flow: RevLoader → RevProc → ISA modules
- External interfaces: RevNIC, RevSysCalls

##### Implementation Details

- Component modularity (shown by clear boundaries)
- Support for heterogeneous cores (multiple machine configurations)
- Memory interaction paths
- Instruction execution pipeline
- System call and I/O paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef sst fill:#D3D3D3,stroke:#333
    classDef core fill:#B3D9FF,stroke:#333
    classDef insn fill:#90EE90,stroke:#333
    classDef interface fill:#FFE5B4,stroke:#333
    classDef memory fill:#FFB6C1,stroke:#333

    %% SST Framework Layer
    subgraph SST["SST Framework"]
        SSTCore["SST Core"]
        SSTInt["SST Integration"]
    end

    %% Rev Component Interface Layer
    subgraph RevComponents["Rev Component Layer"]
        RevCPU["RevCPU Controller"]
        RevTracer["RevTracer"]
        RevLoader["ELF Loader"]
    end

    %% Core Simulation Layer
    subgraph CoreSim["Core Simulation Layer"]
        RevProc["RevProc"]
        RevHart["RevHart"]
        RevCoProc["Co-Processor"]
    end

    %% Instruction Layer
    subgraph Instructions["Instruction Support"]
        RV32["RV32 ISA"]
        RV64["RV64 ISA"]
        CustomInsn["Custom Instructions"]
    end

    %% Memory and I/O Layer
    subgraph MemoryIO["Memory and I/O Layer"]
        RevMem["RevMem"]
        RevMemCtrl["Memory Controller"]
        RevNIC["Network Interface"]
        SysCalls["System Calls"]
    end

    %% Relationships
    SSTCore --> SSTInt
    SSTInt --> RevCPU
    RevCPU --> RevProc
    RevCPU --> RevTracer
    RevLoader --> RevProc
    RevProc --> RevHart
    RevHart --> RevCoProc
    RevHart --> RevMem
    RevMem --> RevMemCtrl
    RevHart --> RV32
    RevHart --> RV64
    RevHart --> CustomInsn
    RevHart --> RevNIC
    RevHart --> SysCalls

    %% Click events for component mapping
    click RevCPU "https://github.com/tactcomplabs/rev/blob/main/include/RevCPU.h"
    click RevProc "https://github.com/tactcomplabs/rev/blob/main/include/RevProc.h"
    click RevHart "https://github.com/tactcomplabs/rev/blob/main/include/RevHart.h"
    click RevMem "https://github.com/tactcomplabs/rev/blob/main/include/RevMem.h"
    click RevMemCtrl "https://github.com/tactcomplabs/rev/blob/main/include/RevMemCtrl.h"
    click RevLoader "https://github.com/tactcomplabs/rev/blob/main/include/RevLoader.h"
    click RevTracer "https://github.com/tactcomplabs/rev/blob/main/include/RevTracer.h"
    click RevNIC "https://github.com/tactcomplabs/rev/blob/main/include/RevNIC.h"
    click RevCoProc "https://github.com/tactcomplabs/rev/blob/main/include/RevCoProc.h"
    click RV32 "https://github.com/tactcomplabs/rev/tree/main/include/insns"
    click RV64 "https://github.com/tactcomplabs/rev/tree/main/include/insns"
    click SysCalls "https://github.com/tactcomplabs/rev/blob/main/common/syscalls/syscalls.h"
    click SSTInt "https://github.com/tactcomplabs/rev/blob/main/include/SST.h"

    %% Legend
    subgraph Legend
        L1["SST Components"]:::sst
        L2["Core Components"]:::core
        L3["Instruction Components"]:::insn
        L4["Interface Components"]:::interface
        L5["Memory Components"]:::memory
    end

    %% Apply styles
    class SSTCore,SSTInt sst
    class RevCPU,RevProc,RevHart,RevTracer,RevLoader,RevCoProc core
    class RV32,RV64,CustomInsn insn
    class RevNIC,SysCalls interface
    class RevMem,RevMemCtrl memory
```
