Tutorial Notebook Bug Fix + Notebook CI Flow + Merging 5T-OTA Example #87, 92 #95
Merged
Conversation
In this part 2 5T OTA tutorial notebook, we did LVS, PEX, and post layout simulation. Only LVS is finished, the others are still not finished. This cell is already DRC and LVS clean
Tutorial state was a mix of broken imports (glayout.elementary, glayout.flow),
missing PDK env-var handling, hardcoded /foss/designs paths, and a shipping
defect in the gf180 DRC deck. After the fixes the same 12 notebooks pass
under both a bare conda env and inside hpretl/iic-osic-tools.
Source fixes (CI-neutral — DRC/LVS results unchanged):
* gf180_mapped: route gf180.drc() through a tiny wrapper deck that bridges
klayout>0.29 -rd var names and loads the bundled standalone gf180mcu.drc,
replacing the broken gf180mcu_drc.lydrc that referenced unbundled
drc/rule_decks/*.drc fragments
* mappedpdk: invoke netgen via `bash $(which netgen)` so the wrapper's
`#!/bin/sh` + bashisms don't blow up under dash
Notebook fixes:
* import paths updated to current glayout layout (cells/elementary,
cells/composite/opamp) in GLayout_Cells + glayout_opamp
* glayout_opamp: drop external-OpenFASOC RL/tapeout cells (sky130_nist_tapeout,
gen_spec, model, eval), replace with a pointer to that repo, keep the
layout-generation flow
* INV_part2: add missing `from gdsfactory import Component`, replace broken
inv_netlist cell, populate empty LVS/PEX placeholder cells, replace the
`comp` HTML-repr cell that needed layer_views the PDK doesn't provide
* FVF/INV part1: writer cells now drop helpers in tutorial/{FVF,INV}/ instead
of ../../{FVF,INV}/; INV writer stashes fet_P/fet_N on top_level.info so
part2's netlist generator can find them
* BJT tutorials: drop /foss/designs hardcoding, use Path.cwd() instead
* every PDK-touching notebook now starts with a unified env bootstrap that
sources ~/.bashrc (for iic-osic-tools), uses setdefault so caller-exported
vars always win, and derives PDKPATH=$PDK_ROOT/$PDK when missing
* HOW_TO_RUN.md documents both the iic-osic-tools venv workaround
(gdsfactory 7.x venv shadowing the image's 9.x) and the bare-conda flow
CI:
* new notebooks.yml workflow runs in parallel with drc.yml on push/PR,
exercises every tutorial/**/*.ipynb via jupyter nbconvert, emits
summary.json + junit.xml in the same shape as run_cell_drc.py
* tests/notebooks/run_tutorial_notebooks.py is the runner; sorts so
part1 notebooks execute before part2 (helper-module dependency)
* .gitignore re-includes .github/ since the pre-existing `.*/` rule was
swallowing new workflow files; also ignores tutorial-time scratch
(helpers, GDS, SVGs, lyrdb, magic ext dirs)
Adds tests/notebooks/check_outputs_cleared.py — a stdlib-only precheck that flags any code cell shipping with execution_count != None or non-empty outputs. notebooks.yml now runs this right after checkout, before the nbconvert step, so a contributor who forgets to clear outputs fails CI in under a second instead of waiting through the ~3 min execution pass. The script also has a --fix mode that strips outputs in-place, mirroring `jupyter nbconvert --clear-output --inplace`, for use as a local pre-push hook.
Pulls in the 5T OTA tutorial part 1 + part 2 notebooks from DharmaAnargyaJowandy:5T_OTA (ReaLLMASIC#87). The upstream PR shipped part 2 with non-cleared cell outputs (execution_count and output blobs from a local run); stripped in-place during the merge with `check_outputs_cleared.py --fix` so the new cleared-outputs CI precheck passes. Both notebooks executed end-to-end inside iic-osic-tools via our notebook CI runner (~14s and ~24s respectively). Original commits: ba50d36 fix: Connect Dummy to tapring 4f6300c feat: add 5T OTA Tutorial Part 2 8b8ce9e feat: add 5T OTA Tutorial
…aLLMASIC#87's part 2) PR ReaLLMASIC#92 (AdrianSPratama:main) and PR ReaLLMASIC#87 (DharmaAnargyaJowandy:5T_OTA) both add `tutorial/glayout_tutorial_5T_OTA_part2.ipynb` with different content — this is an add/add conflict. Resolved by taking ReaLLMASIC#92's version, which is the more thorough notebook (24 cells vs 15, includes a PEX section, more markdown explanation of the LVS/PEX/sim flow). Part 1 from ReaLLMASIC#87 stays. Both 5T_OTA notebooks pass the cleared-outputs precheck and execute end-to-end in iic-osic-tools via run_tutorial_notebooks.py (part1 12.8s, part2 37.5s). Original commit: c334af5 feat part 2 of 5T OTA tutorial notebook
Contributor
Author
|
@msaligane Hi Mehdi, Let's merge this as soon as possible for the upcoming Chipathon |
This was referenced May 28, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recent repo changes like folder rearrangement break some tutorial notebooks. This PR fixes those issues and added a CI flow. Now all the notebooks should run end-to-end without error.
Summary
tutorial/so the full suite (12 notebooks) executes end-to-end. Verified in both a bare conda env and insidehpretl/iic-osic-tools— seetutorial/HOW_TO_RUN.mdfor the env-var contract and the venv workaround for iic-osic-tools' Python 3.12 + gdsfactory 9.x..github/workflows/notebooks.yml, runs in parallel withCell DRCon every push/PR. Uses the same iic-osic-tools container + uv + Python 3.10 venv pattern asdrc.yml.tests/notebooks/check_outputs_cleared.py) that fails the CI before the multi-minute nbconvert pass if any notebook ships with staleexecution_count/ cell outputs.--fixmode strips in place.gf180.drc()was broken becausegf180mcu_drc.lydrcreferenceddrc/rule_decks/*.drcfragments that aren't bundled in the package. Routed through a tiny wrapper deck that bridges klayout >0.29-rdvar names and loads the standalonegf180mcu.drcinstead.MappedPDK.lvs_netgennow invokes netgen viabash $(which netgen). The netgen wrapper ships with#!/bin/shbut uses bashisms (${i//\"/\\\"}) that explode under dash (/bin/shon Ubuntu).GLayout_Cells/glayout_opamp: updated stale import paths (glayout.elementary,glayout.flow.*) to the currentglayout.cells.elementary/glayout.cells.composite.opamp.opamp. Dropped opamp's RL/sky130_nist_tapeout/gen_spec/model/evalcells (those live in OpenFASOC, not this repo) and replaced them with a markdown pointer.INV_part2: added missingfrom gdsfactory import Component, replaced the brokeninv_netlistcell with a working version, populated the empty LVS/PEX placeholder cells, removed thecompHTML-repr cell that neededlayer_viewsthe PDK doesn't provide.tutorial/{FVF,INV}/(self-contained) instead of../../{FVF,INV}/(outside the repo). INV writer also stashesfet_P/fet_Nontop_level.infoso part-2's netlist generator can find them./foss/designs— usePath.cwd()so they work in both envs.~/.bashrc(for iic-osic-tools), usessetdefaultso caller-exported vars always win, and derivesPDKPATH=$PDK_ROOT/$PDKwhen missing..gitignore: re-includes.github/(the pre-existing.*/rule was hiding new workflow files), ignores tutorial-time scratch (tutorial/FVF,tutorial/INV,tutorial/ext, scratch GDS/SVG/lyrdb, magic extract dirs,notebook_results/).