Next: , Previous: General Commands, Up: Commands


3.3 simulation Commands

— Command: x-all

This resets the values of all nodes to X, and clears the event queue and all other state except for the time, which is left as-is. Trace files are kept open, mode flags, and channel setups are retained. However, channel logs are closed. This is useful for executing multiple simulation runs in one long trace.

— Command: initialize

Resets the variable state of the simulation (to unknown), while preserving other settings such as mode and breakpoints. The random number generator seed is untouched by this command.

— Command: reset

Similar to initialize, but also resets all modes to their default values. This command can be used to quickly bring the simulator to the initial startup state, without having to exit and relaunch. This also resets the random number generator seed used with seed48.

Running the simulation.

— Command: step [n]

Advances the simulation by n time steps. Without n, takes only a single step. Time steps may cover multiple events if they are at the exact same time. To step by events count, use step-event.

— Command: step-event [n]

Advances the simulation by n events. Without n, takes only a single event. A single event is not necessarily guaranteed to advance the time, if multiple events are enqueued at the same time.

— Command: advance delay

Advances the simulation delay units of time.

— Command: cycle

Execute steps until the event queue is exhausted (if ever). Can be interrupted by Ctrl-C or a SIGINT signal.

Coercively setting values.

— Command: set node val [delay]

Set node to val. val can be 0, 1, X, or ~ which means "opposite-of-the-current-value". If delay is omitted, the set event is inserted `now' at the current time, at the head of the event queue. If delay is given with a + prefix, time is added relative to `now', otherwise it is scheduled at an absolute time delay.

— Command: set-now node val

Unlike the set command, this sets the value of node to val immediately, without enqueuing an event.

— Command: setr node val

Same as the set command, but using a random delay into the future.

— Command: setf node val [delay]

Set forcefully. Same as the set command, but this overrides any pending events on node.

— Command: setrf node val

Same as setf and setr combined; forcefully set node to val at random time in future, overriding any pending events.

— Command: unset node

Cancel any pending set commands on node. This effectively causes a node to be re-evaluated based on the state of its fanin. If the evaluation results in a change of value, a firing is scheduled in the event queue. This command may be useful in releasing nodes from a stuck state caused by a coercive set.

— Command: unsetall

Clears all coercive set commands, and re-evaluates all nodes in terms of their fanins.

— Command: set-pair-random node1 node2

Sets a pair of nodes to random, opposite values.

Freezing switching and simulating event upsets.

— Command: freeze node

Prevents node from switching cause by updates on its fanins. Any pending events that are already in the event queue will remain in the queue and fire when they reach the head. Q: How does this affect channels?

— Command: thaw node

Aliases to the unset, removes the frozen state to allow transition events, and also re-evaluates fanin to automatically enqueue an event when it should fire.

— Command: upset node [val]

Forces node to remain stuck at its current value or val (if given) until it is explicitly restored by the unset command. upset is a combination of setf and freeze.

Breakpoints.

— Command: breakpt node

Set a breakpoint on node. When node changes value, interrupt the simulation (during cycle, advance, or step), and return control back to the interpreter.

— Command: breaks

Show all breakpoints (nodes).

— Command: nobreakpt node
— Command: unbreak node

Removes breakpoint on node.

— Command: nobreakptall
— Command: unbreakall

Removes all breakpoints.

Rescheduling and cancelling pending events.

— Command: dequeue node

Cancels any pending event on node from the event queue. This can result in the circuit getting stuck in a state until the killed node is explicitly re-evaluated (e.g. with an unset command). No error condition is returned if there is no pending event associated with the named node.

— Command: reschedule node time
— Command: reschedule-from-now node time
— Command: reschedule-relative node time
— Command: reschedule-now node

If there is a pending event on node in the event queue, reschedule it as follows: reschedule interprets time as an absolute time. reschedule-from-now interprets time relative to the current time. reschedule-relative interprets time relative to the pending event's presently scheduled time. The resulting rescheduled time cannot be in the past; it must be greater than or equal to the current time. Tie-breakers: given a group of events with the same time, a newly rescheduled event at that time will be *last* among them. reschedule-now, however, will guarantee that the rescheduled event occurs next at the current time. Return with error status if there is no pending event on node.

— Command: execute node

Reschedules a pending event to the current time and executes it immediately. Equivalent to reschedule-now node, followed by step-event.