Removed previously added DEPOSIT ALL 0 in precalibrate routine.
That DEPOSIT was added to explicitly restore memory to 0's at simulator
startup, but the several second cost of executing that slowed down
startup of any simulator which had precalibration support. Anyone who
explicitly cares to have zeroed memory on startup should include such a
command in their own simulator configuration.
Allow: n execute n instructions/cycles per second
nK execute n thousand instructions/cycles per second
nM execute n million instructions/cycles per second
n% occupy x percent of the host CPU capacity
n/t sleep for t milliseconds after executing x
instructions/cycles
n{K|M}/t sleep for t milliseconds after executing x
thousand or million instructions/cycles
- Make time at sim> prompt consistent when in nocalibrate mode.
- Disable asynch operations when in nocalibrate mode so that all events
occur consistently.
- Make sure that all throttling modes produce consistent behavior
related to all timing activities including clock ticks and TMXR port
speed timing.
- Expose all timer and throttling state variables via simh REGisters
- Only allow throttling to start execution one time. Throttling can't
be changed once instruction execution has started.
- Clarification of SHOW CLOCK variable units
- Avoid competing gratuitous keyboard polls with simulators
- Properly enable catchup ticks
- Fix second boot while idling
- Improve calibration while idling
- Report complete timer state when impossible timer conditions exist
that will cause a simulator abort.
- Leave memory 0 after pre-calibration instruction execution rate.
- Behave well when NOCALIBRATE mode is enabled after some instruction
execution already happened.
- Properly detect the reliable calibrated clock or use the internal one.
- Add common system includes used in may places which are allowed
and thus added directly in sim_defs.h.
- Separate completely private system data structures and system APIs
for use only by SCP library routines into sim_scp_private.h.
- Also abort simulation if idle delay is crazy big which indicates a
problem that has already happened.
- Extend calibration initialization debug output to record optional ticks.
NOCALIBRATE mode allows all activity of a simulator run to occur with
precisely consistent event timing. In this mode, every clock tick takes
precisely the same number of instructions/cycles. Likewise, the polling
activities for MUX or other poll oriented devices occurs after precisely
the same number of instructions/cycles executed. As a consequence of
this mode, no effort to align simulated clock ticks (and simulated access
to wall clock time) is made.
This mode might be useful for running diagnostics which expect a
particular relationship between perceived wall clock and instruction
times. It might also be useful for running test scripts which may want
to compare output of previous executions to to current execution or
to compare execution on arbitrarily different host computers.
In NOCALIBRATE mode, the operator gets to specify the pseudo
execution rate along with the base wall clock time that access to
pseudo wall clock accesses returns.
- removed a somwhat unlikely but possible division-by-zero
- in case the initial throttling calibration measures a slower cps rate than
the desired cps rate, check whether the measured rate is well below the
measured peak rate. If so, distrust the measured rate and instead use
half the peak rate as measured cps rate.
Otherwise (so measured cps is in the same ballpark as measured peak rate)
disable throttling
As initially reported in #815
Faster host systems today can get very fast instruction execution rates
for a short duration calibration test. These may be skewed by round
off error, so we now run the calibration for a minimum of 100ms.
delta time computation converting the difference between two timespec
structures values to milliseconds previously truncated the difference which,
depending on the value of when the starting value in the delta happened,
along with when an OS clock tick occurred, may have resulted in a small
delta and an apparent sleep time of 0. A more accurate result is produced
when the conversion from nanoseconds to milliseconds is rounded up
before the usecs/nsecs are truncated.
This affects the output of some SCP commands (including help). The
results are cosmetic, but allows the simulator to provide correct descriptive
information.
Some simulators have clocks that have dynamically programmable tick
rates. Such a clock is only a reliable candidate to be the calibrated
clock if it uses a single tick rate rather than changing the tick rate
on the fly. Generally most systems like this, under normal conditions
don't change their tick rates unless they're running something that is
examining the behavior of the clock system (like a diagnostic). Under
these conditions this clock is removed from the potential selection as
"the" calibrated clock that all others are relative to and if necessary,
an internal calibrated clock is selected.
- Fix incomplete migration to RTC structures indicated by Coverity
warnings. Some Coverity were minor warnings and not real issues.
- Add calibration recovery parameters for idle and catchup ticks
- Aggressively perform catchup ticks when in simulated idle paths
even when idling is disabled.
- All non internal clocks can have catch-up ticks triggered if they
register a tick unit.
- Catch-up ticks will be delivered to non tick acking simulators when
idling if regstered tick unit has been specified.
- Hosts with slow ticks can idle and keep sloppy OK time when
simulators have faster ticks
- Default to active calibration (ALWAYS) while idling (no skipping)
The original approach had separate parallel arrays for each relevant
state variable for each calibrated timer. That worked when there were
only a few state variables, the state info for a timer belongs in a
structure.
- Adjust calibration parameters to properly record catchup variables for
odd condition cases.
- Disable idle percentage calibration skipping until the correct set of
calibration variables are available.
- When a pre-calibrate operation has been performed, make the results
visible in the output of SHOW CLOCK
As discussed in #705 and #699
- MicroVAX I, II and 3900 don't have a DONE bit in the clock status
register, so sim_rtcn_tick_ack() wasn't being called to acknowledge
clock ticks.
- Timer catchup tick criteria didn't work unless the host had a slow
clock tick.
As discussed in #705
- Properly handle clock transitions when control flows back and forth
between instruction execution and simh commands.
- Changed Internal Timer from 10 Hz to the MAX(100Hz, HostOSClockHz)
- Changed default idle calibration percent to 50%
- Make sure that error cases (backwards and gap too big) properly advance
the real time while avoiding calibration.
- Fix selection of the calibrated clock.
- Fix logic that sets the idle percentage that controls calibration.