[Simh] Potential design for 'real time' controls

bsupnik at comcast.net bsupnik at comcast.net
Wed Apr 6 13:15:14 EDT 2005


One of the more frequently requested features is the capability to issue certain SIMH commands without stopping simulation, notably ATTACH and DETACH.  This note outlines a potential design for implementing this capability.

The problems with 'real time' commands are several-fold:

1) There is no mechanism for collecting command input while the simulator is running.
2) There is no mechanism for rerouting simulator command output from stdout.
3) Many of the commands, and many of the VM-specific routines, will cause significant malfunctions if executed while simulation is running.

The proposed mechanism for command input is an extension of the current mechanism for diverting the console to a Telnet window.  If the simulation console is a Telnet session, than the main command window is more or less idle.  Keyboard input (except for ^E) is ignored; and nothing should generate output to stdout.

Accordingly, it would be possible to poll the main command window for keyboard input and to interpret accumulated input (as delineated by \r) as commands.  SCP would have to provide a polling routine to get (and echo) keystrokes, as well as minimal local line editing capability (like backspace/rubout and line erase).

Because the polling would be done from a normal event subroutine, the command poller would execute only between instructions.  This at least prevents multi-threaded race conditions.  But there are undoubtedly code sequences in SIMH that are safe for this environment.

Many commands are irrelevant or unsafe in an executing simulator:

- RESTORE: destroys all state
- SAVE: takes too long in large memory configurations
- RUN, BOOT, STEP, GO, CONT: the simulator is already running
- RESET: resets all state in a device
- EXIT: simulator should be stopped first

Others are harmless:

- ASSIGN, DEASSIGN
- EVAL
- EXAMINE
- SHOW
- HELP
- BREAK

While others may or may not work:

- ATTACH, DETACH
- SET
- DO: would have to obey the same restrictions as a command line

The proposed design would add a flag to command tables, a flag to devices, and a flag to SET/SHOW options, indicating that they are 'safe for realtime'.  Thus, a command would only be allowed by the real time interpreter if it is, in general, safe.  Within ATTACH/DETACH and SET, particular devices or options would only be allowed if they are safe.  Thus, real-time capability could be added device by device, and option by option, as the VM code is inspected.

Note that VM routines can already tell whether the simulator is running by examing variable sim_is_running.  Today, of course, none of them bother.

It may also pay to add a general REWIND command, which would reset the position indicator of sequential devices to 0.  It's equally possible that REWIND needs to be device specific, so that local status bits are set correctly to reflect beginning of tape.

/Bob



More information about the Simh mailing list