1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-14 07:40:35 +00:00

98 Commits

Author SHA1 Message Date
Mark Pizzolato
cf1a6e83de PDP8: Add support for 16 terminals in the TTIX device 2016-10-10 16:29:40 -07:00
Mark Pizzolato
f5e3d3b5b2 PDP11: Fix ambiguous -D decimal vs data space reference - Add -T for data 2016-08-30 13:05:49 -07:00
Mark Pizzolato
f6404e2d22 All VAX: Fix REI check when compatibilty mode. From Bob Supnik
The rule check on the PSL was incomplete. DV, FU, IV must all be zero,
and they weren't checked at all.

VAX Diagnostic EVKAE now runs to completion.
2016-07-14 11:32:20 -07:00
Mark Pizzolato
af95f21308 PDP1: ASCII/FIODEC are not SET options. ASCII mode is only attach -A 2016-07-14 06:43:20 -07:00
Mark Pizzolato
f86fc47790 PDP1: Fix PTP and PTR ASCII Mode from Bob Supnik
ASCII mode for the paper tape reader and punch didn't <quite> work.

In ASCII mode, the <simulator> must create the leader and trailer. The
leader was already there. There shouldn't be nulls in an ASCII file. The
whole point is to be able to prepare and look at input and output files
with a normal text editor.

