|
| 1 | +# PCB Designer AI Agent |
| 2 | + |
| 3 | +An open-source agentic pipeline that turns a natural-language hardware description into a manufacturable PCB. The system automates: |
| 4 | + |
| 5 | +1) Requirement → Component selection (BOM) |
| 6 | +2) Datasheet retrieval → Footprint extraction → Footprint generation (.kicad_mod) |
| 7 | +3) Schematic synthesis (netlist) from component reference designs and constraints |
| 8 | +4) PCB placement and routing (via KiCad + Freerouting or vendor tools adapters) |
| 9 | +5) Gerber generation via EDA tool backends (KiCad first-class; adapters for Altium/Cadence planned) |
| 10 | + |
| 11 | +Status: early scaffold. Includes a working, parametric KiCad footprint generator for common packages and an extensible pipeline with clear interfaces for each step. |
| 12 | + |
| 13 | +## Why |
| 14 | +- Speed up concept-to-board by automating tedious steps. |
| 15 | +- Keep humans-in-the-loop for safety while leveraging LLMs/CV for datasheet understanding. |
| 16 | +- Vendor-neutral core with adapters for popular EDA tools. |
| 17 | + |
| 18 | +## Architecture |
| 19 | +- Core config + logging |
| 20 | +- Pluggable LLM providers (OpenAI/Ollama/etc.) |
| 21 | +- Steps: |
| 22 | + - requirements_parser → bom_generator → datasheet_fetcher → footprint_generator → schematic_synthesizer → pcb_router → gerber_exporter |
| 23 | +- Backends: |
| 24 | + - KiCad backend (first-class, CLI-friendly) |
| 25 | + - Adapters for Altium (COM/Script/PDN) and Cadence Allegro (SKILL/CLI) planned |
| 26 | + |
| 27 | +```text |
| 28 | +pcb-designer-ai-agent/ |
| 29 | +├─ README.md |
| 30 | +├─ LICENSE |
| 31 | +├─ pyproject.toml |
| 32 | +├─ .gitignore |
| 33 | +├─ src/pcbai/ |
| 34 | +│ ├─ __init__.py |
| 35 | +│ ├─ core/ |
| 36 | +│ │ ├─ config.py |
| 37 | +│ │ └─ logger.py |
| 38 | +│ ├─ llm/ |
| 39 | +│ │ ├─ provider.py |
| 40 | +│ │ └─ providers/ |
| 41 | +│ ├─ steps/ |
| 42 | +│ │ ├─ requirements_parser.py |
| 43 | +│ │ ├─ bom_generator.py |
| 44 | +│ │ ├─ datasheet_fetcher.py |
| 45 | +│ │ ├─ footprint_generator.py <-- working generator for SMD R/C and SOIC |
| 46 | +│ │ ├─ schematic_synthesizer.py |
| 47 | +│ │ ├─ pcb_router.py |
| 48 | +│ │ └─ gerber_exporter.py |
| 49 | +│ └─ pipeline/ |
| 50 | +│ └─ cli.py |
| 51 | +└─ tests/ |
| 52 | + └─ test_footprint_generator.py |
| 53 | +``` |
| 54 | + |
| 55 | +## Quickstart |
| 56 | +- Python 3.10+ |
| 57 | +- KiCad 7/8 recommended for future steps (not required to try the footprint generator) |
| 58 | + |
| 59 | +Install: |
| 60 | + |
| 61 | +```bash |
| 62 | +pip install -e . |
| 63 | +``` |
| 64 | + |
| 65 | +Generate a 0603 resistor footprint: |
| 66 | + |
| 67 | +```bash |
| 68 | +pcbai footprint --type smd_rc --name R_0603 --body-l 1.6 --body-w 0.8 --pad-l 0.9 --pad-w 0.8 --gap 0.8 --out build/ |
| 69 | +``` |
| 70 | + |
| 71 | +Generate a 14-pin SOIC footprint: |
| 72 | + |
| 73 | +```bash |
| 74 | +pcbai footprint --type soic --name SOIC-14_3.9x8.7mm_P1.27mm \ |
| 75 | + --pins 14 --pitch 1.27 --body-l 8.7 --body-w 3.9 --pad-l 1.5 --pad-w 0.6 --row-offset 2.3 --out build/ |
| 76 | +``` |
| 77 | + |
| 78 | +You will find `.kicad_mod` files in `build/` to drop into a KiCad library. |
| 79 | + |
| 80 | +## Vision + Datasheet extraction |
| 81 | +- Planned: PDF/image → text/structured extraction using OCR + LLM-Vision to infer package params when IPC tables are present. |
| 82 | +- Today: you can provide measured params directly to the generator. |
| 83 | + |
| 84 | +## Schematic/Netlist synthesis |
| 85 | +- Planned: SKiDL-based netlist generation from component set + reference circuits. |
| 86 | + |
| 87 | +## PCB routing and Gerbers |
| 88 | +- Planned: KiCad pcbnew and Freerouting integration; `kicad-cli` for Gerbers. |
| 89 | +- Adapters for Altium/Cadence will require respective licensed tool installations and API keys. |
| 90 | + |
| 91 | +## Configuration |
| 92 | +- All runtime config via environment variables or a YAML file, see `src/pcbai/core/config.py`. |
| 93 | + |
| 94 | +## Contributing |
| 95 | +- PRs welcome. Focus areas: |
| 96 | + - Datasheet parsers and CV feature extractors |
| 97 | + - More package generators (QFN/QFP/BGA) |
| 98 | + - SKiDL schematic templates |
| 99 | + - EDA tool adapters |
| 100 | + |
| 101 | +## License |
| 102 | +Dual-licensed: |
| 103 | +- Non-commercial, open-source use granted under the Custom License in LICENSE. |
| 104 | +- Commercial/enterprise use requires prior written authorization from the author. Contact: set your email in LICENSE. |
0 commit comments