1
0
mirror of https://github.com/simh/simh.git synced 2026-01-13 23:35:57 +00:00

115 Commits

Author SHA1 Message Date
Bob Supnik
ae3179e2fe PDP11, PDP10, VAX780: CR11 is BR6, CD11 is BR4 2017-03-07 09:05:59 -08:00
Bob Supnik
d7a98da256 PDP8: Change RESET CPU to clear L'AC
As discussed in #400 and described in the maintenance manuals and/or
schematics for all five PDP-8 models (8, 8/S, 8/I, 8/E, 8/A).
2017-02-19 21:36:42 -08:00
Bob Supnik
e22ffedb29 PDP11: Fixed RF device CSR address in boot code 2017-02-13 08:27:47 -08:00
Bob Supnik
9f4b198afd PDP11: Fix address block length for RS device
As discussed in #396
2017-02-11 10:33:51 -08:00
Bob Supnik
b86fa93174 PDP10: Fix RIM load loader count
As further discussed in #278
2017-02-01 08:04:09 -08:00
Bob Supnik
6705fe9398 PDP8: Renamed switch register variable to SR
As discussed in: #385
2017-01-28 12:11:01 -08:00
Bob Supnik
4740135958 PDP10: Fixed RIM loader to handle ITS and RIM10B formats
As discussed in #378

The fixes include:

1. Tightening up the "magic" code so that it can now tell EXE, SAV, and RIM
    formats apart.
2. Skipping the loader itself for both RIM10B and ITS RIM. (PDP10 Macro manual
    says that RIM10B always includes the loader.) 3. Distinguishing ITS RIM from
    RIM10B by the length of the loader block.
4. Adding the slight differences in processing between ITS RIM and RIM10B.

There is no documentation change. -R or the extension .RIM still invoke the
RIM loader, and the code tells ITS and RIM10B apart.
2017-01-20 15:21:12 -08:00
Mark Pizzolato
95f27b2cfd Visual Studio Projects: Fix PDP10 build which had removed the XU device 2017-01-20 15:11:33 -08:00
Mark Pizzolato
c23b1a5ca1 PDP10: Fixed bugs in 1-proceed
As discussed in: PDP-10: single step in DDT crashes ITS (#373)
2017-01-14 08:33:35 -08:00
Mark Pizzolato
b414f54fd4 PDP11, VAX780: Moved CR11/CD11 from BR4 to BR6 2017-01-06 12:33:59 -08:00
Mark Pizzolato
99bbc5f8cf PDP11: Add initial UC15 support from Bob Supnik 2016-12-04 15:51:22 -08:00
Mark Pizzolato
fa1fba5bd5 PDP11: TC11 - Revised to model TCCM correctly
As reported by Josh Dersch in #358

   Read hardware notes:

   - While the TCCM error bit is a real flop, it is supposed to reflect
     the OR of the TCST error bits at all time, so it is updated on read.
   - A read of TCDT while the function is RALL clears DONE.

Write hardware notes:

   - The TC11 behaves much more like a traditional DECtape controller
     than a typical PDP11 peripheral. In particular, execution is
     initiated/controlled by any write to TCCM, rather than setting
     the GO (DO) bit. Unless the function is STOP or STOP ALL, writing
     TCCM will put the selected tape in motion.
   - Writing GO (DO) clears DONE (READY) and the error flops in TCST.
   - Writing a 0 to ERROR clears the error flops in TCST. Because it
     is write 0 to clear (later controllers used write 1 to clear),
     the simulator has to know whether ERROR is actually written.
   - STOP ALL ignores select errors. Every other function is rejected
     if there is a select error.
   - An illegal operation (setting ILO) will stop the selected tape.
   - A write of TCDT while the function is RALL, WALL, or WTMK clears
     DONE (READY). RALL should not be included, but it saved a gate
     not to prevent it.
   - Because DONE (READY) may not be clear when an operation completes
     and DONE (READY) is set, the DT_SETDONE must test for DONE (READY)
     not being already set.
2016-12-04 11:08:23 -08:00
Mark Pizzolato
88105d0b16 PDP11: Removed old source files 2016-12-04 11:07:37 -08:00
Mark Pizzolato
e740e13c13 PDP10: Fix 2% wallclock issue for 50 Hz systems (R. Voorhorst) 2016-11-21 20:04:35 -08:00
Mark Pizzolato
45a5432330 PDP10: Fixed last digit error in CVTBDT instruction as discussed in #347 2016-11-05 12:07:30 -07:00
Mark Pizzolato
1ff0e65627 I1401: Fix tape to call sim_tape_attach to attach tapes 2016-10-20 12:50:13 -07:00
Mark Pizzolato
ee59a6b6d2 PDP11: Fixed bad register definitions 2016-10-11 06:34:35 -07:00
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