This project is an independent, simplified implementation inspired by the WiseEDA framework, focused specifically on RC low‑pass filter design.
The system automates the entire design flow — from user intent to optimized circuit values — using:
The goal is to demonstrate how modern EDA concepts (simulation + optimization + intent parsing) can be applied even to simple analog circuits.
Free‑text + Form-based Inputs
Users can specify filter requirements either via structured forms or natural language text.
Topology Selection
Small library of RC low‑pass topologies:
Automatic Netlist Generation
Generates valid ngspice netlists based on topology and parameters.
Closed‑Loop Optimization
Iterative optimization loop using:
Advanced Scoring Functions
Real‑World Constraints
Result Export
User Input
│
├── Form Input
└── Free Text ──► LLM (Gemini) ──► Parsed Draft
│
Parser / Validator
│
Topology Selection
│
Netlist Generation
│
ngspice Simulation
│
Scoring Function
│
PSO Optimization Loop
│
Best RC Values
cd backend
python -m venv .venv
source .venv/bin/activate
# Windows:
# .venv\Scripts\activate
pip install -r requirements.txt
Backend Dependencies:
Make sure ngspice is installed and available in your PATH:
ngspice -v
⚠️ ngspice is required for all simulations and optimization loops.
uvicorn app.main:app --reload --port 8000
Backend will be available at:
http://localhost:8000
Health check:
GET /health
cd frontend
npm install
npm run dev
Open in browser:
http://localhost:5173
Frontend provides:
The system can optionally use an LLM (Gemini API) to convert free‑text user input into a structured JSON design draft.
“Design a 3‑stage RC low‑pass filter with 1 kHz cutoff and at least 40 dB attenuation.”
This text is converted into a validated schema (ParsedDraft) used directly by the optimizer.
Set the following variables:
export GEMINI_API_KEY="YOUR_API_KEY"
export GEMINI_MODEL="gemini-2.5-flash-lite"
# Optional:
# export GEMINI_API_BASE_URL="https://generativelanguage.googleapis.com/v1beta"
| Variable | Description |
|---|---|
GEMINI_API_KEY |
Required – Gemini API key |
GEMINI_MODEL |
Optional – default: gemini-2.5-flash-lite |
GEMINI_API_BASE_URL |
Optional – Gemini REST endpoint |
If the API key is not set, the system still works using the local rule‑based parser (/parse_request).
area_to_targetweighted_penaltybackend/
├── app/
│ ├── main.py # FastAPI entry point
│ ├── routes.py # API routes
│ ├── engine.py # Optimization loop
│ ├── optimizer.py # PSO implementation
│ ├── scoring.py # Cost functions
│ ├── netlist.py # ngspice netlist generation
│ ├── ngspice.py # ngspice interface
│ ├── topologies.py # RC topology library
│ ├── parser.py # Input parsing
│ ├── llm.py # Gemini LLM integration
│ ├── models.py # Pydantic data models
│ └── e_series.py # E‑series rounding
└── requirements.txt