[Simh] trouble with idle detection on VAX (Thomas Pfau)

Bob Supnik bob at supnik.org
Tue Jun 12 20:15:08 EDT 2007


Yes,  idle is broken completely, and will require extensive surgery 
before it can work.  Don't use it.

Idle was intended to basically idle the system between clock ticks, 
when nothing else was pending.  All polled events have been 
synchronized to clock ticks, so they too allowed for idling.  Other 
event timeouts were supposed to be so short that they would not 
qualify for the minimum one ms minimum delay.

However, as a simulator idles, the clock calibration routine is 
recalibrating how many instructions have to be counted to make up one 
clock tick.  If the idling is accurate and efficient, the number of 
executed instructions between ticks goes way down, and the number of 
instructions per msec goes down too.  As a result, at some point, 
"ordinary" device timeouts start being short enough to kick the idle 
mechanism over, and the system begins to wait for simulated disks and 
the like.  This is completely pointless: timeouts that took 1000 
instructions suddenly start taking 1 msec, or ten times as long.  The 
simulator should never idle if the next event is not a wall-time event.

Fixing this requires flagging all events that are wall-time related 
to distinguish them from events that are normal simulator event times 
counted in instructions.  If the idle routine is called, and the top 
of the event queue is not a wall-clock event, the simulator shouldn't 
idle.  Whether this is fixed in the caller (the simulator) or the 
callee (the idle routine) is a matter of convenience, but the change 
is systemic.

I don't think that throttling is equally bollixed, but it might 
be.  Basically, if you throttle back to 25%, and the simulator 
executes instructions at 1/4 the normal rate, all device timeouts 
will four times as long.  I haven't tested this, but it seems likely.

/Bob




More information about the Simh mailing list