Commit graph

110 commits

Author SHA1 Message Date
Mark Pizzolato
bacf1a7445 SCP: Use internal device SCP-PROCESS for SCP level debugging 2019-01-22 15:48:48 -08:00
Mark Pizzolato
be52190067 All VAX: extend REI debugging support
Identify reserved operand fault reason details.
2018-09-27 06:41:40 -07:00
Bob Supnik
b9543529d2 All VAX: Fixed uninitialized variable on FPD path (COVERITY) 2017-03-31 15:02:34 -07:00
Mark Pizzolato
fa1671455e All VAX: Avoid potential invalid memory reference recording history after FPD 2017-03-30 19:22:16 -07:00
Mark Pizzolato
0e6a79f078 All VAX: Initialize intermediate state vars outside of the instruction loop
Many of the intermediate state variables are captured by the instruction
history mechanism.  Make sure that these don't come into and out of
scope between instruction executions.
2017-03-18 17:59:13 -07:00
Bob Supnik
430541bda9 All VAX: Fixed dangling else in show_opnd (COVERITY) 2017-03-14 04:34:36 -07:00
Mark Pizzolato
1555056396 All VAX: Adjust sim_interval by reasonable amount for string instructions
Previously sim_interval was adjusted by 1 plus the total number of bytes
referenced in string instructions (SCANC, SPANC, LOCC, SKPC, CMPC3,
CMPC5, MOVC3, MOVC5).  Since the amount of data that a string
instruction can reference is arbitrarily large (32bit size), the adjustment
to sim_interval could be ridiculously excessive.  This can result in wild
variances in clock calibration when large string data are referenced.
2017-01-17 15:58:55 -08:00
Mark Pizzolato
2df1433d71 All VAX: Defer taking any HALT action until pending events have fired 2017-01-03 12:01:53 -08:00
Mark Pizzolato
0275ef05e8 All VAX: Lower overhead when idling.
The original idling model called sim_idle() within the context of a scheduled
event running on the CPU unit.  The overhead of scheduling and the related
dispatch serve no specific purpose.
Meanwhile, the 'work' involved in determing if idling is possible is about
equivalent to the work of executing an additional instruction.  Therefore
sim_idle is invoked with an argument which causes the sim_interval to be
adjusted by 1 on each call that doesn't actually perform an idle sleep.  This
adjustment keeps the calibrated instruction execution rate consistent with
other purely non-idle instruction mixes.
2016-12-29 09:47:09 -08:00
Mark Pizzolato
39d2944ede TIMER: Add support for catchup clock ticks and cleaned up asynchronous clocks
Asynchronous clocks are now built for all simulators which are built with
SIM_ASYNCH_IO defined.  The default behavior has asynchronous clocks
disabled since this is still experimental, but it can be enabled with
SET TIMER ASYNC.

Catchup clock ticks are now available, but since they're experimental,
they aren't enabled by default.  Catchup ticks are only available if the
simulators clock device calls sim_rtcn_tick_ack to acknowledge processing
of clock ticks.  The VAX simulators have been modified to leverage this.
Catchup clock ticks can be enabled with SET TIMER CATCHUP

Additionally, an idle threshold is provided which can be used to
influence when clock calibration may be suppressed.  The default is not
to suppress calibration activities.

The various timer behaviors are visible with the SHOW TIMER command.

The state of the operating timer facilities is visible with: SHOW CLOCK

Timer events which are queued are visible with the SHOW QUEUE command.
2016-11-16 23:50:53 -08:00
Mark Pizzolato
a71a7c6882 VAX: Add octaword result information to instruction history
Also reworked drom result bitfield macros to use standard shift and masks
2016-05-28 06:03:21 -07:00
Mark Pizzolato
4e7fada26c VAX: Fix decode of octaword instructions
EXAMINE -M now properly displays instruction arguments for octaword
instructions.
2016-05-27 15:09:40 -07:00
Mark Pizzolato
8e5d0b0a40 VAX: Allow history log file to have mixed case filename 2016-05-27 07:55:17 -07:00
Mark Pizzolato
253e9deea7 All VAX: Fix idle/inifinite loop detection for instructions with side effects
Recent enhancements to idle/infinite loop detection generalized handling
of detecting 'loop to self' cases.  This was done without considering that
some instructions have side effects (i.e. change other state like the stack
pointer) and thus aren't merely loop to self cases.

This problem was reported in #315
2016-05-18 09:02:22 -07:00
Mark Pizzolato
5531ccb175 ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.

Most simulators can now also be compiled with a C++ compiler without
warnings.

Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
2016-05-15 15:25:33 -07:00
Mark Pizzolato
46465d3348 VAX: Add explanation to reason for stopping due to invalid PSL value
A user could change the contents of the PSL via a DEPOSIT command.
If the resulting PSL indicates Interrupt Stack and IPL is 0, then this is
equivalent to MTPR #0,#IPL which is explicitly described as "undefined"

When a MTPR #0,#IPL is performed, the VAX chip microcode doesn't check,
neither does the 780 microcode.  Nothing bad will happen immediately,
however when an interrupt occurs, the saved PSL will now contain IPL 0
and Interrupt Stack.  This combination will cause the REI dismissing the
taken interrupt to fail.  To avoid a user manually creating this via
a DEPOSIT command or to potentially detect this condition while stepping
through instructions this check refuses to execute when the PSL is
invalid.  This change merely provides an explanation.

