PDP11: Add initial UC15 support from Bob Supnik

Include files I (Mark Pizzolato) missed in prior commit
This commit is contained in:
Paul Koning 2017-02-04 13:43:40 -08:00 committed by Mark Pizzolato
parent 998cf5c122
commit 5dc6d9a487
9 changed files with 83 additions and 68 deletions

View file

@ -1,6 +1,6 @@
/* pdp11_cpumod.c: PDP-11 CPU model-specific features
Copyright (c) 2004-2013, Robert M Supnik
Copyright (c) 2004-2016, 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"),
@ -25,6 +25,8 @@
system PDP-11 model-specific registers
04-Mar-16 RMS Fixed maximum memory sizes to exclude IO page
14-Mar-16 RMS Modified to keep cpu_memsize in sync with MEMSIZE
06-Jun-13 RMS Fixed change model to set memory size last
20-May-08 RMS Added JCSR default for KDJ11B, KDJ11E
22-Apr-08 RMS Fixed write behavior of 11/70 MBRK, LOSIZE, HISIZE
@ -85,10 +87,7 @@ static int32 clk_tps_map[4] = { 60, 60, 50, 800 };
extern uint16 *M;
extern int32 R[8];
extern DEVICE cpu_dev;
extern UNIT cpu_unit;
extern int32 STKLIM, PIRQ;
extern uint32 cpu_model, cpu_type, cpu_opt;
extern int32 clk_fie, clk_fnxm, clk_tps, clk_default;
t_stat CPU24_rd (int32 *data, int32 addr, int32 access);
@ -1149,9 +1148,11 @@ uint32 i, clim;
uint16 *nM;
if ((val <= 0) ||
(val > (int32) cpu_tab[cpu_model].maxm) ||
(val > ((int32) cpu_tab[cpu_model].maxm)) ||
((val & 07777) != 0))
return SCPE_ARG;
if (val > ((int32) (cpu_tab[cpu_model].maxm - IOPAGESIZE)))
val = (int32) (cpu_tab[cpu_model].maxm - IOPAGESIZE);
for (i = val; i < MEMSIZE; i = i + 2)
mc = mc | M[i >> 1];
if ((mc != 0) && !get_yn ("Really truncate memory [N]?", FALSE))

View file

@ -180,7 +180,13 @@
#define CPUT(x) ((cpu_type & (x)) != 0)
#define CPUO(x) ((cpu_opt & (x)) != 0)
#define UNIBUS (cpu_opt & BUS_U)
extern uint32 cpu_model, cpu_type, cpu_opt;
extern int32 cpu_bme; /* bus map enable */
extern uint32 cpu_model; /* CPU model */
extern uint32 cpu_type; /* model as bit mask */
extern uint32 cpu_opt; /* CPU options */
extern DEVICE cpu_dev;
extern UNIT cpu_unit;
/* Feature sets

View file

@ -54,14 +54,8 @@
extern uint16 *M;
extern int32 int_req[IPL_HLVL];
extern int32 ub_map[UBM_LNT_LW];
extern uint32 cpu_opt;
extern int32 cpu_bme;
extern int32 trap_req, ipl;
extern int32 cpu_log;
extern int32 autcon_enb;
extern int32 uba_last;
extern DEVICE cpu_dev;
extern t_addr cpu_memsize;
int32 calc_ints (int32 nipl, int32 trq);
@ -264,9 +258,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
if (ma & 1) /* get byte */
*buf++ = (M[ma >> 1] >> 8) & 0377;
else *buf++ = M[ma >> 1] & 0377;
*buf++ = (uint8) RdMemB (ma); /* get byte */
}
return 0;
}
@ -274,12 +266,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba++) { /* by bytes */
if (ba & 1)
*buf++ = (M[ba >> 1] >> 8) & 0377; /* get byte */
else *buf++ = M[ba >> 1] & 0377;
*buf++ = (uint8) RdMemB (ba); /* get byte */
}
return (lim - alim);
}
@ -309,7 +299,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
*buf++ = M[ma >> 1];
*buf++ = (uint16) RdMemW (ma);
}
return 0;
}
@ -317,10 +307,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba = ba + 2) { /* by words */
*buf++ = M[ba >> 1];
*buf++ = (uint16) RdMemW (ba);
}
return (lim - alim);
}
@ -346,9 +336,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
if (ma & 1) M[ma >> 1] = (M[ma >> 1] & 0377) |
((uint16) *buf++ << 8);
else M[ma >> 1] = (M[ma >> 1] & ~0377) | *buf++;
WrMemB (ma, ((uint16) *buf++));
}
return 0;
}
@ -356,12 +344,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba++) { /* by bytes */
if (ba & 1)
M[ba >> 1] = (M[ba >> 1] & 0377) | ((uint16) *buf++ << 8);
else M[ba >> 1] = (M[ba >> 1] & ~0377) | *buf++;
WrMemB (ba, ((uint16) *buf++));
}
return (lim - alim);
}
@ -389,7 +375,7 @@ if (cpu_bme) { /* map enabled? */
ma = Map_Addr (ba); /* map addr */
if (!ADDR_IS_MEM (ma)) /* NXM? err */
return (lim - ba);
M[ma >> 1] = *buf++;
WrMemW (ma, *buf++);
}
return 0;
}
@ -397,10 +383,10 @@ else { /* physical */
if (ADDR_IS_MEM (lim)) /* end ok? */
alim = lim;
else if (ADDR_IS_MEM (ba)) /* no, strt ok? */
alim = cpu_memsize;
alim = MEMSIZE;
else return bc; /* no, err */
for ( ; ba < alim; ba = ba + 2) { /* by words */
M[ba >> 1] = *buf++;
WrMemW (ba, *buf++);
}
return (lim - alim);
}

