Before runing any example/script in this README file, please execute the following two export commands first
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/thirdparty_libs/gecode-release-6.2.0"
export PYTHONPATH=/mnt/home/pham/code/maga/build/src/pymaga:$PYTHONPATHBuild the executable cmd_toplibgen first (Shift + Command + P cmd_toplibgen, then continue to select CMake: Build).
mkdir -p outputs/TopologyGenBuild the Python lib pymaga first (Shift + Command + P pymaga, then continue to select CMake: Build).
Use this command to obtain the structural recognition and paritioning results for a format-compatible FUBOCO SPICE netlist.
python src/pymaga/examples/recognition.py -f tests/example3.ckt A format-compatible FUBOCO SPICE netlist should defined inside subckt block, with vdd! and gnd! terminals for power rail
.suckt FD_Symmetry ibias in1 in2 out1 out2 vdd! gnd! vcm
m1 net1 net1 vdd! vdd pmos
m2 net2 net1 vdd! vdd pmos
m3 ibias ibias gnd! gnd! nmos
m4 net1 ibias gnd! gnd! nmos
m5 net4 ibias gnd! gnd! nmos
m6 net5 in1 net4 gnd! nmos
...
.end FD_Symmetry
- Currently, there are two methods for creating three-stage opamps. When we use
cmd_toplibgenfor topology generation, pay attention to the following method in TopologyLibraryGeneration.cpp
void TopologyLibraryGeneration::compute()
{
createAllSimpleOpAmps();
// createAllFullyDifferentialOpAmps();
// createAllComplementaryOpAmps();
}only uncomment types of opamps that we want to synthesis. Not enable them all as we may encounter memory leak.
-
Inside these methods, check if
createOpAmpsorcreateThreeStageOpAmpsis used for creating opamps.- The
createOpAmpsis the original implementation from inga000/acst and it usescreateSimpleThreeStageOpAmps,createFullyDifferentialThreeStageOpAmpsfor creating three-stage opamps - The
createThreeStageOpAmpsis our newly created method for mainly focusing on generating three-stage opamps, and it usescreateSimpleThreeStageOpAmps,createFullyDifferentialThreeStageOpAmps_2INVfor creating thre-stage opamps.
- The
-
When generating three-stage single-output opamps, update the
createOpAmpsin the following method tocreateThreeStageOpAmps
void TopologyLibraryGeneration::createAllSimpleOpAmps()
{
AutomaticSizing::CircuitInformation * circuitInformation = new AutomaticSizing::CircuitInformation;
AutomaticSizing::CircuitParameter * circuitParameter = new AutomaticSizing::CircuitParameter;
circuitInformation->setCircuitParameter(*circuitParameter);
FunctionalBlockLibrary * functionalBlockLibrary = new FunctionalBlockLibrary(*circuitInformation);
// switch to "createThreeStageOpAmps" to generate valid three-stage single-out opamps
// with only two variants for the second stage
// (the output is corresponding to s-3 directory in FUBOCO-gallery)
createOpAmps(*functionalBlockLibrary,*circuitParameter);
std::cout << "delete circuit information." << std::endl;
delete circuitInformation;
std::cout << "delete functional block library." << std::endl;
delete functionalBlockLibrary;
std::cout << "finish creating simple op amps for all cases." << std::endl;
}- inga000/acst: acst - Analog Circuit Synthesis Tool https://github.com/inga000/acst
- AugustUnderground/circus: Analog CIrcuit Sizing Gym Environment (GACE 2.0) https://github.com/AugustUnderground/circus/