spice 0.1.0
First release, aligned with Dune v0.1.0.
-
spice_run()runs ‘SPICE3’ decks (text, a path or aspice_pic()extraction) through the ‘Dune’ engine: operating point, DC sweep, transient, AC, pole-zero, noise, distortion, transfer function, sensitivity and periodic steady state (spice_pss()), with the full ‘SPICE3f5’ device set plus BSIM3v3. Results are long tibbles (spice_tidy(),autoplot()). - Selecting from a result reads as a pipeline:
res |> spice_tidy("tran", "out").plotstakes a short name of the analysis ("op","dc","tran","ac","noise", …) besides labels and positions;varskeeps the named variables, without regard to case, a bare node name standing for its voltage. The tidy table of a complex plot (.ac) hasmag,dbandphase(degrees) next toreandim.spice_wide()gives one plot with a column per variable, andspice_op()the operating point as a named vector. -
spice_read_raw()reads ‘SPICE3’ rawfiles;spice_measure(),spice_session()(spice_alter(),spice_rerun()),spice_sweep()and a ‘knitr’ engine (spice_knitr()) round out the workflow. - Vignettes:
vignette("spice")runs a deck end to end, andvignette("defaults")shows where the engine departs from ‘SPICE3’ by default and howcompat = "spice3"turns it back. Four worked examples with their results computed in advance: an amplifier ("amplifier"), oscillators and periodic steady state ("oscillators"), sweeps and tolerances ("sweeps") and transmission lines ("lines"). -
spice_pic()andspice_pic_svg()extract netlists from ‘rpic’ figures and draw them. - A
.tranintegrates with TR-BDF2 by default, not the trapezoidal rule: it is closer to the converged answer at the same step on the whole test corpus and does not ring. The optioncompat = "spice3"(.options compat=spice3in a deck) restores the ‘SPICE3f5’ defaults.spice_pss()shoots with the same default; only the start-up transient of an autonomous oscillator stays on the trapezoidal rule, which lets the oscillation grow at any step. - A switch (
S,W) flips at the instant its control crosses the threshold, located toreltoltimes the maximum step, not at whatever timepoint first sees it crossed (compat = "spice3"restores that). Au()orsgn()in a ‘B’ source flips at the instant its argument crosses zero, too. A pulse narrower than the timestep is found when the point before the step shows it coming. ‘LTRA’ lines without an interpolation flag interpolate linearly. Their step is also limited by the error of reading the delayed wave between history points. A corner of a wave gets a timepoint where it arrives one delay later (the ‘SPICE’ rule almost never plants it), so reflections no longer round it. Under TR-BDF2 the step control is held totrtol / 7(its error estimate does not overestimate as the onetrtolwas made for), about 3% more timepoints for a third less error. The slope breakpoints of ‘LTRA’ lines are capped at 10 per maximum step (ltrabkrate = 0schedules every request, as ‘SPICE’ does). - On Windows every simulation runs on a worker thread, so that a threaded
spice_sweep()agrees bit for bit with the sequential one and withspice_run(): the ‘Rtools’ C runtime roundsexp()andpow()according to the thread’s x87 precision mode, which differs between the R thread and new threads. - The Rust sources are vendored in
src/rust/vendor.tar.xzand the installation builds offline, with at most two jobs.