So this version should work right. It "autogens" trailer more or less
forever. It doesn't really need to return a STOP code on EOF, but users
would probably forget to put form feed at the end, so it doesn't hurt.
2016-07-13 14:58:11 -07:00
Mark Pizzolato
a8144df255 PDP1: Revised doc for Expensive Typewriter support, etc. from Bob Supnik 2016-07-13 13:32:08 -07:00
Mark Pizzolato
4ca012ec2a PDP1: Add Expensive Typewriter support and paper tape additions from Bob Supnik
1. Implemented Expensive Typewriter mode for TTO.
2. Added ASCII conversion on paper tape punch as well as reader.
3. Changed conversion tables to recognize form feed (014) as FIODEC STOP.
2016-07-13 13:30:53 -07:00
Mark Pizzolato
ae96d417cd VAX: Fixed WordLshift (ASHP left overflow calc)
As observed by EVKAB diagnostic and reported in #319
2016-05-30 14:39:01 -07:00
Mark Pizzolato
504d4576e5 SCP: Add missing SIM_SW_SHUT definition 2016-05-28 13:36:59 -07:00
Mark Pizzolato
b8b9dcffaa SCP: Added shutdown flag for detach_all 2016-05-28 13:33:07 -07:00
Mark Pizzolato
fc2d863b6e NOVA: Extend character input delay to 300 for PTR device
As discussed in #203
2016-05-13 11:50:02 -07:00
Mark Pizzolato
2f06c41fa7 GRI, I1401, PDP10, SDS: Fix compiler detected inconsistencies 2016-05-05 03:43:11 -07:00
Mark Pizzolato
da53043140 DOC: Added pdp8 revision to include FPP8A floating point unit 2016-04-10 10:40:24 -07:00
Mark Pizzolato
6a7dcd96df PDP8: Fix REG initializers 2016-03-19 06:19:45 -07:00
Mark Pizzolato
f40bc100a8 DOC: Update "Adding a Device to a Virtual Machine" to include details on the PDP18B simulators from Bob Supnik 2016-03-17 07:08:08 -07:00
Mark Pizzolato
784036cff9 DOC: Added missing documentation files from Bob Supnik.
simh.doc                         Writing a Simulator for the SIMH System
sim_breakpoints.doc     The SIMH Breakpoint Subsystem
sim_vmio.doc                 Adding An I/O Device To A SIMH Virtual Machine
2016-03-17 07:05:27 -07:00
Mark Pizzolato
a03973cec0 PDP15: Update pdp18b_rp from Bob Supnik.
1. Added RP03 support and supporting "SET" commands.
2. Fixed implementation of DPCF (it's a full reset and not blocked by BUSY).
3. Fixed handling of JOB DONE flag (not touched by NOP, SEEK, or RECAL).
2016-03-16 12:47:47 -07:00
Mark Pizzolato
74a0101771 PDP18B: Update console CR/LF echo behavior from Bob Supnik
The terminal service (in the ISR) forces a CR to be output IMMEDIATELY (before anything in the output queue) when 0212 is seen on input, so it needs to echo as a LF.

I hadn't seen any (other) echo support, so I had assumed the interface was half-duplex, which of course means passwords would appear on the paper!
2016-03-15 11:32:26 -07:00
Mark Pizzolato
7251196f31 PDP18B: Latest updates from Bob Supnik
- Added unix v0 terminal support
- Added 3-cycle databreak set/show entries
- Revised for dynamically allocated memory
- Added support for -u modifier (UC15 and Unix v0)

These changes are to support the Unix v0 bringup and to implement a
"Unix input" mode on the console terminal.  In Unix mode, CR and LF are
swapped (so that a modern terminal can use 'enter' instead of CTRK-J to
create the newline Unix expects), escape is mapped to altmode (175),
upper and lower case are enabled and the parity bit is forced to 1.  This
most closely matches the characteristics of the KSR-37, but there is no
definitive evidence of the terminal that was actually used.
2016-03-15 09:53:19 -07:00
Mark Pizzolato
1f3c9550d5 PDP11: Fixed bug in history virtual addressing (Bob Supnik)
The problem has to do with the difference in how the PSW is stored when
the simulator is running (it's all in pieces) or stopped (it's collected in PSW).
cpu_ex is a console routine and expects the PSW to be stored in PSW, but
when history is collected, it's not. In particular, cm (current mode) is in local
variable cm.

cpu_ex with /v calls relocC, which derives the current mode from the
switches:

- if /ksup, use kernel/supervisor/user/previous mode (from PSW); otherwise,
   use current mode from PSW
- if /d, use data space; otherwise, use instruction space

relocC is doing current mode i-space, which is what's wanted... except that
it's deriving current mode from PSW, rather than cm, which is where it's stored
while the simulator is running. It's fairly likely that PSW is long obsolete by the
time the history is invoked.
2016-03-06 06:24:33 -08:00
Mark Pizzolato
48bf4fb114 PDP18B: Add RB disk to PDP7 and DRM drum to PDP9 and -u, -p examine/deposit switches in PDP7, PDP9 and PDP15 2016-03-01 06:55:40 -08:00
Mark Pizzolato
a835061e67 PDP10: Fix nested indirect address limit exceeded (from Bob Supnik)
If the nested indirect/execute limit (INDMAX, XCTMAX) is set to 0, the simulator will loop indefinitely in an indirect address or execute loop, testing for interrupts before each memory reference. Thus, on an infinite loop, the simulator will never complete the instruction, but the instruction is interruptible. So for example, under TOPS-10:

.r ddt
1/    0    jrstf @1
1$g
^C
^C
.

The JRSTF will never finish, but it can be interrupted by any device, and double ^C will return control to the command line.

If INDMAX or XCTMAX is non-zero, the previous behavior of limiting loops to a specific depth is retained. However, the default value is now 0.

This closes issue #218.
2016-02-19 12:04:08 -08:00
Mark Pizzolato
30857a3550 PDP11: Addition of option to disable BEVENT for 11/03 and 11/23 CPUs (Bob Supnik's latest state). 2015-12-30 11:59:28 -08:00
Mark Pizzolato
4d48f44857 Bob Supnik's state as of 5/9/2015 after backporting some things from the master branch 2015-05-10 05:48:11 -07:00
Mark Pizzolato
3a279c013a PDP11: FP fix from Bob Supnik: MMR1 does not track register changes (Johnny Billquist) Fix #44 2015-03-26 14:25:01 -07:00
Mark Pizzolato
d7eb1ca856 I1620: Separated compare from add/sub flows (Tom McBride) Removed ADD_SIGNC return from add/sub flows. From Bob Supnik - Fix #172
The FP is "collateral damage" from simplifying the add_field routine.

This version runs CU01 without the record mark test.
2015-03-26 12:34:18 -07:00
Mark Pizzolato
b89c23b5b1 I1401: Fixed treatment of overflow (Ken Shirriff) 2015-02-09 12:30:58 -08:00
Mark Pizzolato
d906445c4a Fixed bug in read forward with byte swap - From Bob Supnik 2014-10-27 13:25:41 -07:00
Mark Pizzolato
4fae9edef1 VAX: Fixed SBR test 2014-09-05 14:07:57 -07:00
Mark Pizzolato
f25b57c58d Bob Supnik's state as of 6/11/2014 2014-06-11 16:52:00 -07:00
Mark Pizzolato
28ea389e94 I1401: Fix to deal with instructions that are longer than 8 characters from Van Snyder 2014-04-12 10:06:53 -07:00
Mark Pizzolato
9171387bcb I1620 : Changes from Bob Supnik re: Bob Armstrong has been running diagnostics and software, and these changes reflect fixes to bugs that were found.
We're not absolutely sure that all of the changes are correct - in particular the treatment of record marks in add/compare - but they do make the diagnostics pass, which they didn't before.

Bob asked for variable tab stops on the typewriter, and those are implemented as well. The routines were general enough that I put the SET/SHOW processors in sim_console.c, so I'm enclosing that and its header file.
2014-01-05 14:28:29 -08:00
Mark Pizzolato
d31e9148e6 VAX: Fix for unaligned memory reference to IO and Register Space (from Bob Supnik)
Design Notes for Fixing VAX Unaligned Access to IO and Register Space

Problem Statement: VAX unaligned accesses are handled by reading the
surrounding longword (or longwords) and

a) for reads, extracting the addressed addressed word or longword
b) for writes, inserting the addressed word or longword and then
   writing the surrounding longword (or longwords) back

