@[implemented_by _private.Sparkle.Core.JITLoop.0.Sparkle.Core.JITLoop.loopMemoJITImpl]
opaque
Sparkle.Core.JITLoop.Signal.loopMemoJIT
{dom : Domain.DomainConfig}
{α : Type}
[Inhabited α]
(jitCppPath : String)
(wireNames : Array String)
(loadMem : JIT.JITHandle → IO Unit := fun (x : JIT.JITHandle) => pure ())
(reconstruct : JIT.JITHandle → Array UInt64 → IO α)
:
IO (Signal.Signal dom α)
def
Sparkle.Core.JITLoop.JIT.run
(handle : JIT.JITHandle)
(cycles : Nat)
(wireIndices : Array UInt32)
(callback : Nat → Array UInt64 → IO Bool)
:
Run JIT simulation for up to cycles cycles with a per-cycle callback.
No state caching — O(1) memory. The callback receives the cycle number
and an array of wire values (indexed by wireNames order).
Return false from the callback to stop early.
Parameters:
handle: Pre-loaded JIT handlecycles: Maximum number of cycles to runwireIndices: Pre-resolved wire indices (from JIT.findWire)callback: Called each cycle with (cycle, wireValues); return false to stop
Equations
- One or more equations did not get rendered due to their size.
Instances For
Resolve an array of wire names to their JIT indices. Throws if any wire name is not found.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Resolve an array of register names to their JIT indices. Throws if any register name is not found.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Sparkle.Core.JITLoop.JIT.runOptimized
(handle : JIT.JITHandle)
(cycles : Nat)
(wireIndices : Array UInt32)
(oracle : JIT.JITHandle → Nat → Array UInt64 → IO (Option Nat))
(callback : Nat → Array UInt64 → IO Bool)
:
Run JIT simulation with an oracle callback for cycle-skipping.
Same as JIT.run but with an additional oracle that receives
the JITHandle directly and can manipulate JIT state (setReg, memsetWord)
before returning a skip count.
Parameters:
handle: Pre-loaded JIT handlecycles: Maximum number of cycles to runwireIndices: Pre-resolved wire indices (from JIT.resolveWires)oracle: Called each cycle with (handle, cycle, wireValues); returnsome skipCountto skip forward (oracle handles its own state mutations), ornonefor normal tick.callback: Called each cycle with (cycle, wireValues); return false to stop
Returns: the number of cycles actually executed
Equations
- One or more equations did not get rendered due to their size.