Commit graph

76 commits

Author SHA1 Message Date
Mark Pizzolato
8cbe4ba0bd VAX: Properly inline memory reference functions for performance. Fix #169 2014-12-31 13:25:49 -08:00
Mark Pizzolato
76009709b1 VAX: Minimizing extra work while preparing to idle and attempt to make idle transitions closer to instruction execution costs. 2014-12-29 12:02:21 -08:00
Mark Pizzolato
c548b34772 Compiler suggested cleanups. 2014-10-27 17:14:28 -07:00
Mark Pizzolato
3256c10c77 General cleanup migrate to using sim_printf vs separate calls to printf and fprintf(sim_log). 2014-10-22 17:12:14 -07:00
Mark Pizzolato
d6456e506d VAX: Simplified idle detection which allows more operating systems to properly detect when they are idling.
Removed the recently added SET CPU IDLE=SYSV since any SET CPU IDLE command will work for SysV.  Existing configurations probably did a SET CPU IDLE=32V which works fine now.

Changed things based on the realization that ANY branch instruction which tests memory and then branches to itself is an idle loop if the branch is taken.  This is without regard to address space, access mode, If interrupts are disabled, then it is a hung system and the simulation should halt.
2014-09-05 11:39:41 -07:00
Mark Pizzolato
26cf38804b VAX780: Added idle support for SysVR2
A new idle mode (SYSV) is now available:

    sim> SET CPU IDLE=SYSV
2014-09-04 14:08:59 -07:00
Mark Pizzolato
4c55f1af0c VAX: Make sure that Ultrix 1.X specific behaviors are only in effect with that OS 2014-07-17 10:04:40 -07:00
Mark Pizzolato
4d817f1deb VAX: Added support for the DEQNA device on Ultrix 1.x. Henry Bent observed that the deqna driver in this OS counted on older DEQNA firmware which automatically enabled interrupts after a software reset.
CPU Idle detection for this OS is now supported and the combination of SET CPU IDLE=ULTRIX-1.X and explicitly using a DEQNA device (SET XQ TYPE=DEQNA) will enable the automatic enabling of device interrupt generation.
2014-07-14 12:29:53 -07:00
Mark Pizzolato
a0a7eb27b6 VAX: Allow potentially pending console output to be delivered prior to halting back to the sim> prompt 2014-07-12 16:20:43 -07:00
Mark Pizzolato
3946eb710e VAX, PDP11, PDP10: Added a explanation of the capabilities and limitations of the NEXT command which is output the first time a NEXT command is entered.
Also added CHMK, CHME, CHMS and CHMU to the set of instructions which are considered subroutine call initiators in the VAX simulator.
2014-04-19 05:45:29 -07:00
Mark Pizzolato
d3bdc26a94 VAX: Added support for the NEXT command to step over subroutine calls BSBB, BSBW, JSB, CALLS and CALLG 2014-04-14 14:23:06 -07:00
Mark Pizzolato
6ce8d99cd8 SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)
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().
2014-03-28 08:20:05 -07:00
Mark Pizzolato
db91afbaaf VAX: Compiler warning cleanup 2013-09-05 23:30:22 -07:00
Mark Pizzolato
da8dd3c7e6 VAX: Added Register Bit Field definitions for the PSL register 2013-08-21 13:51:25 -07:00
Mark Pizzolato
651780c481 Remove stray tab characters which crept in over time 2013-06-03 06:29:01 -07:00
Mark Pizzolato
8116b7571d Fix VAX 8600 memory controller attribute descriptions to properly reflect the board size and slots.
Fixed value of 8600/8650 SID register ECO and PLANT fields.
Added SHOW CPU MEMORY command to display memory board configuration
2013-03-24 08:44:10 -07:00
Mark Pizzolato
51badc2d8e The MicroVAX specific CPU Boot help has been moved to the MicroVAX specific modules 2013-03-19 01:52:31 -07:00
Mark Pizzolato
0605b6dff4 Added support for building on Solaris with the Sun C compiler 2013-03-17 16:50:57 -07:00
Mark Pizzolato
28b90552b7 Revised all VAX simulator devices to have proper help information defined to make "HELP dev SHOW" and "HELP dev SET" most useful. 2013-02-02 16:29:38 -08:00
Mark Pizzolato
cbe11147fc Created a way for devices to have a description presentation routine and if it is supplied for its output to be visible with a SHOW SYSTEM command. Provided device description routines for devices used in the VAX simulators 2013-01-25 12:04:25 -08:00
Mark Pizzolato
83c1d80194 Merge branch 'master' into AsyncTmxr
Conflicts merged and missing changes in new modules added as needed for clock co-scheduling.
2013-01-21 16:52:42 -08:00
Mark Pizzolato
19f8fccbc1 Added HELP device REGISTERS support and register definitions for the VAX CPU device 2013-01-15 10:19:52 -08:00
Mark Pizzolato
923d5411f5 Added HELP CPU to all VAX simulators 2013-01-15 10:18:49 -08:00
Mark Pizzolato
8720c8c87b Made the VAX model visible with a SHOW CPU MODEL command for all simulators and made the model persist across a SAVE/RESTORE for the VAX simulators with a settable model 2013-01-14 06:53:48 -08:00
Mark Pizzolato
dac73b9381 Migrating scp and library global variables to be declared as extern in the appropriate library include file and remove repetitive declarations in referencing modules. 2013-01-10 13:29:15 -08:00
Mark Pizzolato
bc816ae871 Fixed Asynchronous Event Queueing to work correctly when doing Lock based queueing 2013-01-10 09:53:40 -08:00
Mark Pizzolato
784ae24324 - Fixed asynchronous i/o hangs introduced when asynchronous cancel support was added
- 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
2013-01-09 17:02:58 -08:00
Mark Pizzolato
3bcb6c1f3d Merge branch 'master' into AutoConfigure 2012-12-23 07:22:14 -08:00
Mark Pizzolato
ca37549a22 Be more precise about the conditions which describe sitting at the VAX 3900 boot rom character prompt to enable CPU idling there. 2012-12-21 13:37:01 -08:00
Mark Pizzolato
7bed091134 Reworked Auto Configure for all Qbus/Unibus devices to have their device address settings table driven from the auto configure code rather than statically defined in many per cpu model include files.
Fixed auto configure bugs which didn't allow Fixed CSR Addresses or Fixed Vectors to be set using the auto configure information.
Fixed display of address and vectors to indicate that the assigned address and/or vector is in the floating set.
Added extended definitions to the auto configure table to reflect all known potential static and floating and static addresses as of VMS V5.5-2
Changed the name of the VAX 11/780 console floppy device name to RXC from RX (which collides with a Unibus name for the RX11).
2012-12-20 13:58:11 -08:00
Mark Pizzolato
50cf91d441 Merge branch 'SerialMux' and compiler suggested cleanup 2012-12-18 09:52:14 -08:00
Mark Pizzolato
c87c747ed7 Compiler warning cleanup 2012-12-16 06:24:36 -08:00
Mark Pizzolato
97d4f18377 Fix to properly format the CPU boot code load string on ARM platforms (Jordi Guillaumes i Pons) 2012-11-20 04:59:29 -08:00
Mark Pizzolato
7c7df669ad Asynchronous Support
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.
2012-11-12 15:33:35 -08:00
Mark Pizzolato
b01fa8fbb0 Addition of MicroVAX II (VAX630) and rtVAX 1000 (or Industrial VAX 620) processor simulators from Matt Burke
Generalized the Boot Code loading support to use common code which has been added to vax_cpu.c
2012-11-09 12:18:15 -08:00
Mark Pizzolato
2481a8e148 vax_cpu.c, vax_cpu.h Added optional per CPU #define of CPU_MODEL_MODIFIERS which would be defined in vaxXXX_defs.h and be added to the cpu_mod array. 2012-11-05 15:54:13 -08:00
Mark Pizzolato
9cd3a07ff6 Merge remote-tracking branch 'origin/master' into Extra-VAXen
Merged related functionality into new VAX 750 modules

