The conversion of time to instructions can overflow an int32 when the
current instructions per second is high and the delay interval is high.
We limit the instruction delay to the maximum value available in an int32,
which for essentially all cases won't matter since the resulting delay is used
for a drop dead timeout and doesn't need to be precise or it will be
canceled before it ever fires anyway.
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.
Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
- Added event debug support to scp and the vax simulator
- Moved external declarations into include files related to modules which define them and removed random externs from modules which referenced them
- Fixed typos in sim_ether
- Fixed sim_disk and sim_tape to properly manage asynchronous threads on an i/o flush
scp.c, scp.h
- added sim_uname (Unit Name) API to simplify places which might want to display it (mostly debug messages).
- added support for clock co-scheduling
- added debugging to trace event queue activities
sim_defs.h
- added support for clock co-scheduling
- added support for sim_uname (Thread local storage macro)
- added support for debugging to trace event queue activities
- simplified debug code by using sim_uname
- fixed support macro for sim_is_active when asynch timers are in use
sim_rev.h
- fixed nested comments
sim_tmxr.c, sim_tmxr.h
- added support for clock co-scheduling
- simplified debug code by using sim_uname
- added support for devices which poll for output on different units
sim_timer.c, sim_timer.h
- added support for clock co-scheduling
- fixed asynchronous clock calibration to smooth out calibration adjustments
- simplified debug code by using sim_uname
- added ability (when running with asynchronous support) to explicitly disable or enable asynchronous timer support.
- changed sim_timer_inst_per_sec to return a double value since the result is always used in a double expression and integer overflow could occur under strange timing conditions
vax/vax_stddev.c
- converted from simulator specific clock co-scheduling to generic clock co-scheduling.
vax/vax_cpu.c
- added EVENT and ACTIVATE debug flag (SET CPU DEBUG=EVENT;ACTIVATE) support
pdp11/pdp11_dz.c
- converted from simulator specific clock co-scheduling to generic clock co-scheduling.
pdp11/pdp11_vh.c
- converted from simulator specific clock co-scheduling to generic clock co-scheduling.
pdp11/pdp11_xq.c
- converted from simulator specific clock co-scheduling to generic clock co-scheduling.
Added support for per line tcp listen ports.
Added support for per line outgoing tcp/telnet connections.
Removed DEV_NET from pdp11_dz and pdp11_vh emulators to allow proper restore of
scp.c, scp.h
- Change the sim_clock_queue event list to be terminated by the value QUEUE_LIST_END instead of NULL. This allows easy determination of whether a unit is on a list since when it is not on a list the next pointer is NULL.
- standardized the usage of UPDATE_SIM_TIME
- Added support for internal/pseudo devices to support the TIMER and CON-TEL pseudo devices (to enable and disable debugging)
- Reverted to the prior "SET CONSOLE DEBUG" command semantics since the console debug can be manipulated via the generic "SET <dev> DEBUG" command (i.e. SET CON-TEL DEBUG=TRC;XMT;RCV)
- Changed "SHOW TIMERS" to "SHOW CLOCKS" to display the current calibrated timer information
- Added sim_is_active_bool API to return the boolean active status avoiding the potential work walking the list when most callers aren't interested in the event firing time
- Fixed run_boot_prep to properly record the not queued status of any units which are removed from the sim_clock_queue during initialization
- Added display of DEBUG, NODEBUG options to the SHOW SHOW command
sim_timer.c, sim_timer.h
- Added asynchronous timer capabilities with support for calibration and idling
- Added internal/pseudo device to support debugging of Idle, Calibration and asynch timer activites.
- Added suppression of timer calibration when idling has occurred
sim_tmxr.c, sim_tmxr.h
- Added tmxr_activate_after and macro definition for sim_activate_after to invoke it for proper behavior with multiplexer devices
- Added all polling units to the standard timer queue when dropping back to the simulator command prompt to accommodate the potential to disable asynch mode
- Fixed synchronization to operate with pthread synchronized asynch queue and proper stopping of poll when dropping back to the simulator command prompt
- Fixed calls to select to have a timeout with properly ranged tv_usec values and dealt with possible EINTR return from select
sim_console.c, sim_console.h
- Changed internal/pseudo console telnet device name to CON=TEL
- Reverted to the prior "SET CONSOLE DEBUG" command semantics since the console debug can be manipulated via the generic "SET <dev> DEBUG" command (i.e. SET CON-TEL DEBUG=TRC;XMT;RCV)
- Fixed synchronization to operate with pthread synchronized asynch queue and proper stopping of poll when dropping back to the simulator command prompt
- Fixed calls to select to have a timeout with properly ranged tv_usec values
sim_defs.h
- Added necessary unit fields to support asynchronous timing activities
- Added asynchronous macros to support async timing activities
- Fixed asynch pthread only macros (not using AIO_INTRINSICS).
- Fixed the definition of the UDATA macro which was never adjusted to accommodate the insertion of 2 extra fields in the unit structure and thus made the initialization of the unit wait field meaningless.
- Changed the NOQUEUE_WAIT value from 10000 to 1000000. This is only used when the sim_clock_queue is empty, which normally never happens on any simulator since they all have clocks and/or other frequently polling devices. With asynchronous multiplexer and timing support the queue is often empty and this value is then used when calculating idling delays. If it is too small, idling will be inefficient. Being large should not be a problem otherwise.
Interdata/id16_cpu.c
- removed test of sim_idle_enab before calling sim_idle
Interdata/id32_cpu.c
- removed test of sim_idle_enab before calling sim_idle
vax/vax_cpu.c
- removed test of sim_idle_enab before calling sim_idle
vax/vax_stddev.c
- converted CLK device to use the internal timer service API sim_activate_after to leverage asynchronous timing when available
scp.c, scp.h, sim_defs.h
- Added commands:
SHOW MULTIPLEXER (MUX)
SHOW TIMERS
- Added facilities/APIs:
sim_activate_after - time specific event scheduling (vs instruction scheduling) API visible, optional separate thread implementation in a later revision
- Changed Commands:
SET CONSOLE DEBUG no longer affects global debugging, but merely debugging for the console subsystem. Use SET DEBUG and SET NODEBUG to affect global debugging.
- Added Asynchronous polling support
sim_tmxr.h, sim_tmxr.c
- Added Asynchronous capabilities to the multiplexer subsystem to avoid polling for input and to deliver input data instantly when it arrives instead of delaying for up to one or more full simulated clock ticks.
- Added debug trace support
- Added statistic tracking of total bytes transmitted on each line
- Added more aggressive attempts to flush transmit buffers when they fill before dropping tranmitted characters
- Fixed status return of tmxr_putc_ln to return SCPE_LOST if the transmitting line isn't connected or buffered.
sim_console.h, sim_console.c
- Fixed issue where connections to console telnet sessions would succeed for the first connection, but hang indefinitely for additional connects without rejecting due to all lines being busy. This is handled by using an internal device and unit to hang the required polling on. Connection polls happen once per second.
- Added console debugging/trace support.
- Added Asynchronous capabilities to the console subsystem to avoid polling for input and to deliver input data instantly when it arrives instead of delaying for up to one or more full simulated clock ticks.
- Added tmxr_set_console_input_unit() API to support asynchronous simulator console I/O
sim_timer.h, sim_timer.c
- Added SHOW TIMERS support
- Added mechanism to capture the timer the simulator uses for its clock tick and make this timer globally available for other uses
PDP11/pdp11_dz.c
- Added debug trace support
PDP11/pdp11_vh.c
- Added debug trace support
- Changed timing mechanisms to not assume that the count unit service routine calls measures the passage of time, and created a separate unit to measure time.
VAX/vax_stddev.c
- Added call to tmxr_set_console_input_unit to leverage Asynchronous console I/O
- Removed flawed logic which assumed that sim_interval was meaningful when referenced by an asynchronous thread.
- Adjust the event_time of events removed from the asynch queue to account for the average time spent on the queue before the event was noticed by the instruction execution thread.
- Added a sim_activate_notbefore function which specifies an rtime which is the earliest time the event should fire.
- Changed the 'wakeup from idle' logic to force an immediate asynch queue check if the wakeup was not due to a timeout (i.e. it was due to an asynch queue insertion).
- Fixed the descrip.mms to build asynchronous support on AXP and IA64 VMS with kernel threads enabled
- Sleep for the observed clock tick size while throttling
- Recompute the throttling wait once every 10 seconds
to account for varying instruction mixes during
different phases of a simulator execution or to
accommodate the presence of other load on the host
system.
- Each of the pre-existing throttling modes (Kcps,
Mcps, and %) all compute the appropriate throttling
interval dynamically. These dynamic computations
assume that 100% of the host CPU is dedicated to
the current simulator during this computation.
This assumption may not always be true and under
certain conditions may never provide a way to
correctly determine the appropriate throttling
wait. An additional throttling mode has been added
which allows the simulator operator to explicitly
state the desired throttling wait parameters.
These are specified by:
SET THROT insts/delay
where 'insts' is the number of instructions to
execute before sleeping for 'delay' milliseconds.
Unbound the TODR value from the 100hz clock tick interrupt. TODR now behaves like the original battery backed-up clock and runs with the wall clock, not the simulated instruction clock (except when running ROM diagnostics).
Two operational modes are available:
- Default VMS mode, which is similar to the previous
behavior in that without initializing the TODR it
would default to the value VMS would set it to if
VMS knew the correct time. This would be correct
almost all the time unless a VMS disk hadn't been
booted from for more than a year. This mode
produces strange time results for non VMS OSes on
each system boot.
- OS Agnostic mode. This mode behaves precisely like
the VAX780 TODR and works correctly for all OSes.
This mode is enabled by attaching the TODR to a
battery backup state file for the TOY clock
(i.e. sim> attach TODR TOY_CLOCK). When operating
in OS Agnostic mode, the TODR will initially start
counting from 0 and be adjusted differently when an
OS specifically writes to the TODR. VMS will prompt
to set the time on the initial boot unless the SYSGEN
parameter TIMEPROMPTWAIT is set to 0.