OR-1 dataflow CPU sketch
at main 49 lines 1.2 kB view raw
1"""OR1 Monitor package. 2 3Provides simulation backend and command/result protocol for monitoring 4and controlling OR1 dataflow computations in real-time. 5 6Core exports: 7- SimulationBackend: Threaded simulation controller 8- Command types: LoadCmd, StepTickCmd, StepEventCmd, RunUntilCmd, InjectCmd, SendCmd, ResetCmd, StopCmd 9- Result types: GraphLoaded, StepResult, ErrorResult 10- State capture: StateSnapshot, capture() 11 12The backend manages a SimPy environment in a dedicated thread, processes commands via 13queue.Queue, and returns results with full state snapshots and event lists. 14""" 15 16from monitor.backend import SimulationBackend 17from monitor.commands import ( 18 ErrorResult, 19 GraphLoaded, 20 InjectCmd, 21 LoadCmd, 22 ResetCmd, 23 RunUntilCmd, 24 SendCmd, 25 SimCommand, 26 StepEventCmd, 27 StepResult, 28 StepTickCmd, 29 StopCmd, 30) 31from monitor.snapshot import StateSnapshot, capture 32 33__all__ = [ 34 "SimulationBackend", 35 "LoadCmd", 36 "StepTickCmd", 37 "StepEventCmd", 38 "RunUntilCmd", 39 "InjectCmd", 40 "SendCmd", 41 "ResetCmd", 42 "StopCmd", 43 "SimCommand", 44 "GraphLoaded", 45 "StepResult", 46 "ErrorResult", 47 "StateSnapshot", 48 "capture", 49]