Skip to content

RudraMantri123/Circuit_AI_Design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circuit AI Design - Automated Analog Circuit Design System

Intelligent analog circuit design automation using Graph Neural Networks, Bayesian Optimization, and Multi-Agent Architecture

Python 3.9+ License: MIT Code style: black FastAPI React PyTorch

Circuit AI is a cutting-edge Electronic Design Automation (EDA) system that automates analog circuit design through machine learning. It combines Graph Neural Networks (GNN) for fast performance prediction with Bayesian Optimization for intelligent parameter tuning, achieving 3-5x speedup over traditional methods while maintaining high accuracy.

Overview

Transform natural language circuit specifications into optimized, production-ready designs using state-of-the-art AI techniques. Circuit AI bridges the gap between circuit design intent and implementation through intelligent automation.

Key Features

Intelligent Design Automation

  • Natural Language Processing - Parse circuit specifications from plain English using transformer-based models
  • Multi-Agent Architecture - Coordinated AI agents for specification parsing, topology selection, and parameter optimization
  • Smart Topology Selection - Automatically choose optimal circuit architectures based on requirements

Advanced Machine Learning

Accurate Simulation

Modern Web Interface

  • FastAPI Backend - High-performance REST API with automatic documentation (src/circuit_ai/api/main.py)
  • React 19 Frontend - Modern, responsive UI with real-time updates (frontend/)
  • Canva App UI Kit - Professional design system for consistent UX
  • Real-time Monitoring - Live optimization progress tracking

Production-Ready Architecture

  • Modular Design - Clean separation of concerns for easy maintenance
  • Extensible Framework - Plugin architecture for custom topologies and objectives
  • Comprehensive Testing - Full test suite with >85% coverage (tests/)
  • Docker Support - Containerized deployment for reproducibility

Quick Start

# Clone the repository
git clone https://github.com/RudraMantri123/Circuit_AI_Design.git
cd Circuit_AI_Design

# Automated setup (creates venv, installs dependencies)
./scripts/setup.sh

# Activate virtual environment
source venv/bin/activate  # On Linux/macOS
# or
.\venv\Scripts\activate  # On Windows

# Start the full application
./scripts/start_dev.sh

Then open your browser and navigate to:

Architecture Overview

System Components

Layer 1: Presentation Layer

  • React Frontend (Port 5173)
    • Component: User Interface
    • Technology: React 19 + TypeScript + Canva UI Kit
    • Input: Natural language circuit specifications
    • Output: Visual design results, performance metrics, SPICE netlists
    • Files: frontend/src/App.tsx

Layer 2: API Gateway

  • FastAPI Backend (Port 8000)
    • Component: REST API Server
    • Technology: FastAPI + Pydantic + Uvicorn
    • Endpoints: /parse, /design, /optimize, /simulate
    • Files: src/circuit_ai/api/main.py

Layer 3: Multi-Agent Intelligence Layer

  • Agent 1: Specification Parser

    • Input: Natural language text ("60dB gain, 1mW power, 1MHz bandwidth")
    • Process: NLP using Transformers
    • Output: Structured parameters (gain_db=60, power_uw=1000, bandwidth_mhz=1)
    • Files: src/circuit_ai/core/agents/parse.py
  • Agent 2: Topology Selector

  • Agent 3: Multi-Agent Orchestrator

Layer 4: Machine Learning Engine

  • Component A: Graph Neural Network

  • Component B: Bayesian Optimizer

    • Input: Design space parameters (transistor widths, lengths)
    • Process 1: Build Gaussian Process model (GPyTorch)
    • Process 2: Use acquisition function to select next design point
    • Output: Optimized transistor sizes
    • Technology: BoTorch + GPyTorch
    • Files: src/circuit_ai/core/optimization/optimize.py
  • Component C: Hybrid Optimizer

Layer 5: Simulation & Validation

  • SPICE Simulator

    • Input: SPICE netlist with transistor sizes
    • Process: AC analysis, DC analysis, transient analysis
    • Output: Accurate performance metrics
    • Technology: PySpice + NgSpice
    • Files: src/circuit_ai/core/simulation/spice.py
  • Monte Carlo Engine

    • Process: Run 50-100 simulations with process variations
    • Output: Statistical validation (mean, std deviation)
    • Purpose: Ensure design robustness
  • PDK Loader