This is correct for all memory cases. On the 11/780, the unaligned
access to register or IO space causes an error, as it should. On
CVAX, it causes incorrect behavior, by either performing too many
QBus references, or performing read-modify-writes instead of pure
writes, or accessing the wrong Qbus locations.

The problem cannot be trivially solved with address manipulation.
The core issues is that on CVAX, unaligned access is done to
exactly as many bytes as are required, using a base longword
address and a byte mask. There are five cases, corresponding to
word and longword lengths, and byte offsets 1, 2 (longword only),
and 3. Further, behavior is different for reads and writes, because
the Qbus always performs word operations on reads, leaving it to
the processor to extract a byte if needed.

Conceptual design: Changes in vax_mmu.c:

Unaligned access is done with two separate physical addresses, pa
and pa1, because if the access crosses a page boundary, pa1 may
not be contiguous with pa. It's worth noting that in an unaligned
access, the low part of the data begins at pa (complete with byte
offset), but the high parts begins at pa1 & ~03 (always in the
low-order end of the second longword).

To handle unaligned data, we will add two routines for read and
write unaligned:

	data = ReadU (pa, len);
	WriteU (pa, len, val);

Note that the length can be 1, 2, or 3 bytes. For ReadU, data is
return right-aligned and masked. For WriteU, val is expected to
be right-aligned and masked.

The read-unaligned flows are changed as follows:

if (mapen && ((off + lnt) > VA_PAGSIZE)) {              /* cross page? */
    vpn = VA_GETVPN (va + lnt);                         /* vpn 2nd page */
    tbi = VA_GETTBI (vpn);
    xpte = (va & VA_S0)? stlb[tbi]: ptlb[tbi];          /* access tlb */
    if (((xpte.pte & acc) == 0) || (xpte.tag != vpn) ||
        ((acc & TLB_WACC) && ((xpte.pte & TLB_M) == 0)))
        xpte = fill (va + lnt, lnt, acc, NULL);         /* fill if needed */
    pa1 = ((xpte.pte & TLB_PFN) | VA_GETOFF (va + 4)) & ~03;
    }
