Skip to content

Commit

Permalink
Merge pull request idea-fasoc#277 from alibillalhammoud/main
Browse files Browse the repository at this point in the history
Directions update for Glayout
  • Loading branch information
msaligane authored Dec 14, 2023
2 parents b70f754 + 9102e1c commit 479a51a
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 136 deletions.
32 changes: 18 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/idea-fasoc/OpenFASOC/tree/main/openfasoc/generators/gdsfactory-gen/tapeout_and_RL/README.md>`_


Getting Started
****************
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions openfasoc/generators/gdsfactory-gen/glayout/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gf180
prettyprinttree
97 changes: 69 additions & 28 deletions openfasoc/generators/gdsfactory-gen/tapeout_and_RL/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
# 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.
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
Expand All @@ -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
Expand All @@ -73,34 +99,43 @@ 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
-t, --test-mode Set test_mode to True (default: False)
--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
Expand All @@ -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
Expand All @@ -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
```
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 479a51a

Please sign in to comment.