pub struct Options {Show 34 fields
pub reltol: f64,
pub abstol: f64,
pub vntol: f64,
pub gmin: f64,
pub itl1: usize,
pub itl2: usize,
pub itl4: usize,
pub gminsteps: usize,
pub srcsteps: usize,
pub temp: f64,
pub tnom: f64,
pub pivtol: f64,
pub pivrel: f64,
pub noopiter: bool,
pub trtol: f64,
pub chgtol: f64,
pub method: Method,
pub maxord: usize,
pub nopage: bool,
pub defl: f64,
pub defw: f64,
pub defad: f64,
pub defas: f64,
pub max_tran_steps: Option<usize>,
pub ltra_break_rate: Option<usize>,
pub ltra_fit: bool,
pub tmax_divisor: Option<f64>,
pub seed: u64,
pub notrnoise: bool,
pub dev_noise: bool,
pub dev_noise_step: Option<f64>,
pub load_threads: usize,
pub keepopinfo: bool,
pub trytocompact: bool,
}Fields§
§reltol: f64RELTOL, default 1e-3.
abstol: f64ABSTOL, default 1e-12 (amperes).
vntol: f64VNTOL, default 1e-6 (volts).
gmin: f64GMIN, default 1e-12.
itl1: usizeITL1: DC iteration limit, default 100.
itl2: usizeITL2: DC transfer-curve iteration limit, default 50.
itl4: usizeITL4: transient timepoint iteration limit, default 10
(CKTtranMaxIter).
gminsteps: usizeGmin steps in CKTop. 1 (the ngspice-47 default) selects the
dynamic Gillespie stepping of the diagonal gmin followed, if it
fails, by the “true gmin” stepping of the devices’ gmin;
n > 1 runs the 3f5 fixed ladder with n steps; 0 skips gmin
stepping (corpus/KNOWN_DIFFS.md).
srcsteps: usizeSource steps in CKTop. 1 (the ngspice-47 default,
cktntask.c) selects Gillespie’s adaptive source ramp; n > 1
runs the 3f5 fixed ladder of n steps (the 3f5 default is 10);
0 skips source stepping (corpus/KNOWN_DIFFS.md).
temp: f64Operating temperature in kelvin (TEMP, default 27 °C).
tnom: f64Nominal parameter-measurement temperature (TNOM, 27 °C).
pivtol: f64PIVTOL, default 1e-13.
pivrel: f64PIVREL, default 1e-3.
noopiter: boolNOOPITER: go directly to gmin stepping.
trtol: f64TRTOL: truncation-error overestimation factor, default 7.
chgtol: f64CHGTOL: charge tolerance, default 1e-14.
method: MethodMETHOD: trap (default), gear, or Dune’s opt-in trbdf2
(Method::TrBdf2; not a SPICE value).
maxord: usizeMAXORD for Gear, default 2.
nopage: boolNOPAGE: suppress page breaks in printed output.
defl: f64DEFL/DEFW: default MOS channel length/width, meters
(CKTdefaultMosL/W, 1e-4).
defw: f64§defad: f64DEFAD/DEFAS: default MOS drain/source diffusion area, m²
(CKTdefaultMosAD/AS, 0).
defas: f64§max_tran_steps: Option<usize>Dune’s transient step budget (not a SPICE option; no .options
card sets it): the most internal timepoints — accepted or
rejected — one .tran may attempt before it stops with
Error::StepLimit. The 3f5 and
ngspice-47 both parse ITL5 (“total transient iteration
limit”) and ignore it (cktsopt.c: case OPT_ITL5: break;),
so neither bounds a run whose breakpoints cascade (D-0022).
None (default): automatic, scaled to the deck —
max(TRAN_STEP_FLOOR, TRAN_STEPS_PER_TMAX · ⌈TSTOP/TMAX⌉)
with the effective TMAX, i.e. 10 000 steps or 50 per maximum
step span, whichever is more (the corpus peaks at 13 per span,
ltra_2; a fixed budget cannot work because a cascading LTRA
deck costs O(n²) in its history length — D-0022). Some(n):
at most n (Some(usize::MAX) is unlimited).
ltra_break_rate: Option<usize>Dune’s opt-in LTRA breakpoint hygiene (.options ltrabkrate=N;
not a SPICE option, issue #6). The slope rule of LTRAaccept
plants a breakpoint one delay after every accepted point where
an incident wave’s slope changes; CKTsetBreak merges only
within 5e-5·TMAX, so a ringing load can feed it an echo
cascade (D-0022). Some(n), n > 0: a slope breakpoint that
falls within TMAX/n of one already scheduled is dropped,
which caps them at about n per TMAX span. None or
Some(0) (default): faithful, every request scheduled.
ltra_fit: boolDune’s opt-in recursive convolution for LTRA lines
(.options ltrafit; not a SPICE option, issue #8). The 3f5
recomputes every line’s convolution over the whole accepted
history at each timepoint — O(n) per point, quadratic per run.
true: the RLC and RC impulse responses become exponential
sums (an exact branch-cut quadrature, error budget 1e-6 per
kernel, reported in the run’s notes) advanced once per accepted
point, with the newest segment kept exact — O(1) per point.
false (default): faithful.
tmax_divisor: Option<f64>Dune’s transient refinement knob (an API argument, not a SPICE
option: no .options card sets it, issue #16). Some(d),
d ≥ 1 and finite: every .tran runs with its effective
maximum step divided by d — the 4th argument of the card
when given, else the default min(TSTEP, (TSTOP−TSTART)/50).
Everything derived from TMAX (delmin, the breakpoint merge
radius, the step budget) follows, so the run is the one the
deck would give with that card’s TMAX edited to TMAX/d.
It is not a .options key because TMAX is a parameter of the
analysis card, and the divisor applies to every .tran card of
the deck whatever TMAX each one carries. Any other value makes
.tran fail with Error::Build.
None (default): the card’s TMAX as is.
seed: u64SEED: the seed of the transient-noise sources
(TRNOISE/TRRANDOM, ngspice-47 .options seed=N, which sets
its rndseed). Default 1 — ngspice’s start-up rndseed too
(main.c) —, so a deck without the option is reproducible.
The same seed gives the same noise bits on every platform (see
docs/dune-core.md §Ruído transiente); ngspice’s
seed=random (a clock seed) is refused with a warning.
notrnoise: boolNOTRNOISE (ngspice-47’s notrnoise variable, read by
trnoise_state_gen): every TRNOISE source runs with all its
noise parameters zeroed — just its DC value, no grid, no
breakpoints —, so a deck compares with and without noise
without editing it. As in ngspice, TRRANDOM is untouched
(its state generator never reads the variable). Default false.
dev_noise: boolDune’s transient device noise (.options devnoise; not a
SPICE option — neither the 3f5 nor ngspice has it, issue #20):
every generator .noise knows (thermal 4kT·g, shot 2q|I|,
flicker KF·…/f^EF) becomes a stochastic current source in
.tran, drawn from the counted streams of seed. false
(default): devices are noiseless in time, as in SPICE.
dev_noise_step: Option<f64>The grid step of the device noise (.options devnt=NT,
seconds): white up to 1/(2·NT), a breakpoint every NT.
None (default): the .tran card’s TSTEP.
load_threads: usizeWorker threads for the per-iteration device load (issue #9,
lever 1; an API argument, not a SPICE option). 1 (default):
the sequential load, exactly the 3f5’s CKTload. 0: one
thread per core. n > 1: the devices are split into
contiguous runs evaluated on n threads, and their stamps are
replayed into the matrix in device order, so every result is
bit-identical to 1 whatever the count. It only pays on
circuits with many expensive devices (MOS/BSIM); see
docs/perf.md for the measured break-even. Needs the
parallel feature (native builds); without it (and on
wasm32) the value is ignored and the load is sequential.
keepopinfo: boolKEEPOPINFO (cktsopt.c): .ac, .pz and .disto (and,
as in ngspice-47, .noise and .sp) first emit their
operating point as a plot of its own (“AC Operating Point”,
“Distortion Operating Point”, “NOISE Operating Point”).
Default false.
trytocompact: boolTRYTOCOMPACT (cktsopt.c, IF_FLAG; CKTtryToCompact): LTRA
lines without an explicit interpolation flag interpolate
linearly, and after every accepted timepoint where the last
three points of every LTRA port voltage and current lie on a
straight line within COMPACTREL/COMPACTABS, the middle
point is dropped from the shared history (ltraacct.c). Default
false. Ignored under Options::ltra_fit and in .pss.
Implementations§
Source§impl Options
impl Options
Sourcepub fn tran_step_budget(&self, tstop: f64, max_step: f64) -> usize
pub fn tran_step_budget(&self, tstop: f64, max_step: f64) -> usize
The step budget of a .tran running to tstop with effective
maximum step max_step (see Options::max_tran_steps).
Sourcepub fn apply(&mut self, params: &[Param], diags: &mut Vec<Diagnostic>)
pub fn apply(&mut self, params: &[Param], diags: &mut Vec<Diagnostic>)
Apply .options parameters from the IR. Unknown or
not-yet-implemented options produce a warning, never an error
(the 3f5 front end also lets unknown variables through).