Cleaned up compiler complaints from the clang compiler
2012-10-22 06:32:38 -07:00
Mark Pizzolato
f8e34b103b Added new VAX750 simulator from Matt Burke 2012-10-22 05:09:10 -07:00
Mark Pizzolato
030d790b4c Asynchronous Timer Support
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
2012-05-26 07:16:04 -07:00
Mark Pizzolato
0f8e6cfe95 Cleanup for warning messages produced by the clang C compiler. Mostly adding parentheses in conditional assignments and clarification parentheses in complex boolean expressions. 2012-04-29 11:59:44 -07:00
Mark Pizzolato
db9bf32112 Merge of Bob's simh-v3.9-0-rc3 2012-04-23 11:50:43 -07:00
Mark Pizzolato
c1663795f1 Added VAX idle support for newer versions of NetBSD and OpenBSD guests if they use IPL 1 as the idle trigger 2012-04-11 19:24:42 -07:00
Mark Pizzolato
542c15844c Added display of the OS sleep resolution which is now displayed as an explanation if idling is unavailable. 2012-04-11 07:32:06 -07:00
Mark Pizzolato
ab3af3062d - Changed asynch queue insertion and removal to use a lock free algorithm based only on InterlockedCompareExchangePointer. We can now use this lock free approach on IA64 host systems as well.
- 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
2012-04-04 11:05:24 -07:00
Mark Pizzolato
6e813b8364 Merge with v3.9-0-rc2 first pass 2012-03-24 19:46:37 -07:00
Mark Pizzolato
fffad7c20e Merge changes from v3.9-0 rc1 2012-03-19 16:05:24 -07:00
Mark Pizzolato
eb0f027c47 Cleanup Compiler warning. 2012-03-14 17:21:15 -07:00
Mark Pizzolato
a6b8d63f10 Merge of VAX 11/730 Simulator from Matt Burke 2011-09-23 16:21:03 -07:00
Mark Pizzolato
e70278eabf VAX: Fixed idle conditions for various versions of Ultrix, Quasijarus-4.3BSD, NetBSD and OpenBSD.
Note: Since NetBSD and OpenBSD are still actively developed operating systems, new versions of
these OSes are moving targets with regard to providing idle detection.  At this time, recent versions
of OpenBSD have veered from the traditional OS idle approach taken in the other BSD derived OSes.
Determining a reasonable idle detection pattern does not seem possible for these versions.
2011-09-21 07:13:35 -07:00
Mark Pizzolato
f1b638749f Added display of the measured sleep resolution to sim_show_idle and a call to sim_show_idle from the VAX cpu_show_idle routine. 2011-09-19 14:49:45 -07:00