diff --git a/PDP11/pdp11_cpu.c b/PDP11/pdp11_cpu.c index ec32c415..08de0f5e 100644 --- a/PDP11/pdp11_cpu.c +++ b/PDP11/pdp11_cpu.c @@ -650,12 +650,8 @@ MTAB cpu_mod[] = { { MTAB_XTD|MTAB_VDV, 0, NULL, "NOAUTOCONFIG", &set_autocon, NULL }, #else - { MTAB_XTD|MTAB_VDV, MOD_1104, NULL, "11/04", &cpu_set_model }, - { MTAB_XTD|MTAB_VDV, MOD_1105, NULL, "11/05", &cpu_set_model }, - { MTAB_XTD|MTAB_VDV, MOD_1120, NULL, "11/20", &cpu_set_model }, { UNIT_MSIZE, 16384, NULL, "16K", &cpu_set_size}, { UNIT_MSIZE, 24576, NULL, "24K", &cpu_set_size}, - { UNIT_MSIZE, 32768, NULL, "32K", &cpu_set_size}, #endif { MTAB_XTD|MTAB_VDV|MTAB_NMO, 0, "IOSPACE", NULL, NULL, &show_iospace }, diff --git a/PDP11/pdp11_sys.c b/PDP11/pdp11_sys.c index 36ec9abb..66c31b05 100644 --- a/PDP11/pdp11_sys.c +++ b/PDP11/pdp11_sys.c @@ -1,6 +1,6 @@ /* pdp11_sys.c: PDP-11 simulator interface - Copyright (c) 1993-2016, Robert M Supnik + Copyright (c) 1993-2018, 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. + 23-May-18 RMS Changed UC15 simulator name 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) @@ -128,7 +129,11 @@ extern int32 saved_PC; sim_load binary loader */ +#if !defined (UC15) char sim_name[] = "PDP-11"; +#else +char sim_name[] = "UC-15"; +#endif REG *sim_PC = &cpu_reg[0]; diff --git a/PDP11/pdp11_uc15.c b/PDP11/pdp11_uc15.c new file mode 100644 index 00000000..725bc072 --- /dev/null +++ b/PDP11/pdp11_uc15.c @@ -0,0 +1,542 @@ +/* pdp11_uc15.c: UC15 interface simulator + + Copyright (c) 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"), + 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. + + uca DR11 #1 + ucb DR11 #2 + + The DR11Cs provide control communications with the DR15C in the PDP15. + + The PDP15 and UC15 use a master/slave communications protocol. + - The PDP15 initiates a request to the PDP11 by writing TCBP and + clearing TCBP acknowledge. This alerts/interrupts the PDP11. + - The PDP11 reads TCBP. This sets TCBP acknowledge, which is + not wired to interrupt on the PDP15. Note that TCBP has been + converted from a word address to a byte address by the way + the two systems are wired together. + - The PDP11 processes the request. + - The PDP11 signals completion by writing a vector into one of + four API request levels. + - The PDP15 is interrupted, and the request is considered complete. + + The UC15 must "call out" to the PDP15 to signal two conditions: + - the TCB pointer has been read + - an API interrupt is requested + + The DR15 must "call in" to the UC15 for two reasons: + - the TCBP has been written + - API interrupt status has changed + + The DR15 and UC15 use a shared memory section and ATOMIC operations + to communicate. Shared state is maintained in shared memory, with one + side having read/write access, the other read-only. Actions are + implemented by setting signals with an atomic compare-and-swap. + The signals may be polled with non-atomic operations but must be + verified with an atomic compare-and-swap. +*/ + +#include "pdp11_defs.h" + +#include "sim_fio.h" +#include "uc15_defs.h" + +/* Constants */ + +/* DR11 #1 */ + +#define UCAC_APID (CSR_DONE) +#define UCAB_V_TCBHI 0 +#define UCAB_M_TCBHI 03 +#define UCAB_API2 0000100 +#define UCAB_API0 0000200 +#define UCAB_V_LOCAL 8 +#define UCAB_M_LOCAL 07 +#define UCAB_API3 0040000 +#define UCAB_API1 0100000 + +/* DR11 #2 */ + +#define UCBC_NTCB (CSR_DONE) + +/* Declarations */ + +extern int32 int_req[IPL_HLVL]; +extern UNIT cpu_unit; +extern uint16 *M; + +int32 uca_csr = 0; /* DR11C #1 CSR */ +int32 uca_buf = 0; /* DR11C #1 input buffer */ +int32 ucb_csr = 0; +int32 ucb_buf = 0; +int32 uc15_poll = 3; /* polling interval */ +SHMEM *uc15_shmem = NULL; /* shared state identifier */ +int32 *uc15_shstate = NULL; /* shared state base */ +SHMEM *pdp15_shmem = NULL; /* PDP15 mem identifier */ +int32 *pdp15_mem = NULL; +uint32 uc15_memsize = 0; + +t_stat uca_rd (int32 *data, int32 PA, int32 access); +t_stat uca_wr (int32 data, int32 PA, int32 access); +t_stat ucb_rd (int32 *data, int32 PA, int32 access); +t_stat ucb_wr (int32 data, int32 PA, int32 access); +t_stat uc15_reset (DEVICE *dptr); +t_stat uc15_svc (UNIT *uptr); +t_stat uc15_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw); +t_stat uc15_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw); +t_stat uc15_attach (UNIT *uptr, CONST char *cptr); +t_stat uc15_detach (UNIT *uptr); + +void uc15_set_memsize (void); +int32 uc15_get_uca_buf (void); +t_stat uc15_api_req (int32 lvl, int32 vec); + +/* UC15 data structures + + uca_dev, ucb_dev UC15 device descriptor + uca_unit, ucb_unit UC15 unit descriptor + uca_reg, ucb reg UC15 register list + + The two DR11Cs must be separate devices because they interrupt at + different IPLs and must have different DIBs! +*/ + +DIB uca_dib = { + IOBA_UCA, IOLN_UCA, &uca_rd, &uca_wr, + 1, IVCL (UCA), VEC_UCA, { NULL } + }; + +UNIT uca_unit = { UDATA (&uc15_svc, 0, UNIT_ATTABLE) }; + +REG uca_reg[] = { + { ORDATA (CSR, uca_csr, 16) }, + { ORDATA (BUF, uca_buf, 16) }, + { FLDATA (APID, uca_csr, CSR_V_DONE) }, + { FLDATA (IE, uca_csr, CSR_V_IE) }, + { DRDATA (POLL, uc15_poll, 10), REG_NZ }, + { DRDATA (UCMEMSIZE, uc15_memsize, 18), REG_HRO }, + { NULL } + }; + +MTAB uc15_mod[] = { + { MTAB_XTD|MTAB_VDV, 006, "ADDRESS", "ADDRESS", + NULL, &show_addr, NULL }, + { MTAB_XTD|MTAB_VDV, 0, "VECTOR", "VECTOR", + NULL, &show_vec, NULL }, + { 0 } + }; + +DEVICE uca_dev = { + "UCA", &uca_unit, uca_reg, uc15_mod, + 1, 8, 10, 1, 8, 32, + &uc15_ex, &uc15_dep, &uc15_reset, + NULL, &uc15_attach, &uc15_detach, + &uca_dib, DEV_DISABLE | DEV_DEBUG + }; + +DIB ucb_dib = { + IOBA_UCB, IOLN_UCB, &ucb_rd, &ucb_wr, + 1, IVCL (UCB), VEC_UCB, { NULL } + }; + +UNIT ucb_unit = { UDATA (NULL, 0, 0) }; + +REG ucb_reg[] = { + { ORDATA (CSR, ucb_csr, 16) }, + { ORDATA (BUF, ucb_buf, 16) }, + { FLDATA (NTCB, ucb_csr, CSR_V_DONE) }, + { FLDATA (IE, ucb_csr, CSR_V_IE) }, + { NULL } + }; + +DEVICE ucb_dev = { + "UCB", &ucb_unit, ucb_reg, uc15_mod, + 1, 8, 18, 1, 8, 18, + NULL, NULL, NULL, + NULL, NULL, NULL, + &ucb_dib, DEV_DISABLE + }; + +/* IO routines */ + +/* DR11 #1 */ + +t_stat uca_rd (int32 *data, int32 PA, int32 access) +{ +switch ((PA >> 1) & 03) { /* case on PA<2:1> */ + +case 0: /* CSR */ + *data = uca_csr; + return SCPE_OK; + +case 1: /* output buffers */ + return SCPE_OK; + +case 2: /* input buffer */ + *data = uc15_get_uca_buf (); /* assemble buffer */ + return SCPE_OK; + } + +return SCPE_NXM; +} + +t_stat uca_wr (int32 data, int32 PA, int32 access) +{ +switch ((PA >> 1) & 03) { /* case on PA<2:1> */ + +case 0: /* CSR */ + if (PA & 1) + return SCPE_OK; + if ((data & CSR_IE) == 0) + CLR_INT (UCA); + else if ((uca_csr & (UCAC_APID + CSR_IE)) == UCAC_APID) + SET_INT (UCA); + uca_csr = (uca_csr & ~CSR_IE) | (data & CSR_IE); + return SCPE_OK; + +case 1: /* output buffer */ + if (PA & 1) /* odd byte? API 1 */ + uc15_api_req (1, data & 0377); + else { + if (access == WRITE) /* full word? API 1 */ + uc15_api_req (1, (data >> 8) & 0377); + uc15_api_req (0, data & 0377); /* API 0 */ + } + return SCPE_OK; + +case 2: + return SCPE_OK; + } + +return SCPE_NXM; +} + +t_stat ucb_rd (int32 *data, int32 PA, int32 access) +{ +switch ((PA >> 1) & 03) { /* case on PA<2:1> */ + +case 0: /* CSR */ + *data = ucb_csr; + return SCPE_OK; + +case 1: /* output buffers */ + return SCPE_OK; + +case 2: /* input buffer */ + *data = ucb_buf = (UC15_SHARED_RD (UC15_TCBP) << 1) & 0177777; + ucb_csr &= ~UCBC_NTCB; /* clear TCBP rdy */ + CLR_INT (UCB); /* clear int */ + UC15_ATOMIC_CAS (UC15_TCBP_RD, 0, 1); /* send ACK */ + if (DEBUG_PRS (uca_dev)) { + uint32 apiv, apil, fnc, tsk, pa; + t_bool spl; + + pa = ucb_buf + MEMSIZE; + apiv = RdMemB (pa); + apil = RdMemB (pa + 1); + fnc = RdMemB (pa + 2); + spl = (RdMemB (pa + 3) & 0200) != 0; + tsk = RdMemB (pa + 3) & 0177; + fprintf (sim_deb, ">> UC15: TCB rcvd, API = %o/%d, fnc = %o, %s task = %o, eventvar = %o\n", + apiv, apil, fnc, spl? "Spooled": "Unspooled", tsk, RdMemW (pa + 4)); + fprintf (sim_deb, "Additional parameters = %o %o %o %o %o\n", + RdMemW (pa + 6), RdMemW (pa + 8), RdMemW (pa + 10), RdMemW (pa + 12), RdMemW (pa + 14)); + } + return SCPE_OK; + } + +return SCPE_NXM; +} + +t_stat ucb_wr (int32 data, int32 PA, int32 access) +{ +switch ((PA >> 1) & 03) { /* case on PA<2:1> */ + +case 0: /* CSR */ + if (PA & 1) + return SCPE_OK; + if ((data & CSR_IE) == 0) /* IE = 0? */ + CLR_INT (UCB); + else if ((ucb_csr & (UCBC_NTCB + CSR_IE)) == UCBC_NTCB) + SET_INT (UCB); + ucb_csr = (ucb_csr & ~CSR_IE) | (data & CSR_IE); + return SCPE_OK; + +case 1: /* output buffer */ + if (PA & 1) /* odd byte? API 3*/ + uc15_api_req (3, data & 0377); + else { + if (access == WRITE) /* full word? API 3 */ + uc15_api_req (3, (data >> 8) & 0377); + uc15_api_req (2, data & 0377); /* API 2 */ + } + return SCPE_OK; + +case 2: + return SCPE_OK; + } + +return SCPE_NXM; +} + +/* Request PDP15 to take an API interrupt */ + +t_stat uc15_api_req (int32 lvl, int32 vec) +{ +UC15_SHARED_WR (UC15_API_VEC + (lvl * UC15_API_VEC_MUL), vec); +UC15_ATOMIC_CAS (UC15_API_REQ + (lvl * UC15_API_VEC_MUL), 0, 1); +if (DEBUG_PRS (uca_dev)) + fprintf (sim_deb, ">>UC15: API request sent, API = %o/%d\n", + vec, lvl); +return SCPE_OK; +} + +/* Routine to poll for state changes from PDP15 */ + +t_stat uc15_svc (UNIT *uptr) +{ +uint32 t; + +t = UC15_SHARED_RD (UC15_TCBP_WR); /* TCBP written? */ +if ((t != 0) && UC15_ATOMIC_CAS (UC15_TCBP_WR, 1, 0)) { /* for real? */ + ucb_csr |= UCBC_NTCB; /* set new TCB flag */ + if (ucb_csr & CSR_IE) + SET_INT (UCB); + uc15_set_memsize (); /* update mem size */ + } +t = UC15_SHARED_RD (UC15_API_UPD); /* API update? */ +if ((t != 0) && UC15_ATOMIC_CAS (UC15_API_UPD, 1, 0)) { /* for real? */ + uc15_get_uca_buf (); /* update UCA buf */ + } +sim_activate (uptr, uc15_poll); /* next poll */ +return SCPE_OK; +} + +/* Routine to assemble/update uca_buf + + Note that the PDP-15 and PDP-11 have opposite interpretations of + API requests. On the PDP-15, a "1" indicates an active request. + On the PDP-11, a "1" indicates request done (API inactive). +*/ + +int32 uc15_get_uca_buf (void) +{ +int32 i, t; +static int32 ucab_api[4] = + { UCAB_API0, UCAB_API1, UCAB_API2, UCAB_API3 }; + +t = UC15_SHARED_RD (UC15_TCBP); /* get TCB ptr */ +uca_buf = (t >> 15) & UCAB_M_TCBHI; /* PDP15 bits<1:2> */ +t = cpu_unit.capac >> 13; /* local mem in 4KW */ +uca_buf |= ((t & UCAB_M_LOCAL) << UCAB_V_LOCAL); +t = UC15_SHARED_RD (UC15_API_SUMM); /* get API summary */ +for (i = 0; i < 4; i++) { /* check 0..3 */ + if (((t >> i) & 1) == 0) /* level inactive? */ + uca_buf |= ucab_api[i]; /* set status bit */ + } +if ((t == 0) && ((uca_csr & UCAC_APID) == 0)) { /* API req now 0? */ + uca_csr |= UCAC_APID; /* set flag */ + if ((uca_csr & CSR_IE) != 0) /* if ie, req int */ + SET_INT (UCA); + } +return uca_buf; +} + +/* Routine to set overall memory limit for UC15 checking */ + +void uc15_set_memsize (void) +{ +uint32 t = UC15_SHARED_RD (UC15_PDP15MEM); /* get PDP15 memory size */ +if (t == 0) /* PDP15 not running? */ + t = PDP15_MAXMEM * 2; /* max mem in bytes */ +uc15_memsize = t + MEMSIZE; /* shared + local mem */ +if (uc15_memsize > (UNIMEMSIZE - IOPAGESIZE)) /* more than 18b? */ + uc15_memsize = UNIMEMSIZE - IOPAGESIZE; /* limit */ +return; +} + +/* Reset routine + + Aside from performing a device reset, this routine sets up shared + UC15 state and shared PDP15 main memory. It also reads the size + of PDP15 main memory (in PDP11 bytes) from the shared state region. +*/ + +t_stat uc15_reset (DEVICE *dptr) +{ +t_stat r; +void *basead; + +uca_csr = 0; +uca_buf = 0; +ucb_csr = 0; +ucb_buf = 0; +CLR_INT (UCA); +CLR_INT (UCB); +if (uc15_shmem == NULL) { /* allocate shared state */ + r = sim_shmem_open ("UC15SharedState", UC15_STATE_SIZE, &uc15_shmem, &basead); + if (r != SCPE_OK) + return r; + uc15_shstate = (int32 *) basead; + } +if (pdp15_shmem == NULL) { /* allocate shared memory */ + r = sim_shmem_open ("PDP15MainMemory", PDP15_MAXMEM * sizeof (int32), &pdp15_shmem, &basead); + if (r != SCPE_OK) + return r; + pdp15_mem = (int32 *) basead; + } +uc15_set_memsize (); +sim_activate (dptr->units, uc15_poll); /* start polling */ +return SCPE_OK; +} + +/* Shared state ex/mod routines for debug */ + +t_stat uc15_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw) +{ +if (addr >= UC15_STATE_SIZE) + return SCPE_NXM; +if (vptr != NULL) + *vptr = UC15_SHARED_RD ((int32) addr); +return SCPE_OK; +} + +t_stat uc15_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw) +{ +if (addr >= UC15_STATE_SIZE) + return SCPE_NXM; +UC15_SHARED_WR ((int32) addr, (int32) val); +return SCPE_OK; +} + +/* Fake attach routine to kill attach attempts */ + +t_stat uc15_attach (UNIT *uptr, CONST char *cptr) +{ +return SCPE_NOFNC; +} + +/* Shutdown detach routine to release shared memories */ + +t_stat uc15_detach (UNIT *uptr) +{ +if ((sim_switches & SIM_SW_SHUT) == 0) /* only if shutdown */ + return SCPE_NOFNC; +sim_shmem_close (uc15_shmem); /* release shared state */ +sim_shmem_close (pdp15_shmem); /* release shared mem */ +return SCPE_OK; +} + +/* Physical read/write memory routines + Used by CPU and IO devices + Physical address is known to be legal + We can use MEMSIZE rather than cpu_memsize because configurations + were limited to 16KW of local memory + 8b and 16b writes clear the upper 2b of PDP-15 memory +*/ + +int32 uc15_RdMemW (int32 pa) +{ +if (((uint32) pa) < MEMSIZE) + return M[pa >> 1]; +else { + pa = pa - MEMSIZE; + return (pdp15_mem[pa >> 1] & DMASK); + } +} + +int32 uc15_RdMemB (int32 pa) +{ +if (((uint32) pa) < MEMSIZE) + return ((pa & 1)? (M[pa >> 1] >> 8): (M[pa >> 1] & 0377)); +else { + pa = pa - MEMSIZE; + return ((pa & 1)? (pdp15_mem[pa >> 1] >> 8): (pdp15_mem[pa >> 1] & 0377)); + } +} + +void uc15_WrMemW (int32 pa, int32 d) +{ +if (((uint32) pa) < MEMSIZE) + M[pa >> 1] = d; +else { + pa = pa - MEMSIZE; + pdp15_mem[pa >> 1] = d & DMASK; + } +return; +} + +void uc15_WrMemB (int32 pa, int32 d) +{ +if (((uint32) pa) < MEMSIZE) + M[pa >> 1] = (pa & 1)? + ((M[pa >> 1] & 0377) | ((d & 0377) << 8)): \ + ((M[pa >> 1] & ~0377) | (d & 0377)); +else { + pa = pa - MEMSIZE; + pdp15_mem[pa >> 1] = (pa & 1)? + ((pdp15_mem[pa >> 1] & 0377) | ((d & 0377) << 8)): \ + ((pdp15_mem[pa >> 1] & ~0377) | (d & 0377)); + } +return; +} + +/* 18b DMA routines - physical only */ + +int32 Map_Read18 (uint32 ba, int32 bc, uint32 *buf) +{ +uint32 alim, lim; + +ba = (ba & UNIMASK) & ~01; /* trim, align addr */ +lim = ba + (bc & ~01); +if (lim < uc15_memsize) /* end ok? */ + alim = lim; +else if (ba < uc15_memsize) /* no, strt ok? */ + alim = uc15_memsize; +else return bc; /* no, err */ +for ( ; ba < alim; ba = ba + 2) { /* by 18b words */ + if (ba < MEMSIZE) + *buf++ = M[ba >> 1]; + else *buf++ = pdp15_mem[(ba - MEMSIZE) >> 1] & 0777777; + } +return (lim - alim); +} + +int32 Map_Write18 (uint32 ba, int32 bc, uint32 *buf) +{ +uint32 alim, lim; + +ba = (ba & UNIMASK) & ~01; /* trim, align addr */ +lim = ba + (bc & ~01); +if (lim < uc15_memsize) /* end ok? */ + alim = lim; +else if (ba < uc15_memsize) /* no, strt ok? */ + alim = uc15_memsize; +else return bc; /* no, err */ +for ( ; ba < alim; ba = ba + 2) { /* by 18 bit words */ + if (ba < MEMSIZE) + M[ba >> 1] = *buf++ & DMASK; + else pdp15_mem[(ba - MEMSIZE) >> 1] = *buf++ & 0777777; + } +return (lim - alim); +} diff --git a/PDP18B/pdp18b_rf.c b/PDP18B/pdp18b_rf.c index 448ddc3f..33ece3d7 100644 --- a/PDP18B/pdp18b_rf.c +++ b/PDP18B/pdp18b_rf.c @@ -129,7 +129,7 @@ int32 rf72 (int32 dev, int32 pulse, int32 dat); int32 rf_iors (void); t_stat rf_svc (UNIT *uptr); t_stat rf_reset (DEVICE *dptr); -int32 rf_updsta (int32 news); +int32 rf_updsta (int32 newst); t_stat rf_attach (UNIT *uptr, CONST char *cptr); t_stat rf_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc); @@ -315,9 +315,9 @@ return SCPE_OK; /* Update status */ -int32 rf_updsta (int32 news) +int32 rf_updsta (int32 newst) { -rf_sta = (rf_sta | news) & ~(RFS_ERR | RFS_CLR); +rf_sta = (rf_sta | newst) & ~(RFS_ERR | RFS_CLR); if (rf_sta & RFS_EFLGS) rf_sta = rf_sta | RFS_ERR; if ((rf_sta & (RFS_ERR | RFS_DON)) && (rf_sta & RFS_IE)) diff --git a/PDP18B/pdp18b_sys.c b/PDP18B/pdp18b_sys.c index 535681b5..b611843d 100644 --- a/PDP18B/pdp18b_sys.c +++ b/PDP18B/pdp18b_sys.c @@ -99,6 +99,9 @@ extern DEVICE mt_dev; extern DEVICE tti1_dev, tto1_dev; extern UNIT tti1_unit, tto1_unit; #endif +#if defined (GRAPHICS2) +extern DEVICE g2out_dev, g2in_dev; +#endif #if defined (UC15) extern DEVICE dr15_dev; #endif diff --git a/PDP18B/uc15_defs.h b/PDP18B/uc15_defs.h new file mode 100644 index 00000000..090077e4 --- /dev/null +++ b/PDP18B/uc15_defs.h @@ -0,0 +1,59 @@ +/* uc15_defs.h: PDP15/UC15 shared state definitions + + Copyright (c) 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"), + 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. +*/ + +#ifndef UC15_DEFS_H_ +#define UC15_DEFS_H_ 0 + +#define UC15_STATE_SIZE 1024 /* size (int32's) */ + +/* The shared state region is divided into four quadrants + + 000-255 PDP-15 read/write, PDP-11 read only, data + 255-511 PDP-11 read/write, PDP-15 read only, data + 768-1023 Event signals (locks), read/write +*/ + +#define PDP15_MAXMEM 0400000 /* PDP15 max mem, words */ + +#define UC15_PDP15MEM 0040 /* PDP15 mem size, bytes */ +#define UC15_TCBP 0100 /* TCB pointer */ +#define UC15_API_SUMM 0140 /* API summary */ + +#define UC15_API_VEC 0600 /* vectors[4] */ +#define UC15_API_VEC_MUL 010 /* vector spread factor */ + +#define UC15_TCBP_WR 01000 /* TCBP write signal */ +#define UC15_TCBP_RD 01040 /* TCBP read signal */ +#define UC15_API_UPD 01100 /* API summ update */ +#define UC15_API_REQ 01200 /* +1 for API req[4] */ + +#define UC15_SHARED_RD(p) (*(uc15_shstate + (p))) +#define UC15_SHARED_WR(p,d) *(uc15_shstate + (p)) = (d) + +#define UC15_ATOMIC_CAS(p,o,n) sim_shmem_atomic_cas ((uc15_shstate + (p)), o, n) +#define UC15_ATOMIC_ADD(p,a) sim_shmem_atomic_add ((uc15_shstate + (p)), (a)) + +#endif diff --git a/README.md b/README.md index 0f3d5286..d36f3037 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ #### Updated HP2100 simulator from Dave Bryan. -#### Beta Sigma 5, 6 & 7 simulator from Bob Supnik +#### Sigma 5, 6 & 7 simulator from Bob Supnik #### Beta SAGE-II and PDQ-3 simulators from Holger Veit @@ -540,7 +540,7 @@ package must be available while building your simulator. The simh-vms-pcap.zip file can be downloaded from https://github.com/simh/simh/archive/vms-pcap.zip This link will return a file called simh-vms-pcap.zip which should be unpacked as follows: - $ unzip -aa simh-vms-pcap.zip + $ unzip -a simh-vms-pcap.zip $ rename [.simh-vms-pcap]pcap-vms.dir [] The PCAP-VMS components are presumed (by the descript.mms file) to be diff --git a/Visual Studio Projects/H316.vcproj b/Visual Studio Projects/H316.vcproj index 300bf8eb..a2e448e1 100644 --- a/Visual Studio Projects/H316.vcproj +++ b/Visual Studio Projects/H316.vcproj @@ -35,6 +35,9 @@ + @@ -116,6 +119,9 @@ + diff --git a/Visual Studio Projects/HP2100.vcproj b/Visual Studio Projects/HP2100.vcproj index a21e1cf6..f511b34e 100644 --- a/Visual Studio Projects/HP2100.vcproj +++ b/Visual Studio Projects/HP2100.vcproj @@ -35,6 +35,9 @@ + @@ -116,6 +119,9 @@ + diff --git a/Visual Studio Projects/Simh.sln b/Visual Studio Projects/Simh.sln index 69f7b2ec..4ff9b618 100644 --- a/Visual Studio Projects/Simh.sln +++ b/Visual Studio Projects/Simh.sln @@ -300,6 +300,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "I650", "I650.vcproj", "{95B {D40F3AF1-EEE7-4432-9807-2AD287B490F8} = {D40F3AF1-EEE7-4432-9807-2AD287B490F8} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UC15", "UC15.vcproj", "{B5E9D32E-53F9-4C9B-B037-5A2D34E370CF}" + ProjectSection(ProjectDependencies) = postProject + {D40F3AF1-EEE7-4432-9807-2AD287B490F8} = {D40F3AF1-EEE7-4432-9807-2AD287B490F8} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -550,6 +555,10 @@ Global {95B64699-4B93-4BFE-9024-0A2302D9B71A}.Debug|Win32.Build.0 = Debug|Win32 {95B64699-4B93-4BFE-9024-0A2302D9B71A}.Release|Win32.ActiveCfg = Release|Win32 {95B64699-4B93-4BFE-9024-0A2302D9B71A}.Release|Win32.Build.0 = Release|Win32 + {B5E9D32E-53F9-4C9B-B037-5A2D34E370CF}.Debug|Win32.ActiveCfg = Debug|Win32 + {B5E9D32E-53F9-4C9B-B037-5A2D34E370CF}.Debug|Win32.Build.0 = Debug|Win32 + {B5E9D32E-53F9-4C9B-B037-5A2D34E370CF}.Release|Win32.ActiveCfg = Release|Win32 + {B5E9D32E-53F9-4C9B-B037-5A2D34E370CF}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Visual Studio Projects/UC15.vcproj b/Visual Studio Projects/UC15.vcproj new file mode 100644 index 00000000..93dbaee4 --- /dev/null +++ b/Visual Studio Projects/UC15.vcproj @@ -0,0 +1,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Visual Studio Projects/VAX.vcproj b/Visual Studio Projects/VAX.vcproj index 3f6504dd..4356c38d 100644 --- a/Visual Studio Projects/VAX.vcproj +++ b/Visual Studio Projects/VAX.vcproj @@ -35,6 +35,9 @@ + @@ -119,6 +122,9 @@ + diff --git a/descrip.mms b/descrip.mms index 03fa74f1..8446b57c 100644 --- a/descrip.mms +++ b/descrip.mms @@ -275,11 +275,11 @@ PCAP_SIMH_INC = /INCL=($(PCAP_DIR)) @ 'MISS_SAY' "*** Error *** Attempting a Network Build but the VMS-PCAP components are not" @ 'MISS_SAY' "*** Error *** available" @ 'MISS_SAY' "*** Error *** " - @ 'MISS_SAY' "*** Error *** The vms-pcap.zip file can be downloaded from:" + @ 'MISS_SAY' "*** Error *** The simh-vms-pcap.zip file can be downloaded from:" @ 'MISS_SAY' "*** Error *** " @ 'MISS_SAY' "*** Error *** https://github.com/simh/simh/archive/vms-pcap.zip" @ 'MISS_SAY' "*** Error *** " - @ 'MISS_SAY' "*** Error *** Be sure to ""unzip -aa simh-vms-pcap.zip"" to properly set the file attributes" + @ 'MISS_SAY' "*** Error *** Be sure to ""unzip -a simh-vms-pcap.zip"" to properly set the file attributes" @ 'MISS_SAY' "*** Error *** " @ 'MISS_SAY' "*** Error *** The PCAP-VMS components are presumed (by this procedure) to be" @ 'MISS_SAY' "*** Error *** located in a directory at the same level as the directory" @@ -562,7 +562,7 @@ PDP18B_SOURCE = $(PDP18B_DIR)PDP18B_DT.C,$(PDP18B_DIR)PDP18B_DRM.C,\ $(PDP18B_DIR)PDP18B_RP.C,$(PDP18B_DIR)PDP18B_STDDEV.C,\ $(PDP18B_DIR)PDP18B_SYS.C,$(PDP18B_DIR)PDP18B_TT1.C,\ $(PDP18B_DIR)PDP18B_RB.C,$(PDP18B_DIR)PDP18B_FPP.C,\ - $(PDP18B_DIR)PDP18B_G2TTY.C + $(PDP18B_DIR)PDP18B_G2TTY.C,$(PDP18B_DIR)PDP18B_DR15.C PDP4_OPTIONS = /INCL=($(SIMH_DIR),$(PDP18B_DIR))/DEF=($(CC_DEFS),"PDP4=1") PDP7_OPTIONS = /INCL=($(SIMH_DIR),$(PDP18B_DIR))/DEF=($(CC_DEFS),"PDP7=1") PDP9_OPTIONS = /INCL=($(SIMH_DIR),$(PDP18B_DIR))/DEF=($(CC_DEFS),"PDP9=1") diff --git a/doc/h316_doc.doc b/doc/h316_doc.doc index 17727859..ed848656 100644 Binary files a/doc/h316_doc.doc and b/doc/h316_doc.doc differ diff --git a/doc/i1620_doc.doc b/doc/i1620_doc.doc index d1fc66a2..28c978d4 100644 Binary files a/doc/i1620_doc.doc and b/doc/i1620_doc.doc differ diff --git a/doc/pdp11_doc.doc b/doc/pdp11_doc.doc index 5d6fc570..aa32aacf 100644 Binary files a/doc/pdp11_doc.doc and b/doc/pdp11_doc.doc differ diff --git a/doc/pdp18b_doc.doc b/doc/pdp18b_doc.doc index cddbc23e..d23c1ccb 100644 Binary files a/doc/pdp18b_doc.doc and b/doc/pdp18b_doc.doc differ diff --git a/doc/simh_doc.doc b/doc/simh_doc.doc index 7c126177..80d7290e 100644 Binary files a/doc/simh_doc.doc and b/doc/simh_doc.doc differ diff --git a/doc/simh_faq.doc b/doc/simh_faq.doc index 3dc34d01..e2c0075e 100644 Binary files a/doc/simh_faq.doc and b/doc/simh_faq.doc differ diff --git a/makefile b/makefile index eb64b381..fa9dc957 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,7 @@ # # This GNU make makefile has been tested on: # Linux (x86 & Sparc & PPC) +# Android (Termux) # OS X # Solaris (x86 & Sparc) (gcc and Sun C) # OpenBSD @@ -37,13 +38,14 @@ # # simh project support is provided for simulators that are built with # dependent packages provided with the or by the operating system -# distribution OR for platforms where that isn't directly available (OS X) -# by packages from specific package management systems (MacPorts). Users -# wanting to build simulators with locally build dependent packages or -# packages provided by an unsupported package management system can -# override where this procedure looks for include files and/or libraries. -# Overrides can be specified by define exported environment variables or -# GNU make command line arguments which specify INCLUDES and/or LIBRARIES. +# distribution OR for platforms where that isn't directly available +# (OS X) by packages from specific package management systems (MacPorts +# or Homebrew). Users wanting to build simulators with locally build +# dependent packages or packages provided by an unsupported package +# management system can override where this procedure looks for include +# files and/or libraries. Overrides can be specified by define exported +# environment variables or GNU make command line arguments which specify +# INCLUDES and/or LIBRARIES. # Each of these, if specified, must be the complete list include directories # or library directories that should be used with each element separated by # colons. (i.e. INCLUDES=/usr/include/:/usr/local/include/:...) @@ -493,7 +495,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) endif endif ifneq (,$(call find_include,semaphore)) - OS_CCDEFS += -DHAVE_SEMAPHORE + ifneq (, $(shell grep sem_timedwait $(call find_include,semaphore))) + OS_CCDEFS += -DHAVE_SEMAPHORE + $(info using semaphore: $(call find_include,semaphore)) + endif endif ifneq (,$(call find_include,sys/ioctl)) OS_CCDEFS += -DHAVE_SYS_IOCTL @@ -1190,6 +1195,17 @@ PDP11 = ${PDP11D}/pdp11_fp.c ${PDP11D}/pdp11_cpu.c ${PDP11D}/pdp11_dz.c \ PDP11_OPT = -DVM_PDP11 -I ${PDP11D} ${NETWORK_OPT} $(DISPLAY_OPT) +UC15D = PDP11 +UC15 = ${UC15D}/pdp11_cis.c ${UC15D}/pdp11_cpu.c \ + ${UC15D}/pdp11_cpumod.c ${UC15D}/pdp11_cr.c \ + ${UC15D}/pdp11_fp.c ${UC15D}/pdp11_io.c \ + ${UC15D}/pdp11_io_lib.c ${UC15D}/pdp11_lp.c \ + ${UC15D}/pdp11_rh.c ${UC15D}/pdp11_rk.c \ + ${UC15D}/pdp11_stddev.c ${UC15D}/pdp11_sys.c \ + ${UC15D}/pdp11_uc15.c +UC15_OPT = -DVM_PDP11 -DUC15 -I ${UC15D} -I ${PDP18BD} + + VAXD = VAX VAX = ${VAXD}/vax_cpu.c ${VAXD}/vax_cpu1.c ${VAXD}/vax_fpa.c ${VAXD}/vax_io.c \ ${VAXD}/vax_cis.c ${VAXD}/vax_octa.c ${VAXD}/vax_cmode.c \ @@ -1748,7 +1764,7 @@ ALL = pdp1 pdp4 pdp7 pdp8 pdp9 pdp15 pdp11 pdp10 \ i7094 ibm1130 id16 id32 sds lgp h316 cdc1700 \ swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 isys8010 isys8020 \ isys8030 isys8024 imds-225 scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 \ - i650 + i650 sigma uc15 all : ${ALL} @@ -1833,6 +1849,14 @@ ${BIN}pdp11${EXE} : ${PDP11} ${SIM} ${MKDIRBIN} ${CC} ${PDP11} ${SIM} ${PDP11_OPT} $(CC_OUTSPEC) ${LDFLAGS} +uc15 : ${BIN}uc15${EXE} + +${BIN}uc15${EXE} : ${UC15} ${SIM} + ${MKDIRBIN} + ${CC} ${UC15} ${SIM} ${UC15_OPT} $(CC_OUTSPEC) ${LDFLAGS} + +vax : ${BIN}vax${EXE} + vax : microvax3900 microvax3900 : ${BIN}BuildROMs${EXE} ${BIN}microvax3900${EXE}