GPU accelerated SPICE/simulator
  • Rust 94.8%
  • Verilog 3%
  • SourcePawn 1.6%
  • HTML 0.2%
  • Ruby 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
microchipster 0f8c50cd9b hardening
2026-10-12 18:53:36 -07:00
crates hardening 2026-10-12 18:53:36 -07:00
docs test gaps 2026-10-08 09:03:18 -07:00
examples EM sim 2026-09-25 10:43:38 -07:00
fixtures test gaps 2026-10-08 09:03:18 -07:00
scripts test gaps 2026-10-08 09:03:18 -07:00
.gitignore sim advance 2026-05-07 00:53:43 -07:00
backlog-methodology.md great progress 2026-10-07 12:44:04 -07:00
Cargo.lock test gaps 2026-10-08 09:03:18 -07:00
Cargo.toml hardening 2026-10-12 18:53:36 -07:00
CHANGELOG.md test gaps 2026-10-08 09:03:18 -07:00
LICENSE-APACHE hardening 2026-10-12 18:53:36 -07:00
LICENSE-MIT hardening 2026-10-12 18:53:36 -07:00
README.md test gaps 2026-10-08 09:03:18 -07:00
renovate.json rennovate 2026-10-05 10:32:45 -07:00

GAS — GPU-Accelerated SPICE

An open-source mixed-signal circuit simulator in Rust. Parses SPICE netlists, runs DC/AC/transient/noise analyses on CPU, and targets GPU compute acceleration via wgpu for the heavy lifting.

Current state: working CLI, SPICE netlist parser, linear MNA solver core, RF/noise analysis, mixed-signal LUT/RNM support, and GPU compute benchmarks for targeted workloads (frequency grids, envelope reduction, LUT interpolation, RF periodic, digital timing). Not ready for production use — but the foundation is solid.

Docs: CHANGELOG.md records the current unreleased cycle; docs/integration-guide.md explains how to embed or drive GAS from a higher-level flow; docs/open-source-interface-policy.md defines the artifact boundary hosts should program against.

Evidence

Exactly two claims are backed by digest-pinned artifacts committed to this repository:

  • gas:ngspice-parity-goldens — crates/gas-cli/src/tests/fixtures/parity_goldens.json (gas matches committed ngspice-44.2 reference values within each fixture tolerance)
  • gas:capability-matrix — docs/capability-matrix.md (generated claim catalog)

Both are verified by cargo test -p gas-evidence against fixtures/evidence/tool_evidence.json. The other capabilities listed below (analog analyses, mixed-signal, visualization, GPU benchmarks, PDK loading) are exercised by cargo test --workspace and their own report artifacts, but are not digest-pinned in the evidence manifest yet.

Cross-simulator parity coverage: 46 fixtures, 138 simulator lanes — 135 passed, 3 unsupported, 0 failed. The write-up of that audit lives in the parent workspace (../docs/audits/), not in this repository; a standalone clone will not have it. Likewise the workspace ./scripts/circuits roll --all-plans gate runner is out-of-repo. cargo test --workspace runs the full local suite anywhere.

Build & Run

cargo build
cargo test

Run example circuits:

cargo run -p gas-cli -- run-linear-spice examples/analog/rc_lowpass_ac.sp --analysis ac --freq-hz 1.0e6
cargo run -p gas-cli -- run-linear-spice examples/analog/rc_settling_tran.sp --analysis transient
cargo run -p gas-cli -- run-noise-spice examples/analog/rc_lowpass_noise.sp --temp-k 300
cargo run -p gas-cli -- inspect-spice examples/analog/rc_lowpass_ac.sp
cargo run -p gas-cli -- render-viz-session crates/gas-tui/src/sample_session.json
cargo run -p gas-cli -- render-viz-web crates/gas-tui/src/sample_session.json --out /tmp/viz.html

What Works

  • SPICE parsing: resistors, capacitors, inductors, sources, MOSFETs, diodes, switches, behavioral sources, subcircuits, .param, .model, .include, .control/.endc, .meas — numeric suffixes, continuation lines, curly-brace expressions
  • Analog analyses: DC operating point, AC sweep, transient, noise
  • Mixed-signal: LUT-based delay models, RNM generation
  • Visualization: TUI (ratatui) and static HTML output from session files
  • GPU benchmarks: wgpu compute shaders for frequency grids, envelope reduction, RF periodic, digital timing, LUT batch interpolation
  • PDK loading: loads open PDK contract manifests and discovers installed open-PDK views (SkyWater 130nm, GF 180nm, IHP 130nm BiCMOS) through the adapter ladder; not a foundry signoff kit

Every GPU code path has an explicit CPU fallback.

Workspace Crates

The project is 14 Rust crates in a Cargo workspace:

Crate What it does
gas-cli CLI binary (gas) — ties everything together
gas-core Shared types, diagnostics, backend selection
gas-spice SPICE netlist parser and elaborator
gas-analog Linear MNA DC/AC/noise solver
gas-ms Mixed-signal LUT/RNM evaluation
gas-sv SystemVerilog/RNM generation
gas-pdk PDK contract loading
gas-viz Visualization session types
gas-tui Terminal UI (ratatui)
gas-web HTML visualization output
gas-evidence Machine-readable reports
gas-artifact Open artifact detection
gas-geometry Parasitic extraction, RC reduction, mesh/FEM
gas-board Board-level thermal/mechanical checks

GPU Strategy

The simulator uses wgpu (WebGPU) — not CUDA or OpenCL directly. Compute shaders are WGSL embedded in Rust source. This gives us Vulkan/Metal/DX12/OpenGL ES coverage from one codebase.

Current GPU workloads are benchmark-stage (measuring speedup vs CPU fallback for specific kernels). The linear solver itself is still CPU-based.

Philosophy

  • Rust-first. The simulator and all tooling are Rust. SystemVerilog/RNM output is the only non-Rust artifact emitted.
  • Open tooling required, proprietary optional. Output formats are always open. If a proprietary tool wants to consume them, fine — but nothing proprietary is required to build or run.
  • Honest claims. GPU benchmarks report what's accelerated and what's not, with fallback reasons.

Examples

Circuit decks live in examples/:

  • examples/analog/ — RC lowpass AC, transient, noise
  • examples/digital/ — standard-cell pulse, SERDES PHY lane (RTL + testbench)
  • examples/mixed_signal/ — LUT-based TX delay model
  • examples/modern/ — coverage/claim catalogs

License

Dual-licensed MIT OR Apache-2.0 — your choice.


This is a young project. If something's broken or missing, that's probably because it's on the backlog.