# wuhy68/chatedav1 architecture

> Architecture diagram of the GitHub repository wuhy68/chatedav1, 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/wuhy68/chatedav1
- Repository: https://github.com/wuhy68/chatedav1

## Overview

##### Project Type and Purpose
- ChatEDAv1 is a specialized autonomous agent built for Electronic Design Automation. It integrates a fine-tuned large language model (named AutoMage) with a suite of EDA tools. The system is responsible for managing the complex design flow—from Register-Transfer Level (RTL) description to final GDSII outputs—by planning tasks, generating scripts, and executing them through defined interfaces.
- The README describes how ChatEDA leverages a set of EDA tools (with an example being the OpenRoad API) and also provides data sets – one for training (ChatEDA-train-example.json) and another benchmark for evaluation (ChatEDA-Bench.txt).

##### File Structure
- Top-level directories/files include:
- LICENSE and README.md for licensing and project overview.
- api_doc/: Contains API documentation and implementation files (openroad_api.py, openroad_api_impl.py, and parse_mk_config.py). This part is crucial as it defines the interface layer between the ChatEDA controller and the underlying EDA tools.
- data/: Includes train and test subdirectories. These hold the training datasets for fine-tuning AutoMage as well as benchmark examples to evaluate the system.
- The structure shows separation between API (for interfacing with EDA tool functionalities) and data (for training and evaluation).

##### Key Components
a. LLM Component – AutoMage Model:
- Represents the autonomous intelligence driving the decision-making and script generation.
- This component receives high-level design tasks and produces actionable instructions.
b. EDA Tool Chain:
- Represented by the API documented in api_doc (e.g., the OpenRoad API and its implementation). These tools act as executors that carry out the design tasks on the RTL/GDSII flow.
- This layer might include additional EDA tools if integrated further.
c. Data Repositories:
- Training Data: Found under data/train (e.g., ChatEDA-train-example.json) that is used to fine-tune the AutoMage model.
- Evaluation Benchmark: Found under data/test (e.g., ChatEDA-Bench.txt) for comprehensive performance evaluations.
d. Orchestrator/Controller:
- While not explicitly a separate file, the design flow implies a component (the autonomous agent "ChatEDA") that controls interactions between the LLM and the EDA tools. This can be represented as a middleware layer coordinating the overall process.

##### Establish Relationships and Interactions
- Data Flow:
- Training Data → Fine-tuning process → AutoMage (LLM).
- User Requirements/Design Specifications/input tasks (implied) are processed by the AutoMage model.
- AutoMage then generates a series of instructions which are passed to the EDA Tool Chain via the OpenRoad API.
- The EDA tools execute the tasks, and their outputs (design artifacts) may be used for further evaluation.
- Integration Flow:

##### Architectural Principles
- Separation of concerns – clearly divide the system into data, intelligence, middleware, and execution modules.
- That build or orchestration scripts (as implied by the file tree) are represented if they further detail how components interact.
- That the system’s design enables modularity, allowing potential updates or expansions (e.g., adding new EDA tools or modifying the LLM).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    subgraph "Input Layer"
        input("User Design Requirements"):::input
    end

    %% Controller Layer
    subgraph "Controller"
        controller("ChatEDA Controller"):::controller
    end

    %% Intelligence Layer
    subgraph "Intelligence Layer"
        llm("AutoMage (LLM)"):::intelligence
    end

    %% Execution Layer
    subgraph "Execution Layer"
        eda_api("OpenRoad API"):::execution
        eda_api_impl("OpenRoad API Impl"):::execution
        config_parser("Config Parser Utility"):::utility
        design_outputs("Design Outputs"):::outputs
    end

    %% Data Layer
    subgraph "Data Layer"
        training("Training Data"):::data
        evaluation("Evaluation Data"):::data
    end

    %% Connections
    input -->|"designInput"| controller
    controller -->|"generateTasks"| llm
    llm -->|"actionableInstructions"| controller
    training -->|"fineTuningData"| llm
    controller -->|"executeCommands"| eda_api
    eda_api -->|"callsImplementation"| eda_api_impl
    eda_api_impl -->|"producesDesign"| design_outputs
    design_outputs -->|"evaluatedBy"| evaluation
    config_parser -->|"configures"| eda_api
    config_parser -->|"configures"| eda_api_impl

    %% Click Events
    click eda_api "https://github.com/wuhy68/chatedav1/blob/master/api_doc/openroad_api.py"
    click eda_api_impl "https://github.com/wuhy68/chatedav1/blob/master/api_doc/openroad_api_impl.py"
    click config_parser "https://github.com/wuhy68/chatedav1/blob/master/api_doc/parse_mk_config.py"
    click training "https://github.com/wuhy68/chatedav1/blob/master/data/train/ChatEDA-train-example.json"
    click evaluation "https://github.com/wuhy68/chatedav1/blob/master/data/test/ChatEDA-Bench.txt"

    %% Styles
    classDef input fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef controller fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef intelligence fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef execution fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef utility fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef outputs fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
    classDef data fill:#D6EAF8,stroke:#2874A6,stroke-width:2px;
```
