diff --git a/README.rst b/README.rst index 567e213a1..cea22458c 100644 --- a/README.rst +++ b/README.rst @@ -32,6 +32,9 @@ This project is led by a team of researchers at the University of Michigan and i .. image:: https://github.com/idea-fasoc/OpenFASOC/actions/workflows/cryo_gen.yml/badge.svg :target: https://github.com/idea-fasoc/OpenFASOC/actions/workflows/cryo_gen.yml +* **Glayout Generators -** + `Installation and Running `_ + Getting Started **************** @@ -79,20 +82,21 @@ Below are the tool requirements along with their currently support versions that Generators ******************** -+------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------+ -| Generator | Technology nodes | Supported | Documentation | -| | | | | -+==========================================+====================+============================+================================================================+ -| Temperature Sensor | sky130hd | Yes | https://openfasoc.readthedocs.io/en/latest/flow-tempsense.html | -+------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------+ -| Low dropout Voltage Regulator (LDO) | sky130hvl | Yes | https://openfasoc.readthedocs.io/en/latest/flow-ldo.html | -+------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------+ -| Cryogenic | sky130hs, | No (In-progress) | https://openfasoc.readthedocs.io/en/latest/flow-cryo.html | -| | sky130hd, | | | -| | sky130hvl | | | -+------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------+ -| GDSFactory | sky130hd | No (In-progress) | https://openfasoc.readthedocs.io/en/latest/flow-ldo.html | -+------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------+ ++------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------------------------------------------------------+ +| Generator | Technology nodes | Supported | Documentation | +| | | | | ++==========================================+====================+============================+================================================================================================================+ +| Temperature Sensor | sky130hd | Yes | https://openfasoc.readthedocs.io/en/latest/flow-tempsense.html | ++------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------------------------------------------------------+ +| Low dropout Voltage Regulator (LDO) | sky130hvl | Yes | https://openfasoc.readthedocs.io/en/latest/flow-ldo.html | ++------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------------------------------------------------------+ +| Cryogenic | sky130hs, | No (In-progress) | https://openfasoc.readthedocs.io/en/latest/flow-cryo.html | +| | sky130hd, | | | +| | sky130hvl | | | ++------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------------------------------------------------------+ +| Glayout | sky130, | Yes | https://github.com/idea-fasoc/OpenFASOC/tree/main/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/README.md | +| | gf180 | | | ++------------------------------------------+--------------------+----------------------------+----------------------------------------------------------------------------------------------------------------+ Tapeouts and testing setup diff --git a/openfasoc/generators/gdsfactory-gen/glayout/components/opamp.py b/openfasoc/generators/gdsfactory-gen/glayout/components/opamp.py index 619e6ab46..c3dc765c4 100644 --- a/openfasoc/generators/gdsfactory-gen/glayout/components/opamp.py +++ b/openfasoc/generators/gdsfactory-gen/glayout/components/opamp.py @@ -135,7 +135,7 @@ def __add_output_stage( def opamp_netlist(two_stage_netlist: Netlist, output_stage_netlist: Netlist) -> Netlist: top_level_netlist = Netlist( circuit_name="opamp", - nodes=['gnd', 'CSoutput', 'output', 'vdd', 'plus', 'minus', 'commonsourceibias', 'outputibias', 'diffpairibias'] + nodes=["CSoutput", "vdd", "plus", "minus", "commonsourceibias", "outputibias", "diffpairibias", "gnd", "output"] ) top_level_netlist.connect_netlist( diff --git a/openfasoc/generators/gdsfactory-gen/glayout/requirements.txt b/openfasoc/generators/gdsfactory-gen/glayout/requirements.txt new file mode 100644 index 000000000..62cd6a359 --- /dev/null +++ b/openfasoc/generators/gdsfactory-gen/glayout/requirements.txt @@ -0,0 +1,2 @@ +gf180 +prettyprinttree diff --git a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/README.md b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/README.md index 35cf4a510..7577c76e0 100644 --- a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/README.md +++ b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/README.md @@ -1,14 +1,36 @@ +# Installation and Getting Started +These generators require python version >= 3.10 +## Installing Layout Tools +All layout dependencies can be installed with pip (the official python package manager). From here you can generate layouts with [Glayout](https://github.com/idea-fasoc/OpenFASOC/blob/main/openfasoc/generators/gdsfactory-gen/glayout/README.md#glayout). + +``` +python3 -m pip install -r requirements.txt +python3 -m pip install gdsfactory==7.7.0 +``` +**After installing python packages, you can test with:** +`python3 sky130_nist_tapeout.py gen_opamp --output_gds test1.gds` +This will create an opamp called "test1.gds" + +## Installing Simulation Tools +A full install of these tools has only been verified on Linux platforms +- [Skywater 130nm Open PDK](https://github.com/RTimothyEdwards/open_pdks) +- [Magic](http://opencircuitdesign.com/magic/install.html) +- [ngspice](https://ngspice.sourceforge.io/download.html) +- **Optional**: [Klayout](https://www.klayout.de/build.html) + +**After a full install, you can test with:** +`python3 sky130_nist_tapeout.py test --output_dir test` +This will create an opamp, extract, and simulate, then dump all outputs to a new "test" directory + # sky130 NIST Tapeout Macros -This directory contains the `sky130_nist_tapeout.py` file which is a python program containing all functions and utils neccessary to produce the circuits, simulation info, and statistics used in the sky130 NIST tapeout. +The `sky130_nist_tapeout.py` file is a python program using the Glayout API to produce the OPAMPS included in the sky130 NIST nanofabrication tapeout. This file also produces simulation info, statistics, and other useful macro functions for the tapeout. `sky130_nist_tapeout.py` has a command line interface. use the `-h` option to see all args for this program. help output is replicated below. -## NOTE -Before using `sky130_nist_tapeout.py` file you should set env variable `PDK_ROOT` to the root directory of the sky130 pdk on your system. You should also change the pdk path in `opamp_perf_eval.sp` and `extract.bash`. - ## general help ``` usage: sky130_nist_tapeout.py [-h] - {extract_stats,get_training_data,gen_opamp,test,create_opamp_matrix} ... + {extract_stats,get_training_data,gen_opamp,gen_opamps,test,create_opamp_matrix} + ... sky130 nist tapeout sample, RL generation, and statistics utility. @@ -16,11 +38,14 @@ options: -h, --help show this help message and exit mode: - {extract_stats,get_training_data,gen_opamp,test,create_opamp_matrix} + {extract_stats,get_training_data,gen_opamp,gen_opamps,test,create_opamp_matrix} extract_stats Run the extract_stats function. get_training_data Run the get_training_data function. - gen_opamp Run the gen_opamp function. optional parameters for transistors are - width,length,fingers,mults + gen_opamp Run the gen_opamp function. optional parameters for transistors + are width,length,fingers,mults + gen_opamps generates the opamps returned in the small parameters list but + only saves GDS and does not add pads. always outputs to + ./outputrawopamps test Test mode create_opamp_matrix create a matrix of opamps @@ -41,20 +66,21 @@ options: ## gen_opamp mode ``` usage: sky130_nist_tapeout.py gen_opamp [-h] - [--diffpair_params DIFFPAIR_PARAMS DIFFPAIR_PARAMS DIFFPAIR_PARAMS] + [--half_diffpair_params HALF_DIFFPAIR_PARAMS HALF_DIFFPAIR_PARAMS HALF_DIFFPAIR_PARAMS] [--diffpair_bias DIFFPAIR_BIAS DIFFPAIR_BIAS DIFFPAIR_BIAS] [--half_common_source_params HALF_COMMON_SOURCE_PARAMS HALF_COMMON_SOURCE_PARAMS HALF_COMMON_SOURCE_PARAMS HALF_COMMON_SOURCE_PARAMS] [--half_common_source_bias HALF_COMMON_SOURCE_BIAS HALF_COMMON_SOURCE_BIAS HALF_COMMON_SOURCE_BIAS HALF_COMMON_SOURCE_BIAS] [--output_stage_params OUTPUT_STAGE_PARAMS OUTPUT_STAGE_PARAMS OUTPUT_STAGE_PARAMS] [--output_stage_bias OUTPUT_STAGE_BIAS OUTPUT_STAGE_BIAS OUTPUT_STAGE_BIAS] [--mim_cap_size MIM_CAP_SIZE MIM_CAP_SIZE] - [--mim_cap_rows MIM_CAP_ROWS] [--rmult RMULT] [--add_pads] - [--output_gds OUTPUT_GDS] + [--mim_cap_rows MIM_CAP_ROWS] [--rmult RMULT] + [--add_pads] [--output_gds OUTPUT_GDS] + [--no_lvt] [--PDK_ROOT PDK_ROOT] [--big_pad] options: -h, --help show this help message and exit - --diffpair_params DIFFPAIR_PARAMS DIFFPAIR_PARAMS DIFFPAIR_PARAMS - diffpair_params (default: 6 1 4) + --half_diffpair_params HALF_DIFFPAIR_PARAMS HALF_DIFFPAIR_PARAMS HALF_DIFFPAIR_PARAMS + half_diffpair_params (default: 6 1 4) --diffpair_bias DIFFPAIR_BIAS DIFFPAIR_BIAS DIFFPAIR_BIAS diffpair_bias (default: 6 2 4) --half_common_source_params HALF_COMMON_SOURCE_PARAMS HALF_COMMON_SOURCE_PARAMS HALF_COMMON_SOURCE_PARAMS HALF_COMMON_SOURCE_PARAMS @@ -73,13 +99,18 @@ options: --add_pads add pads (gen_opamp mode only) --output_gds OUTPUT_GDS Filename for outputing opamp (gen_opamp mode only) + --no_lvt do not place any low threshold voltage transistors. + --PDK_ROOT PDK_ROOT path to the sky130 PDK library + --big_pad use 120um pad ``` ## get_training_data mode ``` usage: sky130_nist_tapeout.py get_training_data [-h] [-t] [--temp TEMP] [--cload CLOAD] - [--noparasitics] [--nparray NPARRAY] [--saverawsims] - [--get_tset_len] [--output_second_stage] + [--noparasitics] [--nparray NPARRAY] + [--saverawsims] [--get_tset_len] + [--output_second_stage] [--no_lvt] + [--PDK_ROOT PDK_ROOT] options: -h, --help show this help message and exit @@ -87,20 +118,24 @@ options: --temp TEMP Simulation temperature --cload CLOAD run simulation with load capacitance units=pico Farads --noparasitics specify that parasitics should be removed when simulating - --nparray NPARRAY overrides the test parameters and takes the ones you provide (file path to .npy file). - MUST HAVE LEN > 1 - --saverawsims specify that the raw simulation directories should be saved (default saved - under save_gds_by_index/...) + --nparray NPARRAY overrides the test parameters and takes the ones you provide + (file path to .npy file). MUST HAVE LEN > 1 + --saverawsims specify that the raw simulation directories should be saved + (default saved under save_gds_by_index/...) --get_tset_len print the length of the default parameter set and quit --output_second_stage - measure relevant sim metrics at the output of the second stage rather than - output of third stage + measure relevant sim metrics at the output of the second stage + rather than output of third stage + --no_lvt do not place any low threshold voltage transistors. + --PDK_ROOT PDK_ROOT path to the sky130 PDK library ``` ## test mode ``` -usage: sky130_nist_tapeout.py test [-h] [--output_dir OUTPUT_DIR] [--temp TEMP] [--cload CLOAD] - [--noparasitics] [--output_second_stage] +usage: sky130_nist_tapeout.py test [-h] [--output_dir OUTPUT_DIR] [--temp TEMP] + [--cload CLOAD] [--noparasitics] + [--output_second_stage] [--no_lvt] + [--PDK_ROOT PDK_ROOT] options: -h, --help show this help message and exit @@ -110,15 +145,18 @@ options: --cload CLOAD run simulation with load capacitance units=pico Farads --noparasitics specify that parasitics should be removed when simulating --output_second_stage - measure relevant sim metrics at the output of the second stage rather than - output of third stage + measure relevant sim metrics at the output of the second stage + rather than output of third stage + --no_lvt do not place any low threshold voltage transistors. + --PDK_ROOT PDK_ROOT path to the sky130 PDK library ``` ## create_opamp_matrix mode ``` usage: sky130_nist_tapeout.py create_opamp_matrix [-h] [-p PARAMS] [-r RESULTS] [--indices INDICES [INDICES ...]] - [--output_dir OUTPUT_DIR] + [--output_dir OUTPUT_DIR] [--no_lvt] + [--PDK_ROOT PDK_ROOT] [--big_pad] options: -h, --help show this help message and exit @@ -127,8 +165,11 @@ options: -r RESULTS, --results RESULTS Optional File path for results --indices INDICES [INDICES ...] - list of int indices to pick from the opamp param.npy and add to the matrix - (default: the entire params list) + list of int indices to pick from the opamp param.npy and add to + the matrix (default: the entire params list) --output_dir OUTPUT_DIR Directory for output files (default: ./opampmatrix) + --no_lvt do not place any low threshold voltage transistors. + --PDK_ROOT PDK_ROOT path to the sky130 PDK library + --big_pad use 120um pad ``` \ No newline at end of file diff --git a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/extract.bash.template b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/extract.bash.template index 8f6c82d15..54f50aeba 100644 --- a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/extract.bash.template +++ b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/extract.bash.template @@ -7,44 +7,14 @@ export PDK_ROOT=@@PDK_ROOT # first arg = gds file to read # second arg = name of top cell in gds file to read -# generate lvs netlist using magic magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF gds read $1 load $2 -flatten $2_flat -load $2_flat -gds write $2_flat.gds -EOF - -magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF -gds read $2_flat.gds -load $2_flat -flatten $2 -load $2 -gds write $2.gds -EOF - - -magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF -gds read $2.gds -load $2 extract all -ext2spice lvs ext2spice merge aggressive -ext2spice cthresh 0 -ext2spice rthresh 0 ext2spice -o $2_pex.spice exit EOF -magic -rcfile ./sky130A/sky130A.magicrc -noconsole -dnull << EOF -gds read $2.gds -load $2 -extract all -ext2spice merge aggressive -ext2spice -o $2_pex.spice -exit -EOF -rm -f $2_flat.gds rm -f $2.ext diff --git a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/opamp_perf_eval.sp b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/opamp_perf_eval.sp index 243263fb2..34de866a4 100644 --- a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/opamp_perf_eval.sp +++ b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/opamp_perf_eval.sp @@ -63,15 +63,25 @@ let savedPhaseMargin = -1 let savedDCGain = -1 let savedthreedbBW = -1 +* dp and cs bias log step +*let linear_step_until = 0u +*let linear_step_default = 1.1u +*let bias_dp_Min = 25u +*let bias_dp_Max = 200u +*let bias_dp_logStep = 1.15 +*let bias_cs_Min = 30u +*let bias_cs_Max = 1m +*let bias_cs_logStep = 1.18 + * dp and cs bias log step let linear_step_until = 0u let linear_step_default = 1.1u -let bias_dp_Min = 25u -let bias_dp_Max = 200u -let bias_dp_logStep = 1.15 -let bias_cs_Min = 30u -let bias_cs_Max = 1m -let bias_cs_logStep = 1.18 +let bias_dp_Min = 1u +let bias_dp_Max = 25u +let bias_dp_logStep = 1.2 +let bias_cs_Min = 1u +let bias_cs_Max = 25u +let bias_cs_logStep = 1.2 * output bias linear step let bias_o_Min = 93.5u diff --git a/openfasoc/generators/gdsfactory-gen/requirements.txt b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/requirements.txt similarity index 100% rename from openfasoc/generators/gdsfactory-gen/requirements.txt rename to openfasoc/generators/gdsfactory-gen/tapeout_and_RL/requirements.txt diff --git a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/sky130_nist_tapeout.py b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/sky130_nist_tapeout.py index be3302cd3..6eac8b9f2 100644 --- a/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/sky130_nist_tapeout.py +++ b/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/sky130_nist_tapeout.py @@ -36,7 +36,7 @@ from itertools import count, repeat from glayout.pdk.util.snap_to_grid import component_snap_to_grid from glayout.pdk.util.component_array_create import write_component_matrix - +import re global _GET_PARAM_SET_LENGTH_ global _TAKE_OUTPUT_AT_SECOND_STAGE_ @@ -318,59 +318,112 @@ def opamp_results_de_serializer( results_dict["power_twostage"] = float(results[10]) return results_dict -def get_small_parameter_list(test_mode = False) -> np.array: +def get_small_parameter_list(test_mode = False, clarge=True) -> np.array: """creates small parameter list intended for brute force""" - # all diffpairs to try - diffpairs = list() - if test_mode: - diffpairs.append((6,1,4)) - diffpairs.append((5,1,4)) - else: - for width in [7]: - for length in [0.5,0.7, 0.9]: - for fingers in [8,10,12]: - diffpairs.append((width,length,fingers)) - # all bias2 (output amp bias) transistors - bias2s = list() - if test_mode: - bias2s.append((6,1,4,3)) - else: - for width in [7]: - for length in [1]: - for fingers in [12,16,20]: - for mults in [2,3]: - bias2s.append((width,length,fingers,mults)) - # all pmos first stage load transistors - half_pload = list() - if test_mode: - half_pload.append((6,1,6)) - else: - for width in [9]: - for length in [0.5]: - for fingers in [6,8,10,12]: - half_pload.append((width,length,fingers)) - # all output pmos transistors - pamp_hparams = list() - if test_mode: - pamp_hparams.append((7,1,8,3)) - else: - for width in [8]: - for length in [0.5]: - for fingers in [8,12,16,20]: - pamp_hparams.append((width,length,fingers,3)) - # diffpair bias cmirror - diffpair_cmirrors = list() - if test_mode: - pass + if not clarge: + # all diffpairs to try + diffpairs = list() + if test_mode: + diffpairs.append((6,1,4)) + diffpairs.append((5,1,4)) + else: + for width in [7]: + for length in [0.5,0.7, 0.9]: + for fingers in [8,10,12]: + diffpairs.append((width,length,fingers)) + # all bias2 (output amp bias) transistors + bias2s = list() + if test_mode: + bias2s.append((6,1,4,3)) + else: + for width in [7]: + for length in [1]: + for fingers in [12,16,20]: + for mults in [2,3]: + bias2s.append((width,length,fingers,mults)) + # all pmos first stage load transistors + half_pload = list() + if test_mode: + half_pload.append((6,1,6)) + else: + for width in [9]: + for length in [0.5]: + for fingers in [6,8,10,12]: + half_pload.append((width,length,fingers)) + # all output pmos transistors + pamp_hparams = list() + if test_mode: + pamp_hparams.append((7,1,8,3)) + else: + for width in [8]: + for length in [0.5]: + for fingers in [8,12,16,20]: + pamp_hparams.append((width,length,fingers,3)) + # diffpair bias cmirror + diffpair_cmirrors = list() + if test_mode: + pass + else: + for width in [7]: + for length in [1]: + for fingers in [8,10]: + diffpair_cmirrors.append((width,length,fingers)) + # rows of the cap array to try + cap_arrays = [3] + # routing mults to try + rmults = [2] else: - for width in [7]: - for length in [1]: - for fingers in [8,10]: - diffpair_cmirrors.append((width,length,fingers)) - # rows of the cap array to try - cap_arrays = [3] - # routing mults to try - rmults = [2] + # all diffpairs to try + diffpairs = list() + if test_mode: + diffpairs.append((6,1,4)) + diffpairs.append((5,1,4)) + else: + for width in [2,4,6]: + for length in [0.5, 1]: + for fingers in [2,4,6,8]: + diffpairs.append((width,length,fingers)) + # all bias2 (output amp bias) transistors + bias2s = list() + if test_mode: + bias2s.append((6,1,4,3)) + else: + for width in [6]: + for length in [2]: + for fingers in [4,6]: + for mults in [2,3]: + bias2s.append((width,length,fingers,mults)) + # all pmos first stage load transistors + half_pload = list() + if test_mode: + half_pload.append((6,1,6)) + else: + for width in [4,6]: + for length in [0.5,1]: + for fingers in [4,6,8]: + half_pload.append((width,length,fingers)) + # all output pmos transistors + pamp_hparams = list() + if test_mode: + pamp_hparams.append((7,1,8,3)) + else: + for width in [7,4]: + for length in [0.5,1]: + for fingers in [8,4,2]: + pamp_hparams.append((width,length,fingers,3)) + # diffpair bias cmirror + diffpair_cmirrors = list() + if test_mode: + pass + else: + for width in [6]: + for length in [2]: + for fingers in [3]: + diffpair_cmirrors.append((width,length,fingers)) + # rows of the cap array to try + cap_arrays = [3] + # routing mults to try + rmults = [2] # ****************************************** # create and return the small parameters list short_list_len = len(diffpairs) * len(bias2s) * len(pamp_hparams) * len(cap_arrays) * len(rmults) * len(diffpair_cmirrors) * len(half_pload) @@ -486,6 +539,11 @@ def process_netlist_subckt(netlist: Union[str,Path], sim_model: Literal["normal subckt_lines[i] = headerstr+"\nCload output gnd " + str(cload) +"p\n" if ("floating" in line) or (noparasitics and len(line) and line[0]=="C"): subckt_lines[i] = "* "+ subckt_lines[i] + if noparasitics: + subckt_lines[i] = re.sub(r"ad=(\S*)","",subckt_lines[i]) + subckt_lines[i] = re.sub(r"as=(\S*)","",subckt_lines[i]) + subckt_lines[i] = re.sub(r"ps=(\S*)","",subckt_lines[i]) + subckt_lines[i] = re.sub(r"pd=(\S*)","",subckt_lines[i]) with open(netlist, "w") as spice_net: spice_net.writelines(subckt_lines) @@ -509,7 +567,7 @@ def process_spice_testbench(testbench: Union[str,Path], temperature_info: tuple[ with open(testbench, "w") as spice_file: spice_file.write(spicetb) -def __run_single_brtfrc(index, parameters_ele, save_gds_dir, temperature_info: tuple[int,str]=(25,"normal model"), cload: float=0.0, noparasitics: bool=False, output_dir: Optional[Union[int,str,Path]] = None): +def __run_single_brtfrc(index, parameters_ele, save_gds_dir, temperature_info: tuple[int,str]=(25,"normal model"), cload: float=0.0, noparasitics: bool=False, output_dir: Optional[Union[int,str,Path]] = None, hardfail=False): # pass pdk as global var to avoid pickling issues global pdk global PDK_ROOT @@ -561,6 +619,8 @@ def __run_single_brtfrc(index, parameters_ele, save_gds_dir, temperature_info: t raise ValueError("Output directory must be a directory") copytree(str(tmpdirname), str(output_dir)+"/test_output", dirs_exist_ok=True) except Exception as e_LorA: + if hardfail: + raise e_LorA results = opamp_results_serializer() with open('get_training_data_ERRORS.log', 'a') as errlog: errlog.write("\nopamp run "+str(index)+" with the following params failed: \n"+str(params)) @@ -588,7 +648,7 @@ def brute_force_full_layout_and_PEXsim(sky130pdk: MappedPDK, parameter_list: np. # pass pdk as global var to avoid pickling issues global pdk pdk = sky130pdk - with Pool(120) as cores: + with Pool(128) as cores: if saverawsims: results = np.array(cores.starmap(__run_single_brtfrc, zip(count(0), parameter_list, repeat(save_gds_dir), repeat(temperature_info), repeat(cload), repeat(noparasitics), count(0))),np.float64) else: @@ -612,7 +672,7 @@ def get_training_data(test_mode: bool=True, temperature_info: tuple[int,str]=(25 #util function for pure simulation. sky130 is imported automatically -def single_build_and_simulation(parameters: np.array, temp: int=25, output_dir: Optional[Union[str,Path]] = None, cload: float=0.0, noparasitics: bool=False) -> dict: +def single_build_and_simulation(parameters: np.array, temp: int=25, output_dir: Optional[Union[str,Path]] = None, cload: float=0.0, noparasitics: bool=False,hardfail=False) -> dict: """Builds, extract, and simulates a single opamp saves opamp gds in current directory with name 12345678987654321.gds returns -987.654321 for all values IF phase margin < 45 @@ -633,7 +693,7 @@ def single_build_and_simulation(parameters: np.array, temp: int=25, output_dir: # pass pdk as global var to avoid pickling issues global pdk pdk = sky130_mapped_pdk - results = __run_single_brtfrc(index, parameters, temperature_info=temperature_info, save_gds_dir=save_gds_dir, output_dir=output_dir, cload=cload, noparasitics=noparasitics) + results = __run_single_brtfrc(index, parameters, temperature_info=temperature_info, save_gds_dir=save_gds_dir, output_dir=output_dir, cload=cload, noparasitics=noparasitics, hardfail=hardfail) results = opamp_results_de_serializer(results) if results["phaseMargin"] < 45: for key in results: @@ -1202,7 +1262,7 @@ def create_opamp_matrix(save_dir_name: str, params: np.array, results: Optional[ "mim_cap_rows": 3, "rmult": 2 } - results = single_build_and_simulation(opamp_parameters_serializer(**params), temperature_info[0], args.output_dir, cload=args.cload, noparasitics=args.noparasitics) + results = single_build_and_simulation(opamp_parameters_serializer(**params), temperature_info[0], args.output_dir, cload=args.cload, noparasitics=args.noparasitics, hardfail=True) print(results) elif args.mode =="create_opamp_matrix":