GithubHelp home page GithubHelp logo

xavier0 / opamp-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jialinlu/opamp-generator

0.0 0.0 0.0 376.92 MB

License: BSD 3-Clause "New" or "Revised" License

Shell 0.23% Python 99.64% Perl 0.13%

opamp-generator's Introduction

OPAMP_Generator

OPAMP Generator consists of three modules: a topology optimization module, a topology to transistor-level circuit mapping module and an automatic layout generator. This repo contains the topology optimizaiton algorithm and transistor-level circuit mapping module. The ALIGN (https://github.com/ALIGN-analoglayout/ALIGN-public) and MAGLICAL (https://github.com/magical-eda/MAGICAL) tool can be adapted to generate layouts based on transistor-level circuits.

Demo of the generator

OPAMP-Generator_demo.mp4

Topology Optimization (topo_opt directory)

  1. Before running the code, please make sure that the Python (recommended 3.6.13) environment has "torch" (recommended 1.10.2) and "pygraphviz" (recommended 1.6) libraries installed, as well as other common scientific computing libraries;

  2. The main training program of VGAE model is train.py, you can execute the training by

source run_train.sh

or directly execute the command:

python -W ignore train.py --model DVAE_test2 --data_file dataset_ withoutY_1w --batch_size 16 --save-appendix _1w --lr 1e-5 --gpu 1
  1. The main program for performing topology optimization is optimization_bfgs.py, which can be executed with
source run_opt.sh

or directly with the command:

python -W ignore optimization_bfgs.py --iteration 30 --save- appendix _Bfgs_exp1_bound15 --nz 10 --which_gp sklearn --load_model_path _nz10_1w_demo --load_model_name 400 --emb_bound 15 --bfgs_time 200 -- samping_ratio 0.0001 --gpu 3
  1. The training results of the VGAE model will be saved in the results folder, under which there is already a trained demo; the results of the topology optimization will be saved in the opt_results and tmp_circuits folders, and the circuit demo can be found in /schematic_mapping/behv_circuits.

Automatic Mapping of Transistor-level Circuits (schematic_mapping directory)

  1. Make sure that the libraries "hebo" and "pymoo" are installed in the Python (recommended 3.6.13) environment before running the code, as well as other common scientific computing libraries;

  2. This program is suitable for tsmc18 process, the lookup table needed for gmid method is given under tsmc18rf_1p6m_lut, but the corresponding transistor model file (rf018.scs) should be copied to this directory before running;

  3. The main program is main.py, and the running command

python -W ignore main.py --TITLE --MAP --SIM --OUT --REOPT1 --intrinsic_gain_times 1
  1. The behavioral-level circuit models to be mapped need to be placed in the behv_circuits directory, and the mapped transistor-level circuits will be generated under mapped_circuits. The three circuits shown in the paper have been placed in the corresponding directory. Note: In the netlist of behavioral-level models and transistor-level circuits, the device sizes are all attempts of the last iteration of the BO program, so a direct simulation of them may not correspond to the optimal results shown in the paper.

Generated OPAMPs for Benchmarks (testbench)

The behv_circuits folder in testbench directory contains 32 behavior-level three-stage op-amp circuits searched by the automatic topology optimization program, which can be automatically transformed into transistor-level circuit netlists by the schematic_mapping program and optimized for sizing.

After testing, all 32 behavioral-level circuits in the .18 process can achieve the following circuit specifications after transistor-level mapping:

   prb_constr0 gain >= 85 dB    

   prb_constr1 pm >= 55        

   prb_constr2 gbw >= 0.7 MHz   

   prb_constr3 power <= 250 uW    

   goal fom_s maximize     

Notes:

  1. Topology optimization and transistor-level circuit mapping both need to call Cadence Spectre simulator simulation, please ensure that the corresponding software is configured in the environment variable, the recommended ic615 version;

  2. VGAE neural network training requires GPU and cuda environment, CUDA 11.0 is recommended;

  3. The transistor mapping code in testbench is the same as under the schematic_mapping path, but the automatic calculation of R and C dimensions in the circuit is not yet partially supported. If you need to dock the automatic generation process of the circuit layout, you need to determine the dimensions of R and C manually according to the process.

References

Please cite the following papers if this repo is used in your project.

  1. J. Lu, L. Lei, F. Yang, C. Yan and X. Zeng, "Automated Compensation Scheme Design for Operational Amplifier via Bayesian Optimization," 2021 58th ACM/IEEE Design Automation Conference (DAC), San Francisco, CA, USA, 2021, pp. 517-522, doi: 10.1109/DAC18074.2021.9586306.

  2. J. Lu, L. Lei, F. Yang, L. Shang and X. Zeng, "Topology Optimization of Operational Amplifier in Continuous Space via Graph Embedding," 2022 Design, Automation & Test in Europe Conference & Exhibition (DATE), Antwerp, Belgium, 2022, pp. 142-147, doi: 10.23919/DATE54114.2022.9774676.

opamp-generator's People

Contributors

ephonic avatar jialinlu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.