Repository navigation
v0.4.0 — downloadable binaries, the cscript arity contract, checkpoint and resume
The first release with downloadable binaries. Until now the only way to get this simulator was to build it, which meant a Rust toolchain and three sibling checkouts first.
Download
| Platform | File |
|---|---|
| Windows x86-64 | general-simulator-windows-x86_64.zip |
| Linux x86-64 | general-simulator-linux-x86_64.tar.gz |
| Linux arm64 | general-simulator-linux-aarch64.tar.gz |
| macOS Apple silicon | general-simulator-macos-aarch64.tar.gz |
Unpack and run it — there is nothing to install. On Windows:
> general-simulator.exe circuit.cir --mode transient --tfinal 1e-3 --dt 1e-6Every binary was made to solve a resistive divider and checked to give 0.5 before it was packaged.
What is already inside it
Waveform measurements (kind=measure — RMS, THD, peak, TRIG-TARG, Fourier, error norms over non-uniform samples) are compiled in. There is no separate measurement program to install.
C blocks (kind=cscript) work too: the binary loads your .so/.dll at run time, so nothing was needed at build time.
What is not
kind=pyblock and kind=pyfunc are absent from these builds, deliberately. Embedding Python links the binary against one exact libpython, so a download built here would refuse to start against the Python you have. (abi3, the usual fix, applies to extension modules and not to an embedding binary — measured: the linked soname is identical with and without it.) Build locally with --features python for those two block kinds.
kind=octfunc / kind=octblock do work from the download: Octave is spawned as a subprocess rather than linked, so it only has to be installed on your machine, not on the build machine.
Since v0.3.0
A library can now declare its own arity. in_len/out_len used to be whatever the netlist said, and a .c file written for a different number indexed past the end of a buffer — a wrong answer at best, memory corruption at worst, and never a message naming the block. An optional int cscript_arity(int *in_len, int *out_len) is now checked against the netlist before the first step, and a disagreement is refused with both counts in the error. Absent, or returning non-zero, keeps the old behaviour exactly, so every existing .c file is unaffected.
Checkpoint and resume. --checkpoint-out writes a run's complete state at --tfinal, and --resume continues it bit-identically to a run that never stopped. cscript and octblock have their own state contracts so a block's internals survive the round trip.
Initial conditions on signal-domain blocks (ic=, y0=), alongside the existing ic= on capacitors and inductors.
The documentation is now verified, and gated. 152 tests assert that every ## Example and ## Errors claim in the Component Reference was actually run against this CLI, and CI now runs them — before, the suite existed and nothing executed it.
The netlist grammar chapter documents number suffixes, which it never did. Most importantly that 1M is one milliohm, not one megohm — SPICE's rule, case-insensitive, and the most expensive thing in the grammar to get wrong.
Both books (user guide and developer guide), the PDFs and the API reference are published at the repository's GitHub Pages site.
Related
- general-simulator-gui — draw schematics in VS Code instead of writing netlists
- gsim-tools — build them in Python