ngspice¶
ngspice is Monata’s current native simulator target. Monata renders native
monata.netlist.Circuit objects to ngspice-compatible text and executes them
through a user-installed ngspice runtime.
Monata has two ngspice runner paths:
ngspice-subprocessis the stable default. It runs a localngspiceexecutable through a subprocess.ngspice-sharedis the same-simulator shared-library path. It loads a locallibngspiceshared library through Monata’s default Python FFI dependency.
The current ngspice backend support covers deterministic DC sweep, transient,
AC, operating-point, and noise runs. Unsupported analyses return
SimResult(status="failed") with an explicit reason until their native
implementations are added.
Runtime Contract¶
The public Monata package does not bundle
ngspice.The backend resolves a local
ngspiceexecutable fromPATHorCONDA_PREFIX/bin.The shared-library backend resolves a local
libngspicelibrary at runtime; Monata does not ship that library.Internal packaged environments may install
ngspiceas a separate package, but public users should install or build the tool in their own environment.DC, transient, and AC results are written with ngspice
wrdatausing a single sweep scale.DC, transient, AC, and operating-point tasks must provide explicit
output_names; Monata does not infer output vectors from the netlist.Noise tasks use
NoiseSpec.output_nodeandNoiseSpec.input_sourceas the explicit request.SimTask.output_namesmust be empty for noise.DC and transient outputs are emitted as
v(name).AC outputs are emitted as
mag(v(name)).Operating-point outputs are emitted as one-row arrays parsed from
print v(name).Noise outputs are parsed from ngspice
noise1/noise2print output asonoise_spectrum,inoise_spectrum, and totals metadata.OSDI libraries in
SimTask.osdi_pathsare loaded withpre_osdibefore the analysis command.Plain
.includemodel cards can be emitted by the native netlist renderer.
Distribution and License Boundary¶
The ngspice source tree contains a primary modified-BSD license plus specific subtree exceptions for components such as KLU, OSDI, numparam, XSPICE table code models, and other bundled source. Public Monata packages avoid carrying that native code by treating ngspice as an external runtime dependency.
When users or organizations build ngspice from source, they should keep the
upstream license files and notices with the resulting installation. Monata
documentation may provide build steps, but it does not redistribute the built
ngspice executable, libngspice, XSPICE .cm binaries, or compiled OSDI
artifacts.
Supported Task Inputs¶
Input |
Current behavior |
|---|---|
|
Executes |
|
Executes |
|
Executes `ac <dec |
|
Executes |
|
Executes |
|
Required for DC/Tran/AC/OP; must be empty for Noise |
|
Existing files are loaded with |
|
Simple |
corner temperature |
Emits |
corner voltage |
Mutates matching voltage sources through |
corner model file |
Emits |
Explicit Limitations¶
The backend fails explicitly instead of silently ignoring unsupported inputs:
Input |
Failure reason |
|---|---|
unsupported analysis type |
|
empty |
|
non-empty |
|
unsafe output names, OSDI paths, or analysis command fields |
|
missing OSDI or corner model file |
|
missing or unsupported parameter/source override targets |
|
process or model-deck corner without a concrete model file |
|
Advanced ngspice work such as binary rawfile parsing, richer noise output contracts, and richer model-deck projection is tracked in the maintainer Monata Roadmap TODO.