else pa1 = ((pa + 4) & PAMASK) & ~03;                   /* not cross page */
bo = pa & 3;
if (lnt >= L_LONG) {                                    /* lw unaligned? */
    sc = bo << 3;
    wl = ReadU (pa, L_LONG - bo);                       /* read both fragments */
    wh = ReadU (pa1, bo);                               /* extract */
    return ((wl | (wh << (32 - sc))) & LMASK);
    }
else if (bo == 1)                                       /* read within lw */
    return ReadU (pa, L_WORD);
else {
    wl = ReadU (pa, L_BYTE);                            /* word cross lw */
    wh = ReadU (pa1, L_BYTE);                           /* read, extract */
    return (wl | (wh << 8));
    }

These are not very different, but they do reflect that ReadU returns
right-aligned and properly masked data, rather than the encapsulating
longword.

The write-unaligned flows change rather more drastically:

if (mapen && ((off + lnt) > VA_PAGSIZE)) {
    vpn = VA_GETVPN (va + 4);
    tbi = VA_GETTBI (vpn);
    xpte = (va & VA_S0)? stlb[tbi]: ptlb[tbi];          /* access tlb */
    if (((xpte.pte & acc) == 0) || (xpte.tag != vpn) ||
        ((xpte.pte & TLB_M) == 0))
        xpte = fill (va + lnt, lnt, acc, NULL);
    pa1 = ((xpte.pte & TLB_PFN) | VA_GETOFF (va + 4)) & ~03;
    }
else pa1 = ((pa + 4) & PAMASK) & ~03;
bo = pa & 3;
if (lnt >= L_LONG) {
    sc = bo << 3;
    WriteU (pa, L_LONG - bo, val & insert[L_LONG - bo]);
    WriteU (pa, bo, (val >> (32 - sc)) & insert[bo]);
    }
else if (bo == 1)                                       /* read within lw */
    WriteU (pa, L_WORD, val & WMASK);
else {                                                  /* word cross lw */
    WriteU (pa, L_BYTE, val & BMASK);
    WriteU (pa, L_BYTE, (val >> 8) & BMASK);
    }
return;
}

Note that all the burden here has been thrown on the WriteU routine.

-------------

ReadU is the simpler of the two routines that needs to be written.
It will handle memory reads and defer register and IO space to
model-specific unaligned handlers.

int32 ReadU (uint32 pa, int32 lnt)
{
int32 dat;
int32 sc = (pa & 3) << 3;

if (ADDR_IS_MEM (pa))
    dat = M[pa >> 2];
else {
    mchk = REF_V;
    if (ADDR_IS_IO (pa))
       dat = ReadIOU (pa, lnt);
    else dat = ReadRegU (pa, lnt);
    }
return ((dat >> sc) & insert[lnt]);
}

Note that the ReadIOU and ReadRegU return a "full longword," just
like their aligned counterparts, and ReadU right-aligns the result,
just as ReadB, ReadW, and ReadL do.

WriteU must handle the memory read-modify-write sequence. However,
it defers register and IO space to model-specific unaligned handlers.

void WriteU (uint32 pa, int32 lnt, int32 val)
{
if (ADDR_IS_MEM (pa)) {
    int32 bo = pa & 3;
    int32 sc = bo << 3;
    M[pa >> 2] = (M[pa >> 2] & ~(insert[len] << sc) | (val << sc);
    }
else if ADDR_IS_IO (pa)
    WriteIOU (pa, lnt, val);
else WriteRegU (pa, lnt, val);
return;
}

--------------

For the 11/780, ReadIOU, ReadRegU, WriteIOU, and WriteRegU all do the
same thing: they throw an SBI machine check. We can write explicit
routines to do this (and remove the unaligned checks from all the
normal adapter flows), or leave things as they are and simply define
the four routines as macros that go to the normal routines. So there's
very little to do.

On CVAX, I suspect that ReadRegU and WriteRegU behave like the
normal routines. The CVAX specs don't say much, but CMCTL (the memory
controller) notes that it ignores the byte mask and treats every
access as an aligned longword access. I suspect this is true for
the other CVAX support chips, but I no longer have chip specs.

