tpt-electronics
RustA 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
Languages
tpt-electronics
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-denyenforces a permissive-only dependency graph.
Crates
| Crate | Description | Status |
|---|---|---|
tpt-elec-core | Core domain types, units, linear algebra | ✅ Stable |
tpt-elec-materials | Material property database | ✅ Stable |
tpt-elec-geometry | Traces, pads, voxels, copper areas | ✅ Stable |
tpt-elec-gerber | Gerber RS-274X + Excellon parser | ✅ Stable |
tpt-elec-kicad | KiCad .kicad_pcb / netlist parser | ✅ Stable |
tpt-elec-odbpp | ODB++ reader | 🚧 Alpha |
tpt-elec-ipc2581 | IPC-2581-C XML parser | 🚧 Alpha |
tpt-elec-touchstone | Touchstone S-parameter parser | ✅ Stable |
tpt-elec-spice-netlist | SPICE netlist parser | ✅ Stable |
tpt-elec-thermal | Steady-state thermal FEM | ✅ Stable |
tpt-elec-convection | Natural/forced convection | ✅ Stable |
tpt-elec-transient | Transient thermal integration | ✅ Stable |
tpt-elec-joule | Electro-thermal (Joule heating) | ✅ Stable |
tpt-elec-spice-core | Circuit graph + MNA | ✅ Stable |
tpt-elec-spice-models | MOSFET/diode/BJT models | ✅ Stable |
tpt-elec-spice-analysis | DC/AC/transient/noise | ✅ Stable |
tpt-elec-spice-noise | Noise source models | 🚧 Alpha |
tpt-elec-si-core | Transmission lines, S-parameters | ✅ Stable |
tpt-elec-si-impedance | Microstrip/stripline/diff-pair | ✅ Stable |
tpt-elec-si-crosstalk | NEXT/FEXT models | 🚧 Alpha |
tpt-elec-si-eye | Eye diagrams + mask compliance | ✅ Stable |
tpt-elec-pi-pdn | PDN impedance analysis | ✅ Stable |
tpt-elec-pi-decoupling | Decap selection/placement | 🚧 Alpha |
tpt-elec-rf-core | Smith chart, L/pi matching | ✅ Stable |
tpt-elec-rf-filters | Filter synthesis | ✅ Stable |
tpt-elec-rf-antenna | Antennas, link budgets | ✅ Stable |
tpt-elec-rf-mixer | Mixer models | 🚧 Alpha |
tpt-elec-rf-links | RF chain composition | 🚧 Alpha |
tpt-elec-power-core | Converter topologies/design | ✅ Stable |
tpt-elec-power-magnetics | Cores, windings, Steinmetz | ✅ Stable |
tpt-elec-power-switches | Switch/diode losses | ✅ Stable |
tpt-elec-power-control | Loops, Bode, compensation | ✅ Stable |
tpt-elec-power-battery | Battery-aware power delivery | 🚧 Alpha |
tpt-elec-semi-core | Semiconductor fundamentals | 🚧 Alpha |
tpt-elec-semi-mosfet | MOSFET compact models | 🚧 Alpha |
tpt-elec-semi-diode | Diode compact models | 🚧 Alpha |
tpt-elec-semi-bjt | BJT Ebers-Moll model | 🚧 Alpha |
tpt-elec-semi-process | PDK abstractions | 🚧 Alpha |
tpt-elec-emc-core | EMC standards + limit lines | ✅ Stable |
tpt-elec-emc-emissions | Emissions prediction | ✅ Stable |
tpt-elec-emc-immunity | Immunity test modeling | 🚧 Alpha |
tpt-elec-emc-shielding | Shielding effectiveness | ✅ Stable |
tpt-elec-emc-grounding | Grounding / return paths | 🚧 Alpha |
tpt-elec-battery-core | Cell + ECM models | ✅ Stable |
tpt-elec-battery-thermal | Thermal runaway propagation | 🚧 Alpha |
tpt-elec-battery-bms | SOC estimation (KF/EKF/UKF) | ✅ Stable |
tpt-elec-battery-pack | Pack composition | ✅ Stable |
tpt-elec-mfg-dfm | DRC engine + IPC-2152 | ✅ Stable |
tpt-elec-mfg-test | IEEE 1149.1 boundary scan | 🚧 Alpha |
tpt-elec-mfg-yield | Yield prediction | ✅ Stable |
tpt-elec-wasm | WebAssembly bindings (thermal, SPICE, eye, PDN) | 🚧 Alpha |
tpt-elec-cli | Gerber → 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
- MIT license (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
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.