Skip to main content

A Python toolkit for analog circuit topology synthesis and recognition, focused on op-amp design.

Project description

CircuitGenome logo

Modular synthesis, recognition, and sizing of analog op-amp circuits.

License: MIT Documentation PyPI Python versions

CircuitGenome is a Python toolkit for analog circuit topology synthesis and recognition, focused on op-amp design. It takes a modular approach: a complete circuit is assembled from independent functional building blocks — differential pair, load, tail current, bias, compensation, and output stage. By enumerating every valid combination of block implementations, the tool can quickly generate thousands of structurally distinct op-amp netlists for dataset generation, automated design exploration, or topology studies.

The toolkit works in both directions of the design problem. Going forward, it constructs and sizes op-amps from building blocks and a performance specification. Going backward, it reads a flat SPICE netlist and recovers its structure — identifying subcircuits (differential pairs, current mirrors, cascode loads, bias generators, CMFB, compensation) and assigning each to its functional role. An end-to-end designer chains these layers together, keeping only the circuits whose ngspice-measured metrics meet the spec.

Key Features

  • Topology synthesis — enumerate every valid op-amp from modular building blocks and emit flat or hierarchical SPICE netlists.
  • Subcircuit & functional-block recognition — recover structure and slot assignments from a flat SPICE netlist.
  • Initial sizing — compute minimum transistor W/L values that satisfy DC specs (gain, GBW, phase margin, slew rate, CMRR) via an OR-Tools CP-SAT solver and a gm/Id flow.
  • End-to-end designer — enumerate, size, simulate, and keep only the designs that pass ngspice-measured metrics.
  • One-, two-, and three-stage op-amps, single-ended and fully differential, including nested-Miller (NMC) and reversed-nested-Miller (RNMC) compensation.
  • Extensible with no code — add new module variants by editing a YAML file.

Have a question? Start a discussion or open an issue on GitHub.

📖 Documentation

Full user guide, API reference, and design theory live in the Sphinx docs:

Read the Docs

Installation

pip install circuitgenome

Or install from source:

git clone https://github.com/analog-ml/CircuitGenome.git
cd CircuitGenome
pip install -e .

Requires Python 3.9+. PyYAML and OR-Tools (for the sizer) are installed automatically.

Getting Started

Run the end-to-end designer: enumerate a topology, size each candidate, simulate with ngspice, and export the designs that meet your spec.

circuitgenome design --spec spec_gf180.yaml --topology two_stage_opamp_single_ended \
    --output-dir designs/ --limit 200 --workers 4

For the full CLI reference, Python API, and worked examples, see the documentation.

Contributing

CircuitGenome is an open research project and contributions are very welcome — new module variants, topology templates, recognizer patterns, sizing heuristics, bug fixes, and documentation improvements.

  • Browse or open issues: https://github.com/analog-ml/CircuitGenome/issues
  • Fork the repo, create a feature branch, and open a pull request against main.
  • Run the test suite before submitting: python3 -m pytest tests/ -v.
  • Adding a new module variant usually needs no code changes — just edit opamp_modules.yaml (see the docs for details).

References

  1. A Data-Driven Analog Circuit Synthesizer with Automatic Topology Selection and Sizing — S. Poddar, A. F. Budak, L. Zhao, C.-H. Hsu, S. Maji, K. Zhu, Y. Jia, D. Z. Pan. Design, Automation & Test in Europe (DATE), 2024.
  2. FUBOCO: Structure Synthesis of Basic Op-Amps by FUnctional BlOck COmposition — I. Abel, H. Graeb. ACM Transactions on Design Automation of Electronic Systems (TODAES), 2022.
  3. A Functional Block Decomposition Method for Automatic Op-Amp Design — I. Abel, M. Neuner, H. Graeb. Integration, the VLSI Journal (Elsevier), 2022.
  4. Constraint-Programmed Initial Sizing of Analog Operational Amplifiers — I. Abel, M. Neuner, H. Graeb. IEEE International Conference on Computer Design (ICCD), 2019.

PDFs of all four papers are in docs/papers/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circuitgenome-0.2.0.tar.gz (456.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

circuitgenome-0.2.0-py3-none-any.whl (406.6 kB view details)

Uploaded Python 3

File details

Details for the file circuitgenome-0.2.0.tar.gz.

File metadata

  • Download URL: circuitgenome-0.2.0.tar.gz
  • Upload date:
  • Size: 456.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for circuitgenome-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b6401bec09c03f5f02047a9a9bfac9a7d9e5bd2a6578e5908953b2b8dcd84241
MD5 9795fa5800170b1f62394b7cb735d417
BLAKE2b-256 1d3a49d0be6c2bfc69ed97f14e4ea9372bf6658e19453e66625b8e4167cd3a80

See more details on using hashes here.

File details

Details for the file circuitgenome-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: circuitgenome-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 406.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for circuitgenome-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d92f0cac188d6cce5cdd3a38eb602c8d408f605d2a1cb1c4f2a096e4126e3f3
MD5 3b2c708a23a13515a54895b7927244e2
BLAKE2b-256 6e229c737460d158b1ce2aee84879130f743d7407ce693d0db988c4570973b50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page