Skip to content

Commit

Permalink
Merge pull request #99 from gdsfactory/update_gdsfactory840
Browse files Browse the repository at this point in the history
Update gdsfactory840
  • Loading branch information
joamatab authored Jun 29, 2024
2 parents 95d218c + aa2d2d8 commit fce4aec
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 106 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
path: "./docs/_build/html/"
deploy-docs:
needs: build-docs
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
pages: write
id-token: write
Expand All @@ -39,4 +40,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ repos:
- id: trailing-whitespace
- id: requirements-txt-fixer

- 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:
Expand All @@ -22,3 +16,9 @@ repos:
hooks:
- id: nbstripout
files: ".ipynb"
- 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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ doc:
python docs/write_components_doc.py

update-pre:
pre-commit autoupdate --bleeding-edge
pre-commit autoupdate

git-rm-merged:
git branch -D `git branch --merged | grep -v \* | xargs`
Expand All @@ -31,6 +31,8 @@ release:
git push --tags

build:
rm -rf sky130/src/sky130_fd_sc_hd/timing
find . -type d -name "tests" -exec rm -rf {} +
rm -rf dist
pip install build
python -m build
Expand Down
1 change: 1 addition & 0 deletions docs/notebooks
72 changes: 24 additions & 48 deletions docs/notebooks/intro.ipynb → notebooks/intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"metadata": {},
"outputs": [],
"source": [
"# sky130.cross_sections"
"dir(sc)"
]
},
{
Expand All @@ -60,21 +60,9 @@
"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",
"id": "6",
"metadata": {},
"source": [
"You can also verify this is the active PDK on `gdsfactory`:"
Expand All @@ -83,7 +71,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -92,7 +80,7 @@
},
{
"cell_type": "markdown",
"id": "9",
"id": "8",
"metadata": {},
"source": [
"Now, let's explore available symbols for the components:"
Expand All @@ -101,7 +89,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -111,7 +99,7 @@
},
{
"cell_type": "markdown",
"id": "11",
"id": "10",
"metadata": {},
"source": [
"Let's try exploring an example basic `nfet`:"
Expand All @@ -120,7 +108,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -130,7 +118,7 @@
},
{
"cell_type": "markdown",
"id": "13",
"id": "12",
"metadata": {},
"source": [
"Explore it's ports:"
Expand All @@ -139,16 +127,16 @@
{
"cell_type": "code",
"execution_count": null,
"id": "14",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
"c.ports"
"c.pprint_ports()"
]
},
{
"cell_type": "markdown",
"id": "15",
"id": "14",
"metadata": {},
"source": [
"We can also explore the digital cells:"
Expand All @@ -157,7 +145,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -168,7 +156,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -178,7 +166,7 @@
},
{
"cell_type": "markdown",
"id": "18",
"id": "17",
"metadata": {},
"source": [
"TODO: add Parametric cells natively into gdsfactory `sky130` pdk."
Expand All @@ -187,7 +175,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -201,25 +189,24 @@
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"id": "19",
"metadata": {},
"outputs": [],
"source": [
"c = gf.Component(\"demo_connect\")\n",
"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.dmove((15, 10))\n",
"route = gf.routing.route_single_electrical(\n",
" g1.ports[\"VPWR\"], g2.ports[\"VPWR\"], cross_section=st.xs_metal1\n",
" c, 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",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -229,30 +216,19 @@
},
{
"cell_type": "markdown",
"id": "22",
"id": "21",
"metadata": {},
"source": [
"## Netlist driven flow\n",
"\n",
"For netlist driven flow you can define circuits for place and route. You have two options:\n",
"## Spice simulations\n",
"\n",
"1. in python\n",
"2. in YAML"
"You can use hdl21 for running simulations.\n"
]
},
{
"cell_type": "markdown",
"id": "23",
"id": "22",
"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."
]
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Operating System :: OS Independent"
]
dependencies = [
"gdsfactory~=8.3.1",
"gdsfactory~=8.4.0",
"PySpice"
]
description = "skywater130 pdk"
Expand Down Expand Up @@ -88,7 +88,7 @@ select = [
"docs/notebooks/intro.py" = ['B018']

[tool.setuptools.package-data]
mypkg = ["*.csv", "*.yaml"]
mypkg = ["*.gds"]

[tool.setuptools.packages]
find = {}
Expand Down
3 changes: 2 additions & 1 deletion sky130/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -13454,7 +13454,8 @@ def sky130_fd_sc_hd__lpflow_clkbufkapwr_8() -> gf.Component:


if __name__ == "__main__":
c = sky130_fd_pr__rf_nfet_01v8_lvt_cM04W1p65L0p18()
c = sky130_fd_sc_hd__a32oi_2()
# c = sky130_fd_pr__rf_nfet_01v8_lvt_cM04W1p65L0p18()
# c = sky130_fd_pr__rf_nfet_01v8_lvt_aM02W5p00L0p18()
# c = sky130_fd_sc_hd__inv_1()
c.show()
6 changes: 3 additions & 3 deletions sky130/nmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def nmos(
layer=diffusion_layer,
)

poly.ymin = -end_cap_length
poly.dymin = -end_cap_length
poly.dxmin = 0

diff.dxmin = -sd_width
Expand All @@ -76,10 +76,10 @@ def nmos(
contact_array_right = c << contact_array

contact_array_left.dxmin = -sd_width + contact_enclosure
contact_array_left.ymin = contact_enclosure
contact_array_left.dymin = contact_enclosure

contact_array_right.dxmax = diff.dxmax - contact_enclosure
contact_array_right.ymin = contact_enclosure
contact_array_right.dymin = contact_enclosure
return c


Expand Down
4 changes: 2 additions & 2 deletions sky130/pcells/nmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def nmos(
li1 = c.add_ref(rect_lid, rows=1, columns=nc, spacing=con_sp)
li2 = c.add_ref(rect_lid, rows=1, columns=nc, spacing=con_sp)

# rect_m1d = gf.components.rectangle(size= ( contact_size[0] + 2*mcon_enclosure[0], cont_arr1.dymax - cont_arr1.ymin + contact_size[1] + 2*mcon_enclosure[1]), layer= m1_layer)
# rect_m1d = gf.components.rectangle(size= ( contact_size[0] + 2*mcon_enclosure[0], cont_arr1.dymax - cont_arr1.dymin + contact_size[1] + 2*mcon_enclosure[1]), layer= m1_layer)
rect_m1d = gf.components.rectangle(
size=(contact_size[0] + 2 * mcon_enclosure[0], gate_width), layer=m1_layer
)
Expand Down Expand Up @@ -398,7 +398,7 @@ def nmos(
rect_dnw = gf.components.rectangle(
size=(
rect_pw.dxmax - rect_pw.dxmin + 2 * dnwell_enclosure[0],
rect_pw.dymax - rect_pw.ymin + 2 * dnwell_enclosure[1],
rect_pw.dymax - rect_pw.dymin + 2 * dnwell_enclosure[1],
),
layer=dnwell_layer,
)
Expand Down
4 changes: 2 additions & 2 deletions sky130/pcells/nmos_5v.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def nmos_5v(
rect_dnw = gf.components.rectangle(
size=(
rect_pw.dxmax - rect_pw.dxmin + 2 * dnwell_enclosure[0],
rect_pw.dymax - rect_pw.ymin + 2 * dnwell_enclosure[1],
rect_pw.dymax - rect_pw.dymin + 2 * dnwell_enclosure[1],
),
layer=dnwell_layer,
)
Expand All @@ -370,7 +370,7 @@ def nmos_5v(
rect_hv = gf.components.rectangle(
size=(
rect_pw.dxmax - rect_pw.dxmin + 2 * dnwell_enclosure[0],
rect_pw.dymax - rect_pw.ymin + 2 * dnwell_enclosure[1],
rect_pw.dymax - rect_pw.dymin + 2 * dnwell_enclosure[1],
),
layer=hvi_layer,
)
Expand Down
Loading

0 comments on commit fce4aec

Please sign in to comment.