Hindsight™ is the technology utilized by Simics to achieve reverse execution.
Before any reverse operations can be performed, at least one time bookmark must be added. Depending upon how Simics is invoked (and various user preferences), a time bookmark denoted "start" is sometimes added automatically at the beginning of the simulation. Reverse operations are possible in the region following the first (i.e. oldest) bookmark. Bookmarks can be managed through the commands
simics> set-bookmark label simics> list-bookmarks simics> delete-bookmark [label | -all].
The main reverse execution commands are
simics> reverse simics> reverse-to position simics> skip-to position.The reverse and reverse-to commands run the simulation backwards until a breakpoint occurs or till the oldest time bookmark is reached. Skipping is somewhat similar to reversing; the main difference is that intermediate breakpoints are ignored. Skipping can also be much faster than reversing.
The skip-to and reverse-to commands take either an absolute step count or a time bookmark as argument.
Many forward executing commands used for debugging has a corresponding reverse variant obtained by adding a reverse prefix. The reverse variant of step-instruction is for instance reverse-step-instruction.
Any external input (like a human typing on a virtual serial console) is replayed when the simulation is being run forward after a reversal; this guarantees that the simulation will follow the same path as originally. For the same reason, all external input is ignored until the point is reached where the first reverse operation was initiated. It is possible to override this behavior with the
simics> clear-recordercommand. This command discards all recorded input and allows an alternate future to take place.
Note that external changes to the simulation not under the control of the recorder can make Hindsight operate somewhat unpredictably. It is recommended that any time bookmarks before a non-replayable change of the simulation state is deleted explicitly. Examples of such external changes are the modification of a CPU register by hand or loading a boot image from the command line.