The source set has been extensively overhauled. For correct viewing, set Visual C++ or Emacs to have tab stops every 4 characters. 1. New Features 1.1 3.5-0 1.1.1 All Ethernet devices - Added Windows user-defined adapter names (from Timothe Litt) 1.1.2 Interdata, SDS, HP, PDP-8, PDP-18b terminal multiplexors - Added support for SET <unit>n DISCONNECT 1.1.3 VAX - Added latent QDSS support - Revised autoconfigure to handle QDSS 1.1.4 PDP-11 - Revised autoconfigure to handle more cases 1.2 3.5-1 No new features 1.3 3.5-2 1.3.1 All ASCII terminals - Most ASCII terminal emulators have supported 7-bit and 8-bit operation; where required, they have also supported an upper- case only or KSR-emulation mode. This release adds a new mode, 7P, for 7-bit printing characters. In 7P mode, non-printing characters in the range 0-31 (decimal), and 127 (decimal), are automatically suppressed. This prevents printing of fill characters under Windows. The printable character set for ASCII code values 0-31 can be changed with the SET CONSOLE PCHAR command. Code value 127 (DELETE) is always suppressed. 1.3.2 VAX-11/780 - First release. The VAX-11/780 has successfully run VMS V7.2. The commercial instructions and compatability mode have not been extensively tested. The Ethernet controller is not working yet and is disabled. 2. Bugs Fixed 2.1 3.5-0 2.1.1 SCP and libraries - Trim trailing spaces on all input (for example, attach file names) - Fixed sim_sock spurious SIGPIPE error in Unix/Linux - Fixed sim_tape misallocation of TPC map array for 64b simulators 2.1.2 1401 - Fixed bug, CPU reset was clearing SSB through SSG 2.1.3 PDP-11 - Fixed bug in VH vector display routine - Fixed XU runt packet processing (found by Tim Chapman) 2.1.4 Interdata - Fixed bug in SHOW PAS CONN/STATS - Fixed potential integer overflow exception in divide 2.1.5 SDS - Fixed bug in SHOW MUX CONN/STATS 2.1.6 HP - Fixed bug in SHOW MUX CONN/STATS 2.1.7 PDP-8 - Fixed bug in SHOW TTIX CONN/STATS - Fixed bug in SET/SHOW TTOXn LOG 2.1.8 PDP-18b - Fixed bug in SHOW TTIX CONN/STATS - Fixed bug in SET/SHOW TTOXn LOG 2.1.9 Nova, Eclipse - Fixed potential integer overflow exception in divide 2.2 3.5-1 2.2.1 1401 - Changed character encodings to be compatible with Pierce 709X simulator - Added mode for old/new character encodings 2.2.2 1620 - Changed character encodings to be compatible with Pierce 709X simulator 2.2.3 PDP-10 - Changed MOVNI to eliminate GCC warning 2.2.4 VAX - Fixed bug in structure definitions with 32b compilation options - Fixed bug in autoconfiguration table 2.2.5 PDP-11 - Fixed bug in autoconfiguration table 2.3 3.5-2 2.3.1 PDP-10 - RP: fixed drive clear not to clear disk address 2.3.2 PDP-11 (VAX, VAX-11/780, for shared peripherals) - HK: fixed overlap seek interaction with drive select, drive clear, etc - RQ, TM, TQ, TS, TU: widened address display to 64b when USE_ADDR64 option selected - TU: changed default adapter from TM02 to TM03 (required by VMS) - RP: fixed drive clear not to clear disk address - RP, TU: fixed device enable/disable to enabled/disable Massbus adapter as well - XQ: fixed register access alignment bug (found by Doug Carman) 2.3.3 PDP-8 - RL: fixed IOT 61 decoding bug (found by David Gesswein) - DF, DT, RF: fixed register access alignment bug (found by Doug Carman) 2.3.4 VAX - Fixed CVTfi to trap on integer overflow if PSW<iv> is set - Fixed breakpoint detection when USE_ADDR64 option selected
276 lines
9.6 KiB
C
276 lines
9.6 KiB
C
/* vax780_mem.c: VAX 11/780 memory controllers
|
|
|
|
Copyright (c) 2004-2005, Robert M Supnik
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
copy of this software and associated documentation files (the "Software"),
|
|
to deal in the Software without restriction, including without limitation
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
Except as contained in this notice, the name of Robert M Supnik shall not be
|
|
used in advertising or otherwise to promote the sale, use or other dealings
|
|
in this Software without prior written authorization from Robert M Supnik.
|
|
|
|
This module contains the VAX 11/780 system-specific registers and devices.
|
|
|
|
mctl0, mctl1 MS780C/E memory controllers
|
|
*/
|
|
|
|
#include "vax_defs.h"
|
|
|
|
/* Memory controller register A */
|
|
|
|
#define MCRA_OF 0x0
|
|
#define MCRA_SUMM 0x00100000 /* err summ (MS780E) */
|
|
#define MCRA_C_SIZE 0x00007E00 /* array size - fixed */
|
|
#define MCRA_V_SIZE 9
|
|
#define MCRA_ILVE 0x00000100 /* interleave wr enab */
|
|
#define MCRA_TYPE 0x000000F8 /* type */
|
|
#define MCRA_C_TYPE 0x00000010 /* 16k uninterleaved */
|
|
#define MCRA_E_TYPE 0x0000006A /* 256k upper + lower */
|
|
#define MCRA_ILV 0x00000007 /* interleave */
|
|
#define MCRA_RD (0x00107FFF|SBI_FAULTS)
|
|
#define MCRA_WR 0x00000100
|
|
|
|
/* Memory controller register B */
|
|
|
|
#define MCRB_OF 0x1
|
|
#define MCRB_FP 0xF0000000 /* file pointers */
|
|
#define MCRB_V_SA 15 /* start addr */
|
|
#define MCRB_M_SA 0x1FFF
|
|
#define MCRB_SA (MCRB_M_SA << MCRB_V_SA)
|
|
#define MCRB_SAE 0x00004000 /* start addr wr enab */
|
|
#define MCRB_INIT 0x00003000 /* init state */
|
|
#define MCRB_REF 0x00000400 /* refresh */
|
|
#define MCRB_ECC 0x000003FF /* ECC for diags */
|
|
#define MCRB_RD 0xFFFFF7FF
|
|
#define MCRB_WR 0x000043FF
|
|
|
|
/* Memory controller register C,D */
|
|
|
|
#define MCRC_OF 0x2
|
|
#define MCRD_OF 0x3
|
|
#define MCRC_DCRD 0x40000000 /* disable CRD */
|
|
#define MCRC_HER 0x20000000 /* high error rate */
|
|
#define MCRC_ERL 0x10000000 /* log error */
|
|
#define MCRC_C_ER 0x0FFFFFFF /* MS780C error */
|
|
#define MCRC_E_PE1 0x00080000 /* MS780E par ctl 1 */
|
|
#define MCRC_E_PE0 0x00040000 /* MS780E par ctl 0 */
|
|
#define MCRC_E_CRD 0x00000200 /* MS780E CRD */
|
|
#define MCRC_E_PEW 0x00000100 /* MS780E par err wr */
|
|
#define MCRC_E_USEQ 0x00000080 /* MS780E seq err */
|
|
#define MCRC_C_RD 0x7FFFFFFF
|
|
#define MCRC_E_RD 0x700C0380
|
|
#define MCRC_WR 0x40000000
|
|
#define MCRC_C_W1C 0x30000000
|
|
#define MCRC_E_W1C 0x300C0380
|
|
|
|
#define MCRROM_OF 0x400
|
|
|
|
uint32 mcr_a[MCTL_NUM];
|
|
uint32 mcr_b[MCTL_NUM];
|
|
uint32 mcr_c[MCTL_NUM];
|
|
uint32 mcr_d[MCTL_NUM];
|
|
uint32 rom_lw[MCTL_NUM][ROMSIZE >> 2];
|
|
|
|
extern UNIT cpu_unit;
|
|
|
|
t_stat mctl_reset (DEVICE *dptr);
|
|
t_stat mctl_rdreg (int32 *val, int32 pa, int32 mode);
|
|
t_stat mctl_wrreg (int32 val, int32 pa, int32 mode);
|
|
|
|
/* MCTLx data structures
|
|
|
|
mctlx_dev MCTLx device descriptor
|
|
mctlx_unit MCTLx unit
|
|
mctlx_reg MCTLx register list
|
|
*/
|
|
|
|
DIB mctl0_dib[] = { TR_MCTL0, 0, &mctl_rdreg, &mctl_wrreg, 0 };
|
|
|
|
UNIT mctl0_unit = { UDATA (NULL, 0, 0) };
|
|
|
|
REG mctl0_reg[] = {
|
|
{ HRDATA (CRA, mcr_a[0], 32) },
|
|
{ HRDATA (CRB, mcr_b[0], 32) },
|
|
{ HRDATA (CRC, mcr_c[0], 32) },
|
|
{ HRDATA (CRD, mcr_d[0], 32) },
|
|
{ BRDATA (ROM, rom_lw[0], 16, 32, ROMSIZE >> 2) },
|
|
{ NULL }
|
|
};
|
|
|
|
MTAB mctl0_mod[] = {
|
|
{ MTAB_XTD|MTAB_VDV, TR_MCTL0, "NEXUS", NULL,
|
|
NULL, &show_nexus },
|
|
{ 0 }
|
|
};
|
|
|
|
DIB mctl1_dib[] = { TR_MCTL1, 0, &mctl_rdreg, &mctl_wrreg, 0 };
|
|
|
|
UNIT mctl1_unit = { UDATA (NULL, 0, 0) };
|
|
|
|
MTAB mctl1_mod[] = {
|
|
{ MTAB_XTD|MTAB_VDV, TR_MCTL1, "NEXUS", NULL,
|
|
NULL, &show_nexus },
|
|
{ 0 } };
|
|
|
|
REG mctl1_reg[] = {
|
|
{ HRDATA (CRA, mcr_a[1], 32) },
|
|
{ HRDATA (CRB, mcr_b[1], 32) },
|
|
{ HRDATA (CRC, mcr_c[1], 32) },
|
|
{ HRDATA (CRD, mcr_d[1], 32) },
|
|
{ BRDATA (ROM, rom_lw[1], 16, 32, ROMSIZE >> 2) },
|
|
{ NULL }
|
|
};
|
|
|
|
DEVICE mctl_dev[] = {
|
|
{
|
|
"MCTL0", &mctl0_unit, mctl0_reg, mctl0_mod,
|
|
1, 16, 16, 1, 16, 8,
|
|
NULL, NULL, &mctl_reset,
|
|
NULL, NULL, NULL,
|
|
&mctl0_dib, DEV_NEXUS
|
|
},
|
|
{
|
|
"MCTL1", &mctl1_unit, mctl1_reg, mctl1_mod,
|
|
1, 16, 16, 1, 16, 8,
|
|
NULL, NULL, &mctl_reset,
|
|
NULL, NULL, NULL,
|
|
&mctl1_dib, DEV_NEXUS
|
|
}
|
|
};
|
|
|
|
/* Memory controller register read */
|
|
|
|
t_stat mctl_rdreg (int32 *val, int32 pa, int32 lnt)
|
|
{
|
|
int32 mctl, ofs;
|
|
t_bool extmem = MEMSIZE > MAXMEMSIZE;
|
|
|
|
if ((pa & 3) || (lnt != L_LONG)) { /* unaligned or not lw? */
|
|
printf (">>MCTL: invalid adapter read mask, pa = %X, lnt = %d\r\n", pa, lnt);
|
|
sbi_set_errcnf (); /* err confirmation */
|
|
return SCPE_OK;
|
|
}
|
|
mctl = NEXUS_GETNEX (pa) - TR_MCTL0; /* get mctl num */
|
|
ofs = NEXUS_GETOFS (pa); /* get offset */
|
|
if (ofs >= MCRROM_OF) { /* ROM? */
|
|
*val = rom_lw[mctl][ofs - MCRROM_OF]; /* get lw */
|
|
return SCPE_OK;
|
|
}
|
|
switch (ofs) {
|
|
|
|
case MCRA_OF: /* CR A */
|
|
*val = mcr_a[mctl] & MCRA_RD;
|
|
break;
|
|
|
|
case MCRB_OF: /* CR B */
|
|
*val = (mcr_b[mctl] & MCRB_RD) | MCRB_INIT;
|
|
break;
|
|
|
|
case MCRC_OF: /* CR C */
|
|
*val = mcr_c[mctl] & (extmem? MCRC_E_RD: MCRC_C_RD);
|
|
break;
|
|
|
|
case MCRD_OF: /* CR D */
|
|
if (!extmem) return SCPE_NXM; /* MS780E only */
|
|
*val = mcr_d[mctl] & MCRC_E_RD;
|
|
break;
|
|
|
|
default:
|
|
return SCPE_NXM;
|
|
}
|
|
|
|
return SCPE_OK;
|
|
}
|
|
|
|
/* Memory controller register write */
|
|
|
|
t_stat mctl_wrreg (int32 val, int32 pa, int32 lnt)
|
|
{
|
|
int32 mctl, ofs, mask;
|
|
t_bool extmem = MEMSIZE > MAXMEMSIZE;
|
|
|
|
if ((pa & 3) || (lnt != L_LONG)) { /* unaligned or not lw? */
|
|
printf (">>MCTL: invalid adapter write mask, pa = %X, lnt = %d\r\n", pa, lnt);
|
|
sbi_set_errcnf (); /* err confirmation */
|
|
return SCPE_OK;
|
|
}
|
|
mctl = NEXUS_GETNEX (pa) - TR_MCTL0; /* get mctl num */
|
|
ofs = NEXUS_GETOFS (pa); /* get offset */
|
|
switch (ofs) {
|
|
|
|
case MCRA_OF: /* CR A */
|
|
mask = MCRA_WR | ((val & MCRA_ILVE)? MCRA_ILV: 0);
|
|
mcr_a[mctl] = (mcr_a[mctl] & ~mask) | (val & mask);
|
|
break;
|
|
|
|
case MCRB_OF: /* CR B */
|
|
mask = MCRB_WR | ((val & MCRB_SAE)? MCRB_SA: 0);
|
|
mcr_b[mctl] = (mcr_b[mctl] & ~mask) | (val & mask);
|
|
break;
|
|
|
|
case MCRC_OF: /* CR C */
|
|
mcr_c[mctl] = ((mcr_c[mctl] & ~MCRC_WR) | (val & MCRC_WR)) &
|
|
~(val & (extmem? MCRC_E_W1C: MCRC_C_W1C));
|
|
break;
|
|
|
|
case MCRD_OF: /* CR D */
|
|
if (!extmem) return SCPE_NXM; /* MS780E only */
|
|
mcr_d[mctl] = ((mcr_d[mctl] & ~MCRC_WR) | (val & MCRC_WR)) &
|
|
~(val & MCRC_E_W1C);
|
|
break;
|
|
|
|
default:
|
|
return SCPE_NXM;
|
|
}
|
|
|
|
return SCPE_OK;
|
|
}
|
|
|
|
/* Used by CPU and loader */
|
|
|
|
void rom_wr_B (int32 pa, int32 val)
|
|
{
|
|
uint32 mctl = NEXUS_GETNEX (pa) - TR_MCTL0; /* get mctl num */
|
|
uint32 ofs = NEXUS_GETOFS (pa) - MCRROM_OF; /* get offset */
|
|
int32 sc = (pa & 3) << 3;
|
|
|
|
rom_lw[mctl][ofs] = ((val & 0xFF) << sc) | (rom_lw[mctl][ofs] & ~(0xFF << sc));
|
|
return;
|
|
}
|
|
|
|
/* MEMCTL reset */
|
|
|
|
t_stat mctl_reset (DEVICE *dptr)
|
|
{
|
|
int32 i, amb;
|
|
t_bool extmem = MEMSIZE > MAXMEMSIZE;
|
|
|
|
amb = (int32) (MEMSIZE / 2) >> 20; /* array size MB */
|
|
for (i = 0; i < MCTL_NUM; i++) { /* init for MS780C */
|
|
if (extmem) { /* extended memory? */
|
|
mcr_a[i] = ((amb - 1) << MCRA_V_SIZE) | MCRA_E_TYPE;
|
|
mcr_b[i] = MCRB_INIT | ((i * amb) << (MCRB_V_SA + 4));
|
|
}
|
|
else {
|
|
mcr_a[i] = MCRA_C_SIZE | MCRA_C_TYPE;
|
|
mcr_b[i] = MCRB_INIT | (i << 21);
|
|
}
|
|
mcr_c[i] = 0;
|
|
mcr_d[i] = 0;
|
|
}
|
|
return SCPE_OK;
|
|
}
|