Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 Automatic compilation of raw efabless PDKs into a gdsfactory-compatible PDK #92

Merged
merged 12 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
container: ghcr.io/gdsfactory/gdsfactory:main
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install dependencies
run: |
make install
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,4 @@ cython_debug/
*.DS_Store
.DS_Store
*Thumbs.db
.idea/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "sky130/src/sky130_fd_pr"]
path = sky130/src/sky130_fd_pr
url = https://github.com/efabless/skywater-pdk-libs-sky130_fd_pr.git
[submodule "sky130/src/sky130_fd_sc_hd"]
path = sky130/src/sky130_fd_sc_hd
url = https://github.com/efabless/skywater-pdk-libs-sky130_fd_sc_hd.git
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ repos:
- id: trailing-whitespace
- id: requirements-txt-fixer

- repo: https://github.com/psf/black
rev: 25d886f52c2bbbb58386ac8050f4e67952507bc7
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "6a0ba1854991b693612486cc84a2254de82d071d"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.4"
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.10.0
hooks:
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
files: ".ipynb"
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sky130
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ install:
dev: install
pre-commit install

modules:
git submodule
git submodule update --init --recursive

test:
pytest -s

Expand Down
14 changes: 0 additions & 14 deletions docs/notebooks/Makefile

This file was deleted.

282 changes: 282 additions & 0 deletions docs/notebooks/intro.ipynb
joamatab marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Layout\n",
"\n",
"## Layout driven flow\n",
"\n",
"You can import the PDK and layout any of the standard cells"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [],
"source": [
"import gdsfactory as gf"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"source": [
"import sky130\n",
"import sky130.components as sc\n",
"import sky130.tech as st"
]
},
{
"cell_type": "markdown",
"id": "3",
"metadata": {},
"source": [
"If you want to see what are the cells available:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"metadata": {},
"outputs": [],
"source": [
"# sky130.cross_sections"
]
},
{
"cell_type": "markdown",
"id": "5",
"metadata": {},
"source": [
"Let's explore the available layers:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": [
"# help(gf.pdk)\n",
"# help(gf.get_active_pdk().get_layer_stack)\n",
"# gf.pdk.get_layer_stack()"
]
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
"source": [
"You can also verify this is the active PDK on `gdsfactory`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [],
"source": [
"gf.pdk.get_active_pdk().name"
]
},
{
"cell_type": "markdown",
"id": "9",
"metadata": {},
"source": [
"Now, let's explore available symbols for the components:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"outputs": [],
"source": [
"# dir(sky130)\n",
"sky130"
]
},
{
"cell_type": "markdown",
"id": "11",
"metadata": {},
"source": [
"Let's try exploring an example basic `nfet`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"metadata": {},
"outputs": [],
"source": [
"c = sc.sky130_fd_pr__rf_nfet_01v8_aM02W1p65L0p15()\n",
"c"
]
},
{
"cell_type": "markdown",
"id": "13",
"metadata": {},
"source": [
"Explore it's ports:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "14",
"metadata": {},
"outputs": [],
"source": [
"c.ports"
]
},
{
"cell_type": "markdown",
"id": "15",
"metadata": {},
"source": [
"We can also explore the digital cells:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"metadata": {},
"outputs": [],
"source": [
"c = sc.sky130_fd_sc_hd__a2111o_1()\n",
"c"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"metadata": {},
"outputs": [],
"source": [
"scene = c.to_3d()\n",
"scene.show()"
]
},
{
"cell_type": "markdown",
"id": "18",
"metadata": {},
"source": [
"TODO: add Parametric cells natively into gdsfactory `sky130` pdk."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"metadata": {},
"outputs": [],
"source": [
"c = gf.Component()\n",
"g1 = c << sc.sky130_fd_sc_hd__a2111o_1()\n",
"g2 = c << sc.sky130_fd_sc_hd__a311oi_4()\n",
"g2.move((15, 10))\n",
"c"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"metadata": {},
"outputs": [],
"source": [
"c = gf.Component(\"demo_connect\")\n",
"g1 = c << sc.sky130_fd_sc_hd__a2111o_1()\n",
"g2 = c << sc.sky130_fd_sc_hd__a311oi_4()\n",
"g2.move((15, 10))\n",
"route = gf.routing.get_route_electrical(\n",
" g1.ports[\"VPWR\"], g2.ports[\"VPWR\"], cross_section=st.xs_metal1\n",
")\n",
"c.add(route.references)\n",
"c"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "21",
"metadata": {},
"outputs": [],
"source": [
"scene = c.to_3d()\n",
"scene.show()"
]
},
{
"cell_type": "markdown",
"id": "22",
"metadata": {},
"source": [
"## Netlist driven flow\n",
"\n",
"For netlist driven flow you can define circuits for place and route. You have two options:\n",
"\n",
"1. in python\n",
"2. in YAML"
]
},
{
"cell_type": "markdown",
"id": "23",
"metadata": {},
"source": [
"## Spice simulations\n",
"\n",
"You can use `PySpice` for running simulations.\n",
"\n",
"gdsfactory can extract the netlist and simulate the circuit.\n",
"\n",
"TODO: add some relevant examples."
]
}
],
"metadata": {
"jupytext": {
"custom_cell_magics": "kql"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading