tpt-electronics

Rust

A pure-Rust, MIT/Apache-2.0 multiphysics simulation engine for electronic systems (thermal, Joule heating, SPICE, signal integrity, RF, power, EMC, battery). Parses Gerber/KiCad/ODB++, runs coupled electro-thermal FEM, and compiles to WASM — fully open source with a strict MIT license chain

0 stars1 forks0 watchersApache License 2.0

Languages

Rust97.0%Python2.5%JavaScript0.5%
README

tpt-electronics

CI Docs License

A fully open-source, MIT-licensed multiphysics simulation engine for electronic systems, written in pure Rust.

📖 Documentation (mdBook + rustdoc)

tpt-electronics solves the problems that kill hardware projects — thermal runaway, electromigration, signal-integrity failures, power-delivery droop, EMC certification failures, and battery-pack safety — using standard EDA inputs (Gerber, ODB++, IPC-2581, KiCad, Touchstone, SPICE) and zero proprietary or GPL-contaminated dependencies.

No proprietary cores. No open-core bait. No GPL traps. Just open source.

Highlights

  • 100% Rust, zero runtime dependencies — the numeric stack (dense/sparse linear algebra, Conjugate Gradient, complex arithmetic) lives in tpt-elec-core; nothing else is pulled in.
  • Standards-driven — validated against JEDEC JESD51 (thermal), IPC-2141 / IPC-2152 / IPC-2221 (boards), CISPR 32 / FCC Part 15 / IEC 61000 (EMC), IEEE 1149.1 (test), UN GTR 20 / IEC 62660 (battery).
  • WASM-ready — compile the whole engine to WebAssembly for browser EDA tools, VS Code extensions, or CI pipelines. No server round-trips.
  • License-clean — every crate is MIT OR Apache-2.0; cargo-deny enforces a permissive-only dependency graph.

Crates

CrateDescriptionStatus
tpt-elec-coreCore domain types, units, linear algebra✅ Stable
tpt-elec-materialsMaterial property database✅ Stable
tpt-elec-geometryTraces, pads, voxels, copper areas✅ Stable
tpt-elec-gerberGerber RS-274X + Excellon parser✅ Stable
tpt-elec-kicadKiCad .kicad_pcb / netlist parser✅ Stable
tpt-elec-odbppODB++ reader🚧 Alpha
tpt-elec-ipc2581IPC-2581-C XML parser🚧 Alpha
tpt-elec-touchstoneTouchstone S-parameter parser✅ Stable
tpt-elec-spice-netlistSPICE netlist parser✅ Stable
tpt-elec-thermalSteady-state thermal FEM✅ Stable
tpt-elec-convectionNatural/forced convection✅ Stable
tpt-elec-transientTransient thermal integration✅ Stable
tpt-elec-jouleElectro-thermal (Joule heating)✅ Stable
tpt-elec-spice-coreCircuit graph + MNA✅ Stable
tpt-elec-spice-modelsMOSFET/diode/BJT models✅ Stable
tpt-elec-spice-analysisDC/AC/transient/noise✅ Stable
tpt-elec-spice-noiseNoise source models🚧 Alpha
tpt-elec-si-coreTransmission lines, S-parameters✅ Stable
tpt-elec-si-impedanceMicrostrip/stripline/diff-pair✅ Stable
tpt-elec-si-crosstalkNEXT/FEXT models🚧 Alpha
tpt-elec-si-eyeEye diagrams + mask compliance✅ Stable
tpt-elec-pi-pdnPDN impedance analysis✅ Stable
tpt-elec-pi-decouplingDecap selection/placement🚧 Alpha
tpt-elec-rf-coreSmith chart, L/pi matching✅ Stable
tpt-elec-rf-filtersFilter synthesis✅ Stable
tpt-elec-rf-antennaAntennas, link budgets✅ Stable
tpt-elec-rf-mixerMixer models🚧 Alpha
tpt-elec-rf-linksRF chain composition🚧 Alpha
tpt-elec-power-coreConverter topologies/design✅ Stable
tpt-elec-power-magneticsCores, windings, Steinmetz✅ Stable
tpt-elec-power-switchesSwitch/diode losses✅ Stable
tpt-elec-power-controlLoops, Bode, compensation✅ Stable
tpt-elec-power-batteryBattery-aware power delivery🚧 Alpha
tpt-elec-semi-coreSemiconductor fundamentals🚧 Alpha
tpt-elec-semi-mosfetMOSFET compact models🚧 Alpha
tpt-elec-semi-diodeDiode compact models🚧 Alpha
tpt-elec-semi-bjtBJT Ebers-Moll model🚧 Alpha
tpt-elec-semi-processPDK abstractions🚧 Alpha
tpt-elec-emc-coreEMC standards + limit lines✅ Stable
tpt-elec-emc-emissionsEmissions prediction✅ Stable
tpt-elec-emc-immunityImmunity test modeling🚧 Alpha
tpt-elec-emc-shieldingShielding effectiveness✅ Stable
tpt-elec-emc-groundingGrounding / return paths🚧 Alpha
tpt-elec-battery-coreCell + ECM models✅ Stable
tpt-elec-battery-thermalThermal runaway propagation🚧 Alpha
tpt-elec-battery-bmsSOC estimation (KF/EKF/UKF)✅ Stable
tpt-elec-battery-packPack composition✅ Stable
tpt-elec-mfg-dfmDRC engine + IPC-2152✅ Stable
tpt-elec-mfg-testIEEE 1149.1 boundary scan🚧 Alpha
tpt-elec-mfg-yieldYield prediction✅ Stable
tpt-elec-wasmWebAssembly bindings (thermal, SPICE, eye, PDN)🚧 Alpha
tpt-elec-cliGerber → thermal CSV CLI✅ Stable

