Skip to content

BEOL/FEOL metal fill with recursive partitioning (C++)#2

Draft
sethupathib wants to merge 5 commits into
mainfrom
cursor/beol-metal-fill-partitioning-caf3
Draft

BEOL/FEOL metal fill with recursive partitioning (C++)#2
sethupathib wants to merge 5 commits into
mainfrom
cursor/beol-metal-fill-partitioning-caf3

Conversation

@sethupathib

@sethupathib sethupathib commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Overview

New C++17 project in gpu_metal_fill/: a dependency-free dummy metal fill engine for FEOL base layers (OD, PO) and BEOL metals (M1..M14). It uses recursive quadtree partitioning (like commercial fill flows) so leaves can be filled independently/in parallel and then merged. It also ships a synthetic GPU-block GDS generator for realistic testing.

GPU offload is intentionally deferred: the compute-heavy stages are isolated behind a FillBackend interface (CPU/OpenMP now, CUDA later).

Pipeline (per layer)

  1. Rasterize existing geometry into an occupancy grid.
  2. Windowed density via a summed-area table (O(1) per window).
  3. Keep-out halo = morphological dilation by the spacing rule.
  4. Fill on a pitch lattice, per window, up to a per-window target, never exceeding max, never entering keep-out.
  5. Iterative DRC: measure achieved density, raise targets for windows still below min or too far below a denser neighbor (gradient), refill until converged.

Recursive partitioning (correctness at boundaries)

  • Lattice-aligned cuts at lcm(density_window, fill_pitch) so windows and fill positions are identical globally vs per-partition.
  • Halo/guard band: each leaf reads neighboring geometry as read-only context but only emits fill in its disjoint core, so merge = concatenation.
  • Unit test asserts partition == global (merged result identical to a single-shot fill).

Synthetic GPU block (make_gpu_block)

A structurally realistic (not real) GPU block: 3×3 SM tiles each with SRAM macros (register file + shared memory) and standard-cell logic, routing channels, clock/spine routes (M9/M10), and a sparse top-metal power grid (M11–M14). Each layer gets a distinct density profile.

Result on the generated block (180×180 µm, 15,885 polygons, 52 partitions/layer): 1.39M fill shapes, 0 DRC violations.

M1 (logic + SRAM macros) and M12 (power grid) — red = quadtree partition cores, navy = existing, orange = dummy fill (note keep-out halos around the power straps):

GPU block M1 before
GPU block M1 after
GPU block M12 power grid after

Full GPU-block report: gpu_fill_report.txt

Build / run

cd gpu_metal_fill
make            # tools -> build/
make test       # 77 checks, 0 failures
make demo       # simple synthetic layout
make gpu-demo   # realistic GPU-block layout

Notes

  • The default layer map / rules in layermap.cpp are illustrative, not a real PDK.
  • CUDA backend and via fill are follow-ups.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 5 commits July 3, 2026 01:58
- Minimal GDSII reader/writer, polygon rasterization
- Windowed density via summed-area tables
- Keep-out dilation + per-window density-driven fill placement
- Recursive quadtree partitioning with lattice-aligned cuts + halo context,
  merged by concatenation (verified equivalent to a global fill)
- Gradient-aware iterative DRC-driven fill (min/max/gradient/spacing/min-area)
- OpenMP-parallel across partitions; compute isolated behind FillBackend for
  a future CUDA/GPU backend
- Tools: make_dummy_gds, run_fill, render_layer; unit + e2e tests

Co-authored-by: Sethupathi Balakrishnan <b.sethupathi@gmail.com>
- 3x3 SM tiles with SRAM macros (register file + shared memory) + logic
- routing channels, clock/spine routes, and a sparse top-metal power grid
- gives each layer a distinct density profile for realistic fill testing
- add 'make gpu-demo' target; fills cleanly with 0 DRC violations

Co-authored-by: Sethupathi Balakrishnan <b.sethupathi@gmail.com>
Co-authored-by: Sethupathi Balakrishnan <b.sethupathi@gmail.com>
Co-authored-by: Sethupathi Balakrishnan <b.sethupathi@gmail.com>
Co-authored-by: Sethupathi Balakrishnan <b.sethupathi@gmail.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.

2 participants