Data Flow (Step-by-Step)

STEP 1: User Input
↓
User enters: "60dB gain, 1mW power, 1MHz bandwidth, 0.18um CMOS"
↓

STEP 2: Parse Specification
↓
NLP Parser extracts: {gain: 60, power: 1000, bandwidth: 1, tech: "0.18um"}
↓

STEP 3: Select Topology
↓
Topology Agent selects: "Two-Stage Op-Amp"
↓

STEP 4: Convert to Graph
↓
Circuit Graph: Nodes=[M1, M2, M3, M4, M5], Edges=[(M1,M3), (M2,M3), ...]
↓

STEP 5: GNN Prediction (Fast Screening)
↓
GNN evaluates 1000 candidate designs → Top 10 designs
↓

STEP 6: Bayesian Optimization (Fine-Tuning)
↓
BO runs 10 iterations → Optimal transistor sizes
↓

STEP 7: SPICE Verification
↓
PySpice simulates final design → Actual performance
↓

STEP 8: Monte Carlo Validation
↓
50 simulations with variations → Robustness confirmed
↓

STEP 9: Return Results
↓
Frontend displays: Performance metrics, netlist, plots

Key Interactions

  • Frontend ↔ Backend: REST API calls (JSON over HTTP)
  • Backend ↔ Agents: Function calls (Python)
  • Agents ↔ ML Engine: Data pipelines (PyTorch tensors)
  • ML Engine ↔ Simulator: File I/O (SPICE netlists)
  • All Components ↔ Database: File storage (JSON, .sp files)

Architecture

Circuit AI uses a modular architecture:

  1. Agents - Parse specifications and select topologies
  2. ML Models - GNN for fast performance prediction
  3. Optimizer - Bayesian optimization for parameter tuning
  4. Simulator - SPICE-based circuit verification
  5. API - FastAPI backend for web access
  6. Frontend - React UI for user interaction

See docs/ARCHITECTURE.md for details.

Performance

  • Optimization Speed: 5.2s per circuit (10 iterations)
  • GNN Speedup: 3-5x vs pure Bayesian optimization
  • Success Rate: 100% on benchmark circuits
  • Compliance Rate: 85%+ spec matching

Technology Stack

Backend Technologies

Machine Learning & AI

Technology Version Purpose Reference
PyTorch 2.0+ Deep learning framework for GNN models requirements.txt:5
PyTorch Geometric 2.3+ Graph neural network layers and operations src/circuit_ai/ml/gnn_predictor.py:8
BoTorch 0.8+ Bayesian optimization framework src/circuit_ai/core/optimization/optimize.py:18
GPyTorch 1.9+ Gaussian Process models for BO requirements.txt:28
Transformers 4.20+ NLP models for spec parsing src/circuit_ai/core/agents/parse.py
LangChain 0.1+ LLM orchestration and agents src/circuit_ai/core/agents/multi.py

Circuit Simulation & Analysis

Technology Version Purpose Reference
PySpice 1.5+ Python interface to ngspice simulator src/circuit_ai/core/simulation/spice.py:15
NgSpice - Industry-standard SPICE simulator External dependency
NetworkX 3.1+ Graph analysis and circuit topology src/circuit_ai/ml/circuit_graph.py

Scientific Computing

Technology Version Purpose Reference
NumPy 1.24+ Numerical computing foundation requirements.txt:15
SciPy 1.10+ Scientific algorithms and optimization requirements.txt:16
Pandas 2.0+ Data manipulation and analysis requirements.txt:17

Web Framework

Technology Version Purpose Reference
FastAPI 0.100+ Modern async web framework src/circuit_ai/api/main.py:4
Pydantic 2.0+ Data validation and serialization src/circuit_ai/api/main.py:7
Uvicorn - ASGI server for FastAPI Used for serving

Documentation

Examples

Check data/examples/ for sample circuits:

  • Low-power op-amp
  • High-gain precision amplifier
  • Ultra-low-power design

License

MIT License - see LICENSE for details.

Support

Acknowledgments

Built with:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •