Documentation

Sparkle.Core.JITLoop

@[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.JITHandleIO Unit := fun (x : JIT.JITHandle) => pure ()) (reconstruct : JIT.JITHandleArray UInt64IO α) :
IO (Signal.Signal dom α)
def Sparkle.Core.JITLoop.JIT.run (handle : JIT.JITHandle) (cycles : Nat) (wireIndices : Array UInt32) (callback : NatArray UInt64IO 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 handle
  • cycles: Maximum number of cycles to run
  • wireIndices: 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.JITHandleNatArray UInt64IO (Option Nat)) (callback : NatArray UInt64IO 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 handle
        • cycles: Maximum number of cycles to run
        • wireIndices: Pre-resolved wire indices (from JIT.resolveWires)
        • oracle: Called each cycle with (handle, cycle, wireValues); return some skipCount to skip forward (oracle handles its own state mutations), or none for 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.
        Instances For