# ucb-bar/constellation architecture

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

- Interactive diagram: https://gitdiagram.com/ucb-bar/constellation
- Repository: https://github.com/ucb-bar/constellation

## Overview

##### Project Overview and Architecture Identification
- The README clearly establishes that Constellation is a Chisel-based NoC generator used as the interconnect fabric for heterogeneous many-core and many-accelerator SoCs. The framework generates packet-switched, wormhole-routed NoCs with virtual networks, credit-based flow control, support for irregular/hierarchical topologies, and protocol-independent transport (supporting AXI-4 and Tilelink).
- The project structure (especially the “src/main/scala” directories) shows distinct modules for channels, routers, protocols, routing, and SoC integration. There are also portions for configuration and testing, as seen in the “docs” and “src/test” directories.

##### Analyzing the File Structure for Architectural Components
- Core Components:
- Channel: Implements the basic communication primitives (files like Buffer.scala, Channel.scala, Flit.scala, Monitor.scala, and more).
- NoC: The “noc” directory (NoC.scala, Parameters.scala) likely models the overall network interconnect fabric.
- Router: Implements router functionality including control, ingress/egress units, switching logic, allocation algorithms, etc. (see various files in the “router” directory, including additional virtual-channel flow control logic under “router/vcalloc”).
- Protocol Adapters: The “protocol” directory shows support for different communication protocols such as AXI4 and Tilelink.
- SoC Integration: The “soc” folder contains files like Buses.scala, Configs.scala, GlobalNoC.scala; this indicates integration logic for embedding the NoC into a larger SoC environment.
- Routing and Topologies: The “routing” and “topology” directories (RoutingRelations.scala, Types.scala, Topologies.scala, TopologyPlotters.scala) are involved in defining routing strategies and network topologies.
- Testing and Verification: The test harnesses under “src/main/scala/test” indicate simulation and evaluation components (e.g., AXI4TestHarness.scala, TrafficEvalHarness.scala).

- Supporting Materials:
- Native C/C++ (in “src/main/resources/csrc”) and possibly Verilog (in “vsrc”) support low-level simulation and synthesis aspects.

##### Specific Elements the Principal Software Engineer Should Include
- Clear Labels: Each module (e.g., Channel Module, Router Module, Protocol Adapter, SoC Integration, Simulation/Testing Environment) must be labeled clearly.
- Annotations: Include notes on the routing algorithms, credit-based flow control, and virtual network support where relevant.
- Integration Points: Highlight where external libraries and documentation (like integration with Chipyard/Rocketchip or protocol adapters like AXI4 and Tilelink) fit into the overall architecture.

##### Final Advice – Emphasize Clarity and Granularity
- That all primary components (channels, routers, protocols, topology management, SoC integration, and testing layers) are represented.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration & Documentation Layer
    subgraph "Configuration & Documentation Layer"
        Config["Configuration & Documentation"]:::config
    end

    %% Core NoC Generator Engine
    subgraph "Core NoC Generator Engine"
        CH["Channel Module"]:::core
        NOC["NoC Fabric"]:::core
        ROUTER["Router Module"]:::core
        ROUTING["Routing"]:::core
        TOPOLOGY["Topology"]:::core
    end

    %% Protocol Abstraction Layer
    subgraph "Protocol Abstraction Layer"
        PROTO["Protocol Adapters"]:::protocol
    end

    %% SoC Integration Layer
    subgraph "SoC Integration Layer"
        SOCINT["SoC Integration"]:::soc
    end

    %% Testing & Verification Layer
    subgraph "Testing & Verification"
        TEST["Test Harness"]:::test
    end

    %% Simulation & Low-level Hardware Layer
    subgraph "Simulation & Low-level Hardware"
        SIM["Sim & HW Components"]:::sim
    end

    %% Data Flow
    Config --> CH
    CH --> NOC
    NOC --> ROUTER
    ROUTER --> ROUTING
    ROUTING --> TOPOLOGY
    TOPOLOGY --> PROTO
    PROTO --> SOCINT
    SOCINT --> TEST
    TEST --> SIM
    %% Feedback Loop from Testing back to Router
    TEST ---|feedback| ROUTER

    %% Click Events
    click Config "https://github.com/ucb-bar/constellation/tree/master/docs/source/Configuration"
    click CH "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/channel"
    click NOC "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/noc"
    click ROUTER "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/router"
    click ROUTING "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/routing"
    click TOPOLOGY "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/topology"
    click PROTO "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/protocol"
    click SOCINT "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/soc"
    click TEST "https://github.com/ucb-bar/constellation/tree/master/src/main/scala/test"
    click SIM "https://github.com/ucb-bar/constellation/tree/master/src/main/resources/csrc"

    %% Styles
    classDef config fill:#f9c74f,stroke:#333,stroke-width:2px,color:#000;
    classDef core fill:#90be6d,stroke:#333,stroke-width:2px,color:#000;
    classDef protocol fill:#f9844a,stroke:#333,stroke-width:2px,color:#000;
    classDef soc fill:#577590,stroke:#fff,stroke-width:2px,color:#fff;
    classDef test fill:#277da1,stroke:#333,stroke-width:2px,color:#fff;
    classDef sim fill:#4d908e,stroke:#333,stroke-width:2px,color:#fff;
```
