# kowdoorshashank/amba5-chi architecture

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

- Interactive diagram: https://gitdiagram.com/kowdoorshashank/amba5-chi
- Repository: https://github.com/kowdoorshashank/amba5-chi

## Overview

##### Project Type and Purpose
- This is a SystemVerilog hardware-design and verification project focusing on a CHI (Cache-Coherent Hub Interface) requester node and home node.
- The primary goal is to simulate and verify CHI protocol behavior: two DUT modules (`chi_requester_node.sv` and `chi_home_node.sv`) interconnected via CHI signals, driven and observed by a SystemVerilog testbench (`chi_testbench.sv`).

##### File‐Structure Analysis
- Top‐level files:
- chi_pkg.sv – package defining CHI parameters, types, interfaces
- chi_requester_node.sv – the requester DUT module
- chi_home_node.sv – the home node DUT module
- chi_testbench.sv – top‐level testbench that instantiates both DUTs and performs stimulus/checking
- README.md – link to EDA Playground for quick simulation

##### Key Points from README
- Simulation is intended to run on EDA Playground (link provided).
- No higher‐level application or software component—pure hardware simulation environment.

##### Main Components
a. Testbench Harvest (chi_testbench)
- Clock generator
- Reset logic
- Stimulus driver (generates CHI transactions)
- Checker/monitor logic
b. DUT: chi_requester_node
c. DUT: chi_home_node
d. Shared CHI interface (bus)
e. chi_pkg (parameter definitions, interface declarations)

##### Relationships & Interactions
- The testbench block instantiates both DUT modules and the `chi_pkg` for interface bindings.
- A single CHI bus (a bundle of request/response channels) interconnects the requester node to the home node.
- The testbench drives requests into the requester node, which sends transactions over the CHI bus to the home node.
- The home node responds via the same bus back to the requester; the testbench monitors responses.

##### Architectural Patterns & Principles
- Modular hierarchy: `chi_pkg` → DUT modules → top‐level testbench.
- Separation of concerns:
- Parameter and interface definitions in a package
- Pure DUT logic in separate modules
- Testbench harness for stimulus and observation
- Use of SystemVerilog interfaces and parameterization for scalability

##### Technologies & Frameworks
- SystemVerilog (design + verification constructs)
- EDA Playground (simulation environment)

##### Final Advice
- Be exhaustive: show every logical block (stimulus driver, monitor, interface definitions).
- Keep hierarchy clear: top‐level testbench above, DUT modules below.
- Use consistent naming to reflect file/module names.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Package
    chi_pkg["chi_pkg.sv\n(Parameters & Interfaces)"]:::pkg

    %% Testbench Subgraph
    subgraph "chi_testbench.sv (Top-Level Testbench)"
        direction TB
        ClockGen["Clock Generator"]:::tb
        ResetLogic["Reset Logic"]:::tb
        StimulusDriver["Stimulus Driver"]:::tb
        CheckerMonitor["Checker/Monitor"]:::tb
    end

    %% DUT Modules
    chi_requester_node["chi_requester_node.sv\n(Requester DUT)"]:::dut
    chi_home_node["chi_home_node.sv\n(Home DUT)"]:::dut

    %% CHI Interface Bus
    CHI_Bus["CHI Interface\n(Request/Response Bus)"]:::bus

    %% Connections
    chi_pkg --> chi_requester_node
    chi_pkg --> chi_home_node
    chi_pkg --> ClockGen

    ClockGen --> chi_requester_node
    ClockGen --> chi_home_node
    ResetLogic --> chi_requester_node
    ResetLogic --> chi_home_node

    StimulusDriver -->|"drive req_*"| chi_requester_node
    chi_requester_node -->|"req_* over CHI"| CHI_Bus
    CHI_Bus -->|"rsp_* over CHI"| chi_home_node
    chi_home_node -->|"rsp_* over CHI"| CHI_Bus
    CHI_Bus --> chi_requester_node
    chi_home_node -->|"send responses"| CheckerMonitor

    %% Click Events
    click chi_pkg "https://github.com/kowdoorshashank/amba5-chi/blob/main/chi_pkg.sv"
    click chi_requester_node "https://github.com/kowdoorshashank/amba5-chi/blob/main/chi_requester_node.sv"
    click chi_home_node "https://github.com/kowdoorshashank/amba5-chi/blob/main/chi_home_node.sv"
    click chi_testbench "https://github.com/kowdoorshashank/amba5-chi/blob/main/chi_testbench.sv"

    %% Styles
    classDef dut fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef tb fill:#90EE90,stroke:#000,stroke-width:1px
    classDef pkg fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef bus fill:#FFFFFF,stroke:#000,stroke-width:4px,stroke-dasharray: 4 2
```
