Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

vyges-tools/layout

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vyges-layout

A memory-safe Rust layout geometry kernel: read/write GDSII and OASIS, do polygon boolean operations, and flatten a cell hierarchy — the substrate the other layout-side tools ride on.

Vyges open EDA tools. Commercial-grade silicon capability, built on open standards and plain file formats — accessible to everyone. vyges-layout is the geometry kernel under LVS extraction, DRC, fill, and the chip viewer.

Docs: docs.vyges.com — this engine's chapter and the cross-engine integration guide. In-repo: docs/engines-integration.md, docs/kernel-notes.md. Integrating and need help?https://vyges.com/contact.

Why this exists

Everything on the layout side is geometry: LVS device extraction (GDS → devices + nets), DRC (width/spacing), metal fill, and viewing a die — they all need to read GDSII, do boolean operations on shapes, and flatten hierarchy. The open peers (KLayout's database, gdstk) are excellent but C++; vyges-layout is the clean-room, memory-safe Rust kernel, so the Vyges layout tools (and the chip viewer) build on a single, auditable base — and it's the dependency that unblocks vyges-lvs native extraction. It is dependency-light and pure-Rust: the only non-Vyges dependency is miniz_oxide (permissive, pure-Rust DEFLATE) for OASIS CBLOCK decompression — no C toolchain, no GPL.

Use it

cargo build --release            # pure-Rust; one small permissive dep (miniz_oxide)

vyges-layout info    block.gds                 # cells, layers, areas, bbox
vyges-layout info    block.gds --json
vyges-layout boolean block.gds --top top --op and --a 67/20 --b 68/20 --out 100/0 -o and.gds
vyges-layout flatten block.gds --top top -o flat.gds
vyges-layout flatten block.gds --top top -o flat.oas   # write OASIS (GDS→OASIS convert)
vyges-layout info    block.oas                          # …and read it back
vyges-layout demo                              # built-in, no files
# `L/D` is layer/datatype; boolean ops: and · or · not (A−B) · xor
# common flags: -o FILE · --json · -q/--quiet · -v/--verbose · -h/--help · -V/--version

A runnable example is generated by cargo run --example gen (committed as examples/two_box.gds): two overlapping metal boxes (for boolean) + two placements of a leaf cell (for flatten).

Domain coverage — digital and analog / mixed-signal

The kernel is pure geometry: layers, datatypes, and polygons. Nothing in read/write, boolean, or flatten knows or cares whether a shape is a standard cell or an analog device — so vyges-layout applies to digital, analog, and mixed-signal layouts identically.

  • Digital: examples/two_box.gds — overlapping metal boxes + a placed leaf cell.
  • Analog: examples/analog/ — a non-standard-cell block (a guard ring, a MIM capacitor, and a poly resistor snake). tests/analog.rs proves (a) the GDS write→read round-trips every shape and vertex exactly, and (b) a boolean across two layers is correct: MIM top-plate AND bottom-plate = the exact cap-overlap rectangle, and OR of the two guard-ring halves reunites the full rectilinear ring.
cargo run --example gen_analog   # (re)writes examples/analog/analog.gds
cargo test --test analog         # round-trip + cross-layer boolean on the analog block

The v0 boolean is Manhattan (rectilinear, exact on integer DBU) — that bound is about the geometry (general-angle clipping is the depth pass), not about the design domain; the analog shapes above are rectilinear and handled exactly.

What it does (v0)

  • GDSII read/write — round-trips a library (BOUNDARY/PATH/SREF/AREF/BOX; the GDS real format for units). This replaces the vendored JS GDS parser in the chip viewer.
  • OASIS read/write — the compact, modern layout interchange format (typically an order of magnitude smaller than the equivalent GDSII). Reads/writes the RECTANGLE / POLYGON / PLACEMENT subset onto the same in-memory model, so info, boolean, and flatten work on either format — and the tools double as a GDS↔OASIS converter (format picked by file extension: .gds vs .oas/.oasis).
  • info — cells, per-cell element counts, layers present, per-layer boundary count and area, in text or JSON.
  • boolean — AND / OR / NOT / XOR between two layers via a vertical scanline on rectilinear polygons (rectangles, L-shapes, holey/overlapping Manhattan shapes; integer coordinates → exact), output to a layer.
  • flatten — expand SREF/AREF hierarchy into one cell (reflect → mag → rotate → translate, composed; AREF arrays expanded; cycles guarded).
  • spatial index (index::RegionIndex) — a uniform-grid index over rectangles for fast region / overlap / spacing-halo queries (the "what's near this shape?" primitive DRC width/spacing, LVS net tracing, and the viewer need to scale beyond O(N²)). Library API; validated against brute force.

Honest bounds (depth reserved). v0 boolean is Manhattan — it handles any rectilinear polygon exactly, but the result is returned as a set of rectangles tiling the region (contour-tracing into merged polygons is depth), and general-angle geometry (a diagonal edge) is bbox-approximated and counted (never silently dropped). General clipping (Vatti) is the depth pass. Arbitrary reference angles round to integer DBU. The OASIS reader is full-coverage — RECTANGLE, POLYGON (with the manhattan implied-closure real writers use), PATH, TRAPEZOID, CTRAPEZOID, CIRCLE, TEXT, PLACEMENT, all repetition forms, properties/name tables, and CBLOCK (DEFLATE) compressionvalidated against a real third-party corpus: the sky130 standard-cell GDS converted to OASIS by gdstk (both compressed and raw) reads back geometry-identical to the source GDS, and a spread of gdstk trapezoids/triangles match by area. The writer emits the RECTANGLE / POLYGON / PLACEMENT subset (Path stroked to rectangles; Text not written; uncompressed). Remaining ingest gap: the rare CTRAPEZOID 2× isoceles-triangle types (20–23), which error clearly rather than guess. The RegionIndex spatial index provides region/overlap/spacing-halo queries; DRC width/spacing rules on top of it, rectangle sizing, and net tracing for device extraction (the piece vyges-lvs Phase 2 consumes) are reserved.

License

Apache-2.0, clean-room (no third-party EDA database). The peers (KLayout-db, gdstk) are libraries, not products; this is the Rust one.

Current state (v0)

GDSII and OASIS read/write (GDS↔OASIS convert), info, Manhattan boolean (and/or/not/xor), hierarchy flatten, and a uniform-grid spatial index for region/overlap/spacing queries; text + JSON; runnable example. Pure std, unit + example tested offline, no subprocess.

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.