"X", and every gate due for its first evaluation.
Options
Options are fixed when the simulation starts and carry over to every later state.The maximum number of steps a single
run() call may take. Must be a positive integer.SimulationState
A frozen object describing one moment of the simulation. Methods that move the simulation forward return a new state and never change the one they’re called on.Properties
The wire changes applied by the step that produced this state, in wire order. Empty for the first state and for states returned by
set().Moving forward
A new state with these external inputs pending. They take effect on the next step. Returns the same state if nothing would change. Throws
SimulationError for unknown names or invalid values, without applying anything.A new state, one tick later. It applies the pending changes, evaluates the gates that read a changed wire, and makes their changed outputs pending.
A new state, stepped until stable. Returns the same state if it’s already stable. Throws
StabilizationError after maxTicks steps.Reading
Plain, serializable data:
{ tick, stable, pendingEvents, signals, wires }. signals maps every hierarchical port id to its value, and wires maps every wire id to { value, ports }.A frozen array of every wire change from tick 0 up to this state, ordered by tick and then by wire id. Empty unless
trace: true.