View file

@ -823,7 +823,6 @@ t_stat auto_config (const char *name, int32 nctrl)
uint32 csr = IOPAGEBASE + AUTO_CSRBASE;
uint32 vec = AUTO_VECBASE;
int32 ilvl, ibit, numc;
extern UNIT cpu_unit;
AUTO_CON *autp;
DEVICE *dptr;
DIB *dibp;

View file

@ -160,11 +160,8 @@ typedef struct {
MBACTX massbus[MBA_NUM];
extern uint32 cpu_opt;
extern int32 cpu_bme;
extern uint16 *M;
extern int32 int_req[IPL_HLVL];
extern t_addr cpu_memsize;
t_stat mba_reset (DEVICE *dptr);
t_stat mba_rd (int32 *val, int32 pa, int32 access);

View file

@ -1,6 +1,6 @@
/* pdp11_rk.c: RK11/RKV11 cartridge disk simulator
Copyright (c) 1993-2009, Robert M Supnik
Copyright (c) 1993-2016, 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"),
@ -25,6 +25,7 @@
rk RK11/RKV11/RK05 cartridge disk
12-Mar-16 RMS Revised to support UC15 (18b IO)
23-Oct-13 RMS Revised for new boot setup routine
20-Mar-09 RMS Fixed bug in read header (Walter F Mueller)
16-Aug-05 RMS Fixed C++ declaration and cast problems
@ -80,6 +81,22 @@ extern int32 int_req[IPL_HLVL];
/* Constants */
#if defined (UC15)
#define RKCONTR uint32 /* container format */
#define RKWRDSZ 18 /* word width */
#define MAP_RDW(a,b,c) Map_Read18 (a, b, c)
#define MAP_WRW(a,b,c) Map_Write18 (a, b, c)
#else
#define RKCONTR uint16
#define RKWRDSZ 16
#define MAP_RDW(a,b,c) Map_ReadW (a, b, c)
#define MAP_WRW(a,b,c) Map_WriteW (a, b, c)
#endif
#define RK_NUMWD 256 /* words/sector */
#define RK_NUMSC 12 /* sectors/surface */
#define RK_NUMSF 2 /* surfaces/cylinder */
@ -276,7 +293,9 @@ BITFIELD *rk_reg_bits[] = {
#define RK_MIN 10
#define MAX(x,y) (((x) > (y))? (x): (y))
uint16 *rkxb = NULL; /* xfer buffer */
extern int32 int_req[IPL_HLVL];
RKCONTR *rkxb = NULL; /* xfer buffer */
int32 rkcs = 0; /* control/status */
int32 rkds = 0; /* drive status */
int32 rkba = 0; /* memory address */
@ -399,7 +418,7 @@ MTAB rk_mod[] = {
DEVICE rk_dev = {
"RK", rk_unit, rk_reg, rk_mod,
RK_NUMDR, 8, 24, 1, 8, 16,
RK_NUMDR, 8, 24, 1, 8, RKWRDSZ,
NULL, NULL, &rk_reset,
&rk_boot, NULL, NULL,
&rk_dib, DEV_DISABLE | DEV_UBUS | DEV_Q18 | DEV_DEBUG | RK_DIS, 0,
@ -629,7 +648,7 @@ t_stat rk_svc (UNIT *uptr)
int32 i, drv, err, awc, wc, cma, cda, t;
int32 da, cyl, track, sect;
uint32 ma;
uint16 comp;
RKCONTR comp;
drv = (int32) (uptr - rk_dev.units); /* get drv number */
if (uptr->FUNC == RKCS_SEEK) { /* seek */
@ -671,7 +690,7 @@ if ((da + wc) > (int32) uptr->capac) { /* overrun? */
rker = rker | RKER_OVR; /* set overrun err */
}
err = fseek (uptr->fileref, da * sizeof (int16), SEEK_SET);
err = fseek (uptr->fileref, da * sizeof (RKCONTR), SEEK_SET);
if (wc && (err == 0)) { /* seek ok? */
switch (uptr->FUNC) { /* case on function */
@ -688,19 +707,19 @@ if (wc && (err == 0)) { /* seek ok? */
} /* end for wc */
} /* end if format */
else { /* normal read */
i = fxread (rkxb, sizeof (int16), wc, uptr->fileref);
i = fxread (rkxb, sizeof (RKCONTR), wc, uptr->fileref);
err = ferror (uptr->fileref); /* read file */
for ( ; i < wc; i++) /* fill buf */
rkxb[i] = 0;
}
if (rkcs & RKCS_INH) { /* incr inhibit? */
if ((t = Map_WriteW (ma, 2, &rkxb[wc - 1]))) {/* store last */
if ((t = MAP_WRW (ma, 2, &rkxb[wc - 1]))) { /* store last */
rker = rker | RKER_NXM; /* NXM? set flag */
wc = 0; /* no transfer */
}
}
else { /* normal store */
if ((t = Map_WriteW (ma, wc << 1, rkxb))) { /* store buf */
if ((t = MAP_WRW (ma, wc << 1, rkxb))) { /* store buf */
rker = rker | RKER_NXM; /* NXM? set flag */
wc = wc - t; /* adj wd cnt */
}
@ -709,7 +728,7 @@ if (wc && (err == 0)) { /* seek ok? */
case RKCS_WRITE: /* write */
if (rkcs & RKCS_INH) { /* incr inhibit? */
if ((t = Map_ReadW (ma, 2, &comp))) { /* get 1st word */
if ((t = MAP_RDW (ma, 2, &comp))) { /* get 1st word */
rker = rker | RKER_NXM; /* NXM? set flag */
wc = 0; /* no transfer */
}
@ -717,7 +736,7 @@ if (wc && (err == 0)) { /* seek ok? */
rkxb[i] = comp;
}
else { /* normal fetch */
if ((t = Map_ReadW (ma, wc << 1, rkxb))) { /* get buf */
if ((t = MAP_RDW (ma, wc << 1, rkxb))) { /* get buf */
rker = rker | RKER_NXM; /* NXM? set flg */
wc = wc - t; /* adj wd cnt */
}
@ -726,13 +745,13 @@ if (wc && (err == 0)) { /* seek ok? */
awc = (wc + (RK_NUMWD - 1)) & ~(RK_NUMWD - 1); /* clr to */
for (i = wc; i < awc; i++) /* end of blk */
rkxb[i] = 0;
fxwrite (rkxb, sizeof (int16), awc, uptr->fileref);
fxwrite (rkxb, sizeof (RKCONTR), awc, uptr->fileref);
err = ferror (uptr->fileref);
}
break; /* end write */
case RKCS_WCHK: /* write check */
i = fxread (rkxb, sizeof (int16), wc, uptr->fileref);
i = fxread (rkxb, sizeof (RKCONTR), wc, uptr->fileref);
if ((err = ferror (uptr->fileref))) { /* read error? */
wc = 0; /* no transfer */
break;
@ -741,7 +760,7 @@ if (wc && (err == 0)) { /* seek ok? */
rkxb[i] = 0;
awc = wc; /* save wc */
for (wc = 0, cma = ma; wc < awc; wc++) { /* loop thru buf */
if (Map_ReadW (cma, 2, &comp)) { /* mem wd */
if (MAP_RDW (cma, 2, &comp)) { /* mem wd */
rker = rker | RKER_NXM; /* NXM? set flg */
break;
}
@ -860,7 +879,7 @@ for (i = 0; i < RK_NUMDR; i++) {
uptr->flags = uptr->flags & ~UNIT_SWLK;
}
if (rkxb == NULL)
rkxb = (uint16 *) calloc (RK_MAXFR, sizeof (uint16));
rkxb = (RKCONTR *) calloc (RK_MAXFR, sizeof (RKCONTR));
if (rkxb == NULL)
return SCPE_MEM;
return auto_config (0, 0);
@ -868,7 +887,14 @@ return auto_config (0, 0);
/* Device bootstrap */
#if defined (VM_PDP11)
#if defined (UC15) || !defined (VM_PDP11)
t_stat rk_boot (int32 unitno, DEVICE *dptr)
{
return SCPE_NOFNC;
}
#else
#define BOOT_START 02000 /* start */
#define BOOT_ENTRY (BOOT_START + 002) /* entry */
@ -915,13 +941,6 @@ cpu_set_boot (BOOT_ENTRY);
return SCPE_OK;
}
#else
t_stat rk_boot (int32 unitno, DEVICE *dptr)
{
return SCPE_NOFNC;
}
#endif
t_stat rk_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)

View file

@ -95,8 +95,6 @@
#else /* PDP-11 version */
#include "pdp11_defs.h"
extern uint32 cpu_opt;
extern UNIT cpu_unit;
#endif
/* Constants */

View file

@ -1,6 +1,6 @@
/* pdp11_sys.c: PDP-11 simulator interface
Copyright (c) 1993-2013, Robert M Supnik
Copyright (c) 1993-2016, 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"),
@ -23,6 +23,7 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
14-Mar-16 RMS Added UC15 support
02-Sep-13 RMS Added third Massbus, RS03/RS04
29-Apr-12 RMS Fixed compiler warning (Mark Pizzolato)
19-Nov-08 RMS Moved I/O support routines to I/O library
@ -113,7 +114,7 @@ extern DEVICE dmc_dev;
extern DEVICE dup_dev;
extern DEVICE dpv_dev;
extern DEVICE kmc_dev;
extern UNIT cpu_unit;
extern DEVICE uca_dev, ucb_dev;
extern REG cpu_reg[];
extern uint16 *M;
extern int32 saved_PC;
@ -137,6 +138,7 @@ int32 sim_emax = 4;
DEVICE *sim_devices[] = {
&cpu_dev,
&sys_dev,
#if !defined (UC15)
&mba_dev[0],
&mba_dev[1],
&mba_dev[2],
@ -181,12 +183,22 @@ DEVICE *sim_devices[] = {
&xqb_dev,
&xu_dev,
&xub_dev,
&ke_dev,
&kg_dev,
&dmc_dev,
&dup_dev,
&dpv_dev,
&kmc_dev,
&ke_dev,
#else
&clk_dev,
&tti_dev,
&tto_dev,
&cr_dev,
&lpt_dev,
&rk_dev,
&uca_dev,
&ucb_dev,
#endif
NULL
};
@ -268,11 +280,9 @@ do { /* block loop */
if ((d = Fgetc (fileref)) == EOF) /* data char */
return SCPE_FMT;
csum = csum + d; /* add into csum */
if (org >= MEMSIZE) /* invalid addr? */
if (!ADDR_IS_MEM (org)) /* invalid addr? */
return SCPE_NXM;
M[org >> 1] = (org & 1)? /* store data */
(M[org >> 1] & 0377) | (uint16)(d << 8):
(M[org >> 1] & 0177400) | (uint16)d;
WrMemB (org, ((uint16) d));
org = (org + 1) & 0177777; /* inc origin */
}
if ((d = Fgetc (fileref)) == EOF) /* get csum */

View file

@ -269,7 +269,6 @@ extern uint32 cpu_opt;
#define MAX_PLNT 8 /* max pkt length */
extern int32 int_req[IPL_HLVL];
extern UNIT cpu_unit;
uint8 *tsxb = NULL; /* xfer buffer */
int32 tssr = 0; /* status register */