Opaque handle to a loaded JIT shared library
Instances For
Load a compiled JIT shared library (.dylib/.so)
Evaluate combinational logic (compute next state)
Advance clock (apply next state to registers)
Fused eval+tick: evaluate combinational logic and advance clock in one call. Register next-state values are kept as local variables instead of class members, eliminating ~260 intermediate memory operations per cycle.
Reset all registers to initial values
Destroy the simulation instance (also runs automatically on finalize)
Take a full snapshot of the simulation state (registers + memories). Returns an opaque pointer (as UInt64) that can be passed to restore/freeSnapshot.
Get the total number of observable wires
Get the total number of registers
Run two JIT domains connected via a lock-free SPSC queue (CDC).
Domain A (producer) runs cyclesA eval_tick cycles, sending output port
values to Domain B via the queue. Domain B (consumer) runs cyclesB
eval_tick cycles, receiving values and applying them to its input port.
Timestamp inversions trigger automatic rollback via snapshot/restore.
Returns (messagesSent, messagesReceived, rollbackCount).
Compile a JIT .c (or legacy .cpp) source file to a shared library, with hash-based caching.
The CSim backend emits pure C — we use cc and -std=c11, and
drop libstdc++/libgcc static-linking entirely (the .so has no
C++ dependency). We still pin the JIT .so's runtime linker to
the host libc (Issue #70) as defence in depth.
The input path's extension is accepted as .c, .cpp, or .cc
for backward compatibility with existing callers that have
historical _jit.c literal paths; the file contents are pure
C either way.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compile and load a JIT module in one step
Equations
- Sparkle.Core.JIT.JIT.compileAndLoad cppPath = do let dylibPath ← Sparkle.Core.JIT.JIT.compile cppPath Sparkle.Core.JIT.JIT.load dylibPath