The Qbus, on the other hand... that's a fun one. Note that all of
these cases are presented to the existing aligned IO routine:

bo = 0, byte, word, or longword length
bo = 2, word
bo = 1, 2, 3, byte length

All the other cases are going to end up at ReadIOU and WriteIOU,
and they must turn the request into the exactly correct number of
Qbus accesses AND NO MORE, because Qbus reads can have side-effects,
and word read-modify-write is NOT the same as a byte write.

The read cases are:

bo = 0, byte or word - read one word
bo = 1, byte - read one word
bo = 2, byte or word - read one word
bo = 3, byte - read one word
bo = 0, triword - read two words
bo = 1, word or triword - read two words

ReadIOU is very similar to the existing ReadIO:

int32 ReadIOU (uint32 pa, int32 lnt)
{
int32 iod;

iod = ReadQb (pa);                                      /* wd from Qbus */
if ((lnt + (pa & 1)) <= 2)                              /* byte or word & even */
    iod = iod << ((pa & 2)? 16: 0);                     /* one op */
else iod = (ReadQb (pa + 2) << 16) | iod;               /* two ops, get 2nd wd */
SET_IRQL;
return iod;
}

The write cases are:

bo = x, lnt = byte - write one byte
bo = 0 or 2, lnt = word - write one word
bo = 1, lnt = word - write two bytes
bo = 0, lnt = triword - write word, byte
bo = 1, lnt = triword - write byte, word

WriteIOU is similar to the existing WriteIO:

void WriteIO (uint32 pa, int32 val, int32 lnt)
{
switch (lnt) {
case L_BYTE:                                            /* byte */
    WriteQb (pa, val & BMASK, WRITEB);
    break;
case L_WORD:                                            /* word */
    if (pa & 1) {                                       /* odd addr? */
        WriteQb (pa, val & BMASK, WRITEB);
        WriteQb (pa + 1, (val >> 8) & BMASK, WRITEB);
        }
    else WriteQb (pa, val, WRITE);
    break;
case 3:                                                 /* triword */
    if (pa & 1) {                                       /* odd addr? */
        WriteQb (pa, val & BMASK, WRITEB);
        WriteQb (pa + 1, (val >> 8) & WMASK, WRITE);
        }
    else {
        WriteQb (pa, val & WMASK, WRITE);
        WriteQb (pa + 2, (val >> 16) & BMASK, WRITEB);
        }
    break;
    }
SET_IRQL;
return;
}

-----------------

I think this handles all the cases.

/Bob Supnik
2013-12-21 12:56:04 -08:00
Mark Pizzolato
0774109897 PDP11: Fixed bug in CSM (John Dundas)
John Dundas said:

Bob and all,