Status legend: ✅ Stable · 🚧 Alpha · 📋 Planned

Quick Start

Newcomer path (paste-able):

$ git clone https://github.com/tpt-solutions/tpt-electronics
$ cd tpt-electronics
$ cargo build --workspace
$ cargo test --workspace
$ cargo run -p example-pcie-eye-diagram

Or scaffold a fresh analysis project with cargo generate:

$ cargo generate tpt-solutions/tpt-electronics-template

Or add the CLI:

$ cargo install --path crates/cli/tpt-elec-cli
$ tpt-elec-cli help

Thermal analysis from a Gerber file:

use tpt_elec_gerber::GerberParser;
use tpt_elec_thermal::ThermalSolver;
use tpt_elec_materials::MaterialDatabase;

let gerber = GerberParser::parse(include_str!("board.gtl")).unwrap();
let materials = MaterialDatabase::standard();
let solver = ThermalSolver::from_gerber(&gerber, &materials, 1e-3);
let result = solver.solve_steady_state();
println!("Max temperature: {:.1} °C", result.max_temp);

50 Ω microstrip on 1.6 mm FR4:

use tpt_elec_si_impedance::ImpedanceCalculator;

let line = ImpedanceCalculator::microstrip(3.0e-4, 3.5e-5, 1.6e-3, 4.4);
println!("Z0 = {:.1} Ω", line.z0);

SPICE in pure Rust:

use tpt_elec_spice_netlist::SpiceNetlistParser;
use tpt_elec_spice_analysis::SpiceAnalyzer;

let circuit = SpiceNetlistParser::parse("R1 in out 1k\nC1 out 0 1n\n...").unwrap();
let analyzer = SpiceAnalyzer::new(circuit);
let ac = analyzer.ac_analysis(1.0, 1.0e9, 10).unwrap();

CLI

tpt-elec-cli exposes subcommands thermal, impedance, drc, and report. Install with cargo install --path crates/cli/tpt-elec-cli and run tpt-elec-cli help for the full flag reference.

$ tpt-elec-cli thermal --gerber top.gtl --power-map power.csv \
    --out thermal.csv --format csv --resolution-mm 0.5 \
    --thickness-mm 1.6 --h-conv 10 --ambient-c 25

$ tpt-elec-cli impedance --width-mm 0.3 --height-mm 1.6 --er 4.4 \
    --suggest --target 50

$ tpt-elec-cli drc --kicad board.kicad_pcb --min-width-um 150

$ tpt-elec-cli report --out thermal.csv

Run tpt-elec-cli help for the full flag reference.

Governance

  • License: MIT OR Apache-2.0 (dual)
  • Contributions: pull requests are not accepted — please file an issue (see CONTRIBUTING.md)
  • Governance: Benevolent Dictator + RFC process
  • Releases: SemVer, 6-week minor cadence
  • Security: SECURITY.md, private disclosure

Development

$ cargo build --workspace
$ cargo test --workspace
$ cargo fmt --all -- --check
$ cargo clippy --workspace
$ cargo deny check licenses

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.