You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mixed_ngspice: FP32 Mixed-Precision Ngspice for Analog Sizing
Mixed-precision ngspice-46 that accelerates BSIM4v5 device evaluation by reducing floating-point precision from FP64 to FP32 in struct storage and hot-path math, while keeping critical computations in FP64.
< 0.003% DC accuracy loss on TSMC/SMIC 0.18µm circuits (TT corner)
1.7-2.8× transient speedup on multi-transistor op-amps
-45% working set (struct members halved from 8 to 4 bytes)
v1.2: Double-precision BSIM4 math — 40/40 tests PASS, 0 NaN across 15 circuits × 6 PDKs
double → SPICE_REAL (= float) in 1337 struct members
Same
Working set -45%, better cache
Math
Selective exp() → expf() in hot paths
Reverted to exp() (double)
NaN-free across all PDKs
Safety
Double-precision islands for Vbseff, Leff/Weff
All 6 FP64 islands restored
Eliminates catastrophic cancellation
NaN Guard
40+ NaN detection + zeroing points
Removed (not needed)
Cleaner code, zero overhead
v1.2 strategy: FP32 storage + double-precision BSIM4 math functions.
Double ops account for <10% of hot-path operations (<2% total runtime impact).
This mirrors mixed-precision training in deep learning (FP16 gradients + FP32 accumulation).