I ran across what I believe to be a bug in the CSM code:

         case 070:                                       /* CSM */
             if (CPUT (HAS_CSM) && (MMR3 & MMR3_CSM) || (cm != MD_KER)) {

According to the Architecture Handbook, CSM may be executed only if the MMR3 bit is set AND the mode is not Kernel.  Changing the code to:

         case 070:                                       /* CSM */
             if (CPUT (HAS_CSM) && (MMR3 & MMR3_CSM) && (cm != MD_KER)) {

also has the effect of making the ZKDKB0 diagnostic much happier.

Thanks,

John
--
John A. Dundas III
2013-12-06 10:48:14 -08:00
Mark Pizzolato
6339af2dc4 PDP11: Fix to correctly set PS value on CPU reset to reflect the model specific ways real hardware behaved. (from Bob Supnik)
Here's a PDP11 SIMH bug as old as the simulator itself: the reset_cpu routine sets the PS to 340 (interrupts disabled). This causes some versions of Lunar Lander not to work. In fact, the initial state of the PS is not architecturally standardized:

      04: cleared (from schematics)
      05: cleared (from manual)
      20: cleared (from schematics)
      34: cleared (from schematics), set to 340 on boot?
      40: cleared (from schematics)
      44: cleared on init, set to 340 on boot (from schematics, manual)
      45: cleared (from schematics)
      60: cleared (from schematics)
      70: cleared (from schematics)
      T11: set to 340 (from spec)
      LSI11, F11: 4 mode behavior (from memory on power recovery, cleared on GO, 340 on boot, mode 3 undefined)
      J11: 4 mode behavior (from memory on power recovery, cleared on GO, 340 on boot, 340 on jump to  custom PROM)

The story seems to be this. All non-VLSI PDP11s used TTL chips to implement the PS, either discrete flip-flops, or 4b registers, or both.
Starting with the first system, the 11/20, they were wired clear on the processor INIT signal (power-up or front panel START switch), so that all internal state started as 0. This worked fine, because START also reset the Unibus and cleared all interrupt enables. So even though the processor was as IPL = 0, no interrupts were possible. Then along came the LSI11...

The LSI11 implemented a line-time clock with NO INTERRUPT DISABLE. Thus, if IPL was left at 0 and a bootstrap routine from a slow device was started (e.g., a floppy drive), the clock would tick, and an interrupt would occur, before the bootstrap routine finished. Because no vectors were set up, the processor would crash. So the LSI11 started the practice, carried over to all later PDP11 VLSI chips, of setting the PS to 340 before jumping to a boot ROM.

The T11 did this in all modes of startup, because its only startup behavior was to jump to a "boot" routine. It did not have a console of any kind.

Accordingly, it appears that the cpu_reset routine needs to set the PS based on the processor model. Further, all boot routines need to set the PS to 0 or 340 based on the processor model. (It's probably safe for boot routines just to set the PS to 340, but it's not technically
accurate.)
2013-10-27 04:14:46 -07:00
Mark Pizzolato
34ce1a038c Bob Supnik's state as of 10/12/2013 2013-10-12 13:23:44 -07:00
Mark Pizzolato
6031deddf8 Final Merge from source zip file. Changed 0readme_39.txt. v3.9-0 2012-05-03 14:31:47 -07:00
Mark Pizzolato
bb23bc422a Official Docs released with v3.9-0 2012-05-03 13:54:32 -07:00
Mark Pizzolato
0c0ff2173e Last minute fix for HP2100 in v3.9-0 release. 2012-05-03 12:55:16 -07:00
Mark Pizzolato
38e3d58c72 Official simh-v3.9-0 Merge 2012-05-02 05:39:27 -07:00
Mark Pizzolato
eaa17ffce8 Fixed incorrect build target names for new swtp6800 projects 2012-04-24 14:21:30 -07:00
Mark Pizzolato
e9aa507082 Issue cleanup after v3.9-0-rc3 merge 2012-04-23 06:02:37 -07:00
Mark Pizzolato
73bd8c36e7 Official simh-V3.9-0-rc3 Merge 2012-04-23 04:02:02 -07:00
Mark Pizzolato
15570e5e8d HP2100 update from Dave Bryan 2012-04-04 12:17:45 -07:00
Mark Pizzolato
77626d78e8 Added missing host NIC MAC address determination for VMS hosts 2012-03-30 06:38:34 -07:00
Mark Pizzolato
9a802a1438 Cleaner GCC options detection on older GCC versions on various platforms. 2012-03-29 09:59:17 -07:00
Mark Pizzolato
8ac73b39e5 Fix needed for compile on VAX/VMS 2012-03-28 12:43:06 -07:00
Mark Pizzolato
c93f9085df Include release information about enhancements and fixes to ethernet components. 2012-03-26 09:49:09 -07:00
Mark Pizzolato
fad0ed392a Add Projects and Solution definition for Microsoft Visual C++ IDE 2012-03-26 09:09:26 -07:00
Mark Pizzolato
44973468a5 Fixed case of file names for AltairZ80 simulator to be consistent across platforms 2012-03-26 08:46:03 -07:00