Skip to content

RustRCX Architecture

RustRCX is a clean-room, pure-Rust (edition = "2024", rust-version = "1.100", #![deny(unsafe_code)]) parasitic extraction and electromagnetic field-solver suite shared across RustEDA, RustROAD, and RustLayout.

Crate Topology

                        ┌─────────────────────────────────────────┐
                        │        rustrcx-cli (rustrcx bin)        │
                        └───────────────────┬─────────────────────┘
                                            │
                        ┌───────────────────▼─────────────────────┐
                        │             rustrcx-solver              │
                        │   3D FD Laplace · 3D BEM · Hybrid ·     │
                        │        TICER · Y(jω) Verifier           │
                        └───────────────────┬─────────────────────┘
                                            │
                        ┌───────────────────▼─────────────────────┐
                        │               rustrcx-gds               │
                        │   GDSII/.gds.gz · Boolean · Devices ·   │
                        │   Shielded 2.5D Cap · 2D FVM Sheet R    │
                        └───────┬───────────┬───────────┬─────────┘
                                │           │           │
               ┌────────────────▼─┐  ┌──────▼───────┐  ┌▼──────────────────┐
               │  rustrcx-core    │  │rustrcx-profile│  │  rustrcx-formats  │
               │ 2.5D Strip Engine│  │SKY130/SG13G2/ │  │ IEEE 1481 SPEF ·  │
               │ PassiveInstance  │  │GF180 min/nom/ │  │ SPICE PEX ·       │
               │ Local Inspector  │  │max + Tech/LEF │  │ overlay.v1 JSON   │
               └────────▲─────────┘  └──────▲───────┘  └▲─────────▲────────┘
                        │                   │           │         │
          ┌─────────────┴───────────────────┼───────────┴─┐     ┌─┴──────────────┐
          │         modules/RustROAD        │             │     │modules/RustLayout
          │   (zero-copy PassiveInstance    │             │     │(LayoutDb -> PEX│
          │    + streamed SPEF for RustSTA) │             │     │ CLI + GUI tab) │
          └─────────────────────────────────┘             └─────┴────────────────┘

Shared Submodule Boundary

  1. modules/RustROAD depends strictly on rustrcx-core and rustrcx-formats, connecting its macro/stdcell obstacle database via a zero-copy PassiveInstanceSource adapter without duplicating a single line of strip extraction or SPEF serialization code.
  2. modules/RustLayout bridges its hierarchical spatial LayoutDb (supporting .gds, .gds.gz, .oas, and zero-copy .rlay) directly into rustrcx_gds::FlattenedLayout with zero disk re-parsing, powering both rustlayout pex CLI extraction and the interactive Parasitics dock panel (with click-to-zoom net & coupling hotspot highlighting).
  3. modules/RustRCX has zero upward dependencies on RustROAD, RustLayout, or RustEDA app crates, enabling standalone CLI usage, independent versioning, and clean CI testing.

Core Algorithms

1. Exact Integer-DBU Geometry & Connectivity (rustrcx-gds)

  • GDSII Reader & Flattener: Pure-Rust .gds / .gds.gz parser with exact D4 transforms, bounded AREF expansion, DAG cycle detection, and hierarchical blackboxing (--cut CELL[=PREFIX]).
  • Spatial-Grid Connected-Component Boolean Algebra (poly.rs): union_rects (OR), intersect_rects (AND), and subtract_rect_sets (DIFF) partition shapes via an adaptive 2D spatial grid so non-overlapping shapes pass through in O(1) while overlapping clusters solve in parallel via exact O((M + K) log M) BTreeMap scanlines.
  • Exposed Boundary-Edge Extraction: Cancels internal abutting seams between co-net rectangles so perimeter, fringe, and sidewall capacitance never double-counts interior edges.
  • Device Recognition: Splits diff \ gate before net connectivity so MOSFET source and drain remain distinct nets, recognizing LV/HV NMOS/PMOS (exact W, L, AS, AD, PS, PD, NF, bulk), MIM capacitors (XCMIM), and poly resistors (RPOLY), while excluding intrinsic MOSFET gate oxide (Cox/CGSO/CGDO) and MIM plate overlap from extrinsic PEX double-counting.

2. Multi-Layer Shielded 2.5D Capacitance (pex25d.rs)

  • Chunk-parallelized per-layer extraction across all logical cores with deterministic reduction.
  • Exact multi-layer vertical shielding (subtract_rects from li - 1 down to 0).
  • Intrinsic MOSFET channel subtraction (poly \ gate_rects) and NWell substrate attribution for field poly.
  • Nearest-neighbor 1D lateral sidewall visibility sweep with smooth exponential fringe screening, upper/lower sideoverlap, diagonal coupling (DIAGUNDER), and via cut capacitance.

3. 2D Finite-Volume Sheet Resistance (fvm_res.rs)

  • Multi-Cut Via Array Clustering: Groups parallel via cuts between the same (net, via_layer, lower_island, upper_island) within local array pitch into a single equivalent parallel resistor R_via / N_cuts.
  • Arbitrary-Polygon 2D FVM Schur Complement: Solves ∇ · (σ ∇V) = 0 on rectilinear subgrids via diagonally preconditioned CG (solve_pcg) and computes exact port-to-port conductance G_eff = G_pp − G_pi G_ii⁻¹ G_ip, capturing L/T/U corner rounding (validated against the analytical ~0.559 sq 90° corner factor).
  • Max-Conductance Spanning Forest + Bypass Pruning: Guarantees full terminal connectivity while pruning non-physical floating-point noise bypasses (< 1% of port max conductance).

4. Native 3D Electrostatic Field Solvers (rustrcx-solver)

  • 3D Layered-Dielectric Finite-Volume Laplace (fd3d.rs): Solves ∇ · (ε(z) ∇φ) = 0 on a geometrically graded 3D rectilinear grid strictly aligned with every conductor face and dielectric stratum boundary, in parallel across net excitations via Rayon. Achieves < 1e-7 fF Maxwell symmetry and < 1e-6 agreement against analytical multi-dielectric parallel-plate theory.
  • 3D Boundary Element Method (bem3d.rs): Solves the first-kind single-layer boundary integral equation using the analytical Hess-Smith rectangular panel potential integral, ground-plane method of images, and restarted GMRES (validated to < 2% on the classical unit-cube free-space benchmark 0.660678).
  • Worklist TICER Reduction & Y(jω) Verification (reduce.rs, admittance.rs): O(N) degree-guarded (deg ≤ 4) Sheehan TICER reduction preserving every port/device terminal, DC conductance, and total capacitance, paired with complex Schur-complement Y(jω) = G + jωC multi-frequency Frobenius-norm error verification.

Multi-Corner PDK Support (rustrcx-profile)

Built-in foundry-calibrated stacks for SKY130A, IHP SG13G2, and GF180MCU D across min, nom, and max corners, plus live parsers for Magic .tech / -extract.tech (including blanket placeholder contact detection for GF180MCU), OpenRCX .rules (WIDTH Table, DIAGUNDER, RESOVER), Tech LEF, and rustroad.rc-profile.v1.