Commit graph

123 commits

Author SHA1 Message Date
Mark Pizzolato
d3d3c94485 All VAX: Fix CPU HISTORY MTAB help info 2021-08-14 23:11:27 -07:00
Mark Pizzolato
1548bd1cf6 infoserver100, infoserver150vtx: Add idle detection support
As reported in #1047
2021-06-05 13:17:27 -07:00
Mark Pizzolato
885277e14f VAX: Fix typo in help for SET CPU IDLE command. 2021-02-23 12:50:22 -08:00
Mark Pizzolato
09f18ec2ba VAX: Add idle support for VMS V5.0 and V5.1
As discussed in #853
2020-05-18 06:26:10 -07:00
Mark Pizzolato
1c589030ae TIMER: Provide a means for VM to indicate its expected calibration rate
As reported and discussed in #817

This allows RUNLIMIT to provide useful results on fast or slow host systems.
2020-03-23 07:48:45 -07:00
Mark Pizzolato
8a858c181d SCP: Clean up WEAK definition and rework deprecated references to sim_vm_init
As discussed in #794
2020-01-29 12:30:25 -08:00
Mark Pizzolato
7b5dc834fd MicroVAX2: Add IDLE support for Console ROM and Diagnostic Monitor 2019-07-17 09:00:24 -07:00
Mark Pizzolato
f75f28aa21 TIMER: Add mechanism to pre-calibrate the instruction execution rate 2019-05-28 23:56:58 -07:00
Mark Pizzolato
6ae9b8025a Full VAX Simulators: Fix inverted instruction set test 2019-05-01 04:20:51 -07:00
Mark Pizzolato
95c24b4f81 MicroVAX I: Make SID register reflect D-FLOAT or G-FLOAT instruction set
- Limit choices to explicitly either G-FLOAT or D-FLOAT for SET CPU INST=
- Compile in all instruction implementations and dynamically use the
  enabled ones.
2019-04-30 17:39:56 -07:00
Mark Pizzolato
621e97e170 MicroVAX1, all VAX: Add model specific instruction execution and emulation
- Different VAX models had different groups of instructions which were
  implemented in hardware vs trappng to the OS for emulation.  Functionality
  has been added to differentiate the various mix of instruction groups for
  different models and to display both the groups and the actual instructions.
- Visibility to Instruction groups is provided by SHOW CPU INSTRUCTIONS
  and the list of the active instructions implemented and emulated via
  SHOW CPU -V INSTRUCTIONS.
- The MicroVAX I CPU handled some execution fault conditions differently
  from other VAX systems these differences are now specifically handled.
- Add build time test support to MicroVAX I running EHKAA v1.13
  suggested in #683
- Add more CPU debug details relating to exception and interrupt processing
2019-04-30 14:28:37 -07:00
Bob Supnik
3f9a77bd10 VAX, VAX780: Added hook for unpredictable indexed immediate
Originally, the VAX allowed immediate operands (8F) to be used without
restrictions in address mode instructions, either standalone or indexed.
Starting with MicroVAX II, immediate indexed became reserved. This
remained true for all subsequent chip implementations. The SRM was
ECOed in March, 1985 to make immediate indexed unpredictable.

In MicroVAX II, immediate g-floating operands didn't work correctly. The
problem was found a couple of months after tape-out. While the index
flows could be fixed, and were fixed according to the microcode revision
history:

;    7-May-84    [RMS]    Fixed FD problem in index flows (JLR)

the problem in indexed immediate could only be fixed by a significant
hardware change in an area that was already packed full. The VAX
Architecture Team, which had always been very sympathetic to the
VAX chip efforts, proposed a much simpler solution: make immediate
indexed unpredictable. It was useless, in any case.

I'm rather surprised that this wasn't flagged by the 780 diagnostics.
Maybe it was never tested. It was tested in HCORE (the original MicroVAX I
core diagnostic that is failing), but I removed it subsequently:

; 8-may-85    rms    removed indexed immediate tests

Bottom line - the simulator is right for the chip VAXes (including, I think,
V11) and wrong for MicroVAX I and probably the 8600, 780, 750, and 730.

# Conflicts:
#	VAX/vax_cpu.c
2019-04-23 22:58:02 -07:00
Bob Supnik
2f0db74483 VAX: Provide support for MTPR/MFPR opcodes to set V & C condition codes 2019-04-13 12:49:43 -07:00
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