On page 5-37 of the VAX SRM (DEC standard 32), the REI pseudo-code defines
exactly what a legal PSL looks like. The check at the beginning of
sim_instr is a direct implementation of that check, intended to prevent
the user from creating an inconsistent PSL through the simulator console.
In a VAX chip, the console code would exit by a genuine REI, and any
illegal value created by the user would cause a system stop (return to the
console).

On page 5-43, the revision history notes that in rev 8 of chapter 5,
MTPR #0,#IPL was made undefined. Because MXPR is privileged, and the
general assumption was that VMS knew what it was doing, no one realized
the potential inconsistency that MTPR #IPL could create until it was
too late. "Undefined" allows any behavior, up to and including blowing up
the system.
2016-04-05 06:44:30 -07:00
Mark Pizzolato
d2269f8bd5 VAX: Fix compile error introduced by previous commit. 2016-03-25 09:37:27 -07:00
Mark Pizzolato
126032428c VAX: Add IDLE names which align with various BSD Version names
Fix #294
2016-03-25 09:32:36 -07:00
Mark Pizzolato
d0e3d2252a VAX: Correct documented list of CPU IDLE options.
Fix #294
2016-03-24 10:17:21 -07:00
Mark Pizzolato
733f904b8c VAX: Removed SET CPU IDLE=ALL which can only produce strange behavior
As discussed in issue #294
2016-03-24 09:49:28 -07:00
Mark Pizzolato
253f8a8dcf VAX: Move CPU register and routine declarations into vax_defs.h
Avoid redundant declarations in every simulator module that uses them
and allow compiler to validate consistency of declarations and definitions.
2016-02-29 16:37:18 -08:00
Mark Pizzolato
8d51b3517d VAX: Add computed results to instruction history trace 2016-02-28 18:02:25 -08:00
Mark Pizzolato
c8cd853102 VAX: Allow SET CPU IDLE command to not specify a stability value.
Report invalid stability values and explain why they're invalid.

Fixes #281
2016-02-26 02:17:31 -08:00
Mark Pizzolato
9d979360b4 VAX: Add the ability to 'STEP OUT" of the most recent subroutine call.
This is invoked with STEP -R nnn, or CONT -R.  Execution will continue
across any new subroutines which are called and stop after the current
routine executes a RET or RSB instruction.
2016-02-24 10:44:12 -08:00
Mark Pizzolato
49d3ec8ff7 VAX: Add command support to set the idle stability delay
SET CPU IDLE={OS{:n}} where n is the idle stability delay
which is also the clock calibration delay.
A -D switch on a SHOW -D CPU IDLE command will
display the stability delay as will a SHOW CLOCK command.
2016-02-23 17:07:12 -08:00
Mark Pizzolato
cea1f1bb52 VAX: Add optional simulator time and logging to disk for instruction history.
simulator time allows instruction history to be precisely correlated with
debug output.  It also provides a way to reproduce and review simulation
activities by stopping at predetermined time values (via STEP) to
examine details of simulator state.

disk logging can be useful to compare activities performed in separate
simulator runs.
2016-02-23 08:31:57 -08:00
Mark Pizzolato
3d6dd2f3ad VAX: Fix NEXT command to also work when Virtual Memory is enabled.
Initial testing was only done with boot code before the virtual addressing
was enabled.
2016-02-04 10:32:14 -08:00
Mark Pizzolato
197edc8d93 VAX: Add VAX ELN idle support. 2016-02-04 10:28:37 -08:00
Mark Pizzolato
283d2890fe VAX: Change BBC and BBS instructions to not be include the idle/halt testing
The MicroVAX II boot ROM has code uses one of these instructions with the
data being referenced somewhere in Qbus space.  This is not supposed to be
done according to the architecture specifications, but it must have worked on
real hardware.  In any case, as a consequence of this reference to I/O space,
these otherwise non-data modifying instructions can have side effects or
reference data which may change even in an instruction looping on itself.
Given that potential, such use isn't an infinite loop which would otherwise
inspire a drop back to scp.
2015-12-10 15:54:25 -08:00
Mark Pizzolato
2549f34560 VAX: Change HALT behavior to dispatch non polling events prior to returning to SCP.
This allows pending I/O (console, or otherwise) to complete before dropping
back to the sim> prompt.  This better simulates the model where scp is analogous
to the console processor on the older VAX simulators.  This better addresses the
incomplete I/O problems discussed in #208
2015-12-10 05:40:13 -08:00
Mark Pizzolato
90ea285c1a VAX: Generalized idle checks for all branch to self cases and fixed logic for 32V idle 2015-12-06 11:15:11 -08:00
Mark Pizzolato
c3a879da2d VAX: Change to load ROMs or other boot code directly from built in memory arrays.
Prior logic attempted to load the desired file from the current default directory and if that failed wrote the in memory boot code image to the desired file and then retried the desired load..

A user can still explicitly load a ROM image with a "LOAD -R romfile.bin" command prior to a BOOT attempt if they want to test or otherwise run with a different ROM.
2015-09-28 09:19:38 -07:00
Mark Pizzolato
5e556cc70a ALL VAX: Fix vax_cpu to be model invariant and implement platform specific machine behavior in model specific machine_check routine. As per Bob Supnik. Fix #198 2015-03-30 10:27:02 -07:00
Mark Pizzolato
ef9d1adce1 PDP10, PDP11, VAX: const cleanup 2015-02-13 06:18:24 -08:00
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