Skip to content

Explicit diffusion and gate sharing in gLayout, with a three-PDK textbook benchmark - #127

Open
DonaldLucy wants to merge 7 commits into
ReaLLMASIC:mainfrom
DonaldLucy:textbook-sharing
Open

DonaldLucy wants to merge 7 commits into
ReaLLMASIC:mainfrom
DonaldLucy:textbook-sharing

Conversation

@DonaldLucy

@DonaldLucy DonaldLucy commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

Base gLayout builds every transistor on its own: fingers of one transistor share diffusion, but two transistors never
share a diffusion node or a gate strap. This pull request adds such sharing to gLayout as an explicit, checkable plan,
and a benchmark that measures what sharing gains and what it costs.

  • src/glayout/sharing/ (new package): SharingPlan (finger order, orientations, diffusion joins, gate straps),
    validate_plan (structured rejection before any geometry is drawn), build_mos_group (draws a group for any
    MappedPDK; the sharing that really happened is measured again on the drawn shapes), and a six-axis enumeration with
    named modes.
  • benchmarks/textbook_sharing/: 18 textbook topologies x SKY130, GF180MCU, IHP SG13G2 x 12 size points; row and
    channel assembly; verification with the official DRC decks, LVS, an extracted-size check, R+C extraction and
    post-layout simulation against frozen specifications; a plan-selection study with a plan-level cost rule; language-model
    sessions through a restricted plan interface; every analysis and the result tables.
  • README.md: a four-line pointer. No existing gLayout code is changed.

Where to start

The 639 case folders and the run records are packed into two archives (data/cases.tar.xz,
results/run_records.tar.xz); unpack both first (README, quick start). The code is in src/glayout/sharing/ and
benchmarks/textbook_sharing/textbook_sharing/.

  1. benchmarks/textbook_sharing/README.md: the idea in one example (a five-transistor OTA), quick start.
  2. benchmarks/textbook_sharing/docs/DESIGN.md: how a plan is checked and drawn, the enumeration, the row assembler,
    where area goes, the cost rule, the selection study.
  3. Code: src/glayout/sharing/group.py (validate_plan, build_mos_group), evidence.py, enumeration.py;
    benchmark layout.py, assembly/engine.py, verify/, selection/cost.py, llm/plan_parser.py.
  4. docs/PARAMETER_SPACE.md (process x size x plan, counts), docs/VERIFICATION.md, docs/DATA.md (every file and
    field), docs/MODELS.md (model protocol and audit), docs/RESULTS.md (all results with their source tables).

Main results (from results/, details in docs/RESULTS.md)

  • 648 requests give 547 formal entries in 17 topologies; 13 topologies admit sharing across transistors.
  • Sharing diffusion and gates makes 279 of 321 verified layouts smaller (mean -5.5 %, up to -18.4 %). Of the 21 area
    increases over all modes, 19 come from routing and row assembly and 2 from a shared cell whose top-strap pads sit past
    the row ends.
  • The plan-level cost rule, frozen on two development sizes, gets the sign of the area change right for 795 of 872
    held-out pairs and finds a plan within 1.3 % of the best of a 64-plan catalogue with one verification.
  • Language models given the interface reach layouts smaller than every catalogue plan in 16 of 28 tasks; with an
    interface limited to base gLayout, 41 of 42 sessions end at the unshared area.

How it was checked

All in the pinned container image, on the commits of this branch:

  • pytest (17 tests): plan legality and construction, enumeration counts, the program parser, rebuilt areas of the
    running example, data counts, and that every number quoted in the documents equals the result tables.
  • python -m textbook_sharing.analysis.all recomputes all result tables and the generated documents from the run
    records; afterwards git status is clean, so they are byte for byte the committed ones.
  • scripts/reproduce_clean.sh on 41ed33d: five layouts exported with git archive, built and verified from scratch,
    match the recorded geometry hash, area, status and every verification stage
    (results/analysis/repro_clean_20261012T140050Z.json).
  • python -m textbook_sharing.analysis.geometry_check rebuilds all 6159 recorded layouts: 6093 have the recorded
    geometry hash, including every main-grid layout and every model proposal. The other 66 are SKY130 selection
    candidates evaluated before the implant-bridge rule was added; they differ only by 0.35 um^2 of N+ implant, and a
    full re-verification of all 66 with this code reproduces their recorded status, area and stage results
    (results/analysis/geometry_check_diagnosis.json).
  • The visual review was done by a vision model under a blinded protocol, not by a person; every flag was resolved by
    objective checks (official DRC/LVS, connectivity checks), stored in each record.

Not in this pull request

  • The paper, slides and report (kept separately).
  • GDS files, tool logs, renders and extracted netlists (rebuilt by python -m textbook_sharing.run_case ... --from-record),
    and the raw model transcripts.

Known limits

One row-based assembler (another router could move the losses); bounding-box area; one size grid and no Monte Carlo;
the class-AB stage stays diagnostic; magic DRC is advisory; base gLayout in the interface comparison is emulated by one
restricted call; selection candidates outside the reported set were not reviewed visually.

🤖 Generated with Claude Code

Minxing Chu and others added 5 commits October 12, 2026 07:35
A SharingPlan fixes, for one group of same-polarity transistors, the finger order, the orientations, which neighbouring
fingers share a diffusion node and how the gates are tied into poly straps.  validate_plan checks a plan before any
geometry is drawn (structured errors), build_mos_group draws it for any MappedPDK, and the sharing that really
happened is measured again on the drawn shapes.  group_candidates / named_plans enumerate plans over six discrete axes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 textbook topologies on SKY130, GF180MCU and IHP SG13G2: size derivation and schematic qualification, row and channel
assembly of the sharing groups, verification (official DRC decks, LVS, extracted-size check, R+C extraction,
post-layout simulation against frozen specifications, blinded visual review), the plan-selection study with a
plan-level cost rule, model sessions through a restricted plan interface, every analysis behind the results, and
checks that rebuild recorded layouts.  Runs in the pinned IIC-OSIC-TOOLS image with a locked Python environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
data/: 639 case folders (sizing, frozen specification, qualification, target netlists, testbench), nominal design
points and the frozen mode order.  results/: the count ledger, every analysis table, the geometry check of all
recorded layouts, and the run records (JSON and model text; GDS files and tool logs are rebuilt from the code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README with a worked example and quick start; design, parameter space, verification, data dictionary and model
protocol; RESULTS.md and PARAMETER_SPACE.md are generated from the result tables.  Short pointer in the top-level
README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/reproduce_clean.sh on f204d32: five layouts exported, built and verified from scratch match the recorded
geometry hash, area, status and every verification stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DonaldLucy

Copy link
Copy Markdown
Contributor Author

Please don't merge this directly to the main repo. I was trying to open a new branch for this but seems like I don't have the permission

Minxing Chu and others added 2 commits October 12, 2026 14:00
The 4473 small files of data/cases made up most of the change set and pushed the code past the 3000 files that the
pull-request view lists.  They are now data/cases.tar.xz (unpack with `tar -xJf data/cases.tar.xz`); the tests stop
with that hint when the folders are missing, and the full run and the clean reproduction unpack the archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/reproduce_clean.sh on 41ed33d (case archive unpacked in the fresh export): the five layouts match the
recorded geometry hash, area, status and every verification stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant