CircuitSim SPICE Runtime
This page hosts the ngspice WebAssembly runtime used by CircuitSim. It can be embedded inside an
<iframe> and driven via postMessage without exposing any UI. When the
runtime is
ready it broadcasts a { type: 'spice:ready' } message to its parent window.
Send a { type: 'spice:run', requestId, netlist } message to start a simulation. Results are
delivered back as { type: 'spice:result', requestId, result }. Errors are sent as
{ type: 'spice:error', requestId, message }. Progress updates are emitted as
{ type: 'spice:progress', progress }.
Host this file together with spicewrapper.js, spicewrapper.wasm, and
spicewrapper-global.js on a domain configured with
Cross-Origin-Opener-Policy: same-origin,
Cross-Origin-Embedder-Policy: require-corp, and
Cross-Origin-Resource-Policy: same-origin.