How siddhantladdha/analog_daddy works
Project type and purpose
• This is an open-source Python library (“analog_daddy”) for transistor sizing via precomputed lookup tables (LUTs).
• Its primary purpose is to import CSV/NumPy LUT data, perform gm/ID style lookups and interpolation, produce configuration files for EDA flows, and provide plotting templates/notebooks for analog designers.
File structure
• Top-level packaging:
• setup.py, requirements.txt, LICENSE, README.md
• analog_daddy/ (core Python package)
• docs/ (usage guides, demos, notebooks, images)
• sample_files/ (example LUT data)
• tests/ (unit tests validating importer, lookup, write_config)
• Core modules in analog_daddy/:
• conf.py – global settings (e.g., file paths, defaults)
• importer.py – reads CSV/NumPy LUT files into in-memory structures
• look_up.py – lookup/interpolation functions (e.g., gm/ID, VGS lookups)
• write_config.py – writes Cadence assembler config files from lookup results
• utils.py – plotting templates (Plotly/Dash), common helper routines
• Deployment artifacts:
• pip-installable Python package (AGPLv3 licensed)
• Test suite driven by unittest discover
README for additional insights
• Dependencies: numpy, scipy, pandas, matplotlib, dash
• Supports offline & online installation
• No monolithic services – operations happen in-process via library calls or notebooks
• External integration:
• SPICE (ngspice) can be invoked externally in notebook workflows for LUT generation
• Cadence Virtuoso/Cadence Assembler testbench configs are generated by write_config.py
a. Main components
• User Interfaces:
• Jupyter Notebooks (docs/notebooks) – interactive demos & plots
• CLI / Python API – library functions imported by user scripts
• Core Library Package (analog_daddy/)
• importer module
• look_up module
• write_config module
• utils module & conf module
• Data Layer
• LUT files (CSV/NPY) in sample_files or user-provided
• External Tools & Services
• ngspice (for LUT generation workflows)
• Cadence Assembler / Virtuoso (config consumer)
• Tests & CI
• Unit tests in tests/
• GitHub Actions (implied by .github/ISSUE_TEMPLATE)
b. Relationships & interactions
• User → invokes CLI or imports Python API → calls importer to load LUT data → look_up performs interpolation → write_config emits config files → Cadence assembler consumes those files
• Notebooks orchestrate importer, look_up, utils (plotting) and optionally call ngspice externally
• Tests exercise all core modules against sample_files
c. Architectural patterns & principles
• Modular package structure – single responsibility per module
• Lazy data loading (NumPy-backed) for performance
• Extensibility via:
• Adding new lookup functions in look_up.py
• Supporting additional file formats in importer.py
• Custom plotting templates in utils.py
• Separation of concerns: data import, processing, output generation, visualization
d. Relevant technologies & frameworks
• Python packaging (setup.py, pip)
• NumPy, pandas, SciPy for data handling & interpolation
• Plotly/Dash & Matplotlib for plotting
• JupyterLab for interactive demos
• EDA tools: ngspice, Cadence Virtuoso/Assembler