From 611b7632c993006c5e4bd1d0fe3516cd3f6f4de4 Mon Sep 17 00:00:00 2001 From: Timothe Litt Date: Wed, 29 May 2013 13:50:56 -0400 Subject: [PATCH] Add set serial to KS cpu With multiple instances, error logging gets confusing when every CPU has the same serial number. This makes the CPU serial number settable. If not set, the old defaults apply. --- PDP10/pdp10_cpu.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- PDP10/pdp10_defs.h | 34 ++++++++++++++++++++++++---------- 2 files changed, 68 insertions(+), 12 deletions(-) diff --git a/PDP10/pdp10_cpu.c b/PDP10/pdp10_cpu.c index 8a24bfed..21098b5e 100644 --- a/PDP10/pdp10_cpu.c +++ b/PDP10/pdp10_cpu.c @@ -197,6 +197,7 @@ jmp_buf save_env; int32 hst_p = 0; /* history pointer */ int32 hst_lnt = 0; /* history length */ InstHistory *hst = NULL; /* instruction history */ +int32 apr_serial = -1; /* CPU Serial number */ /* Forward and external declarations */ @@ -205,6 +206,9 @@ t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_reset (DEVICE *dptr); t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc); +t_stat cpu_set_serial (UNIT *uptr, int32 val, char *cptr, void *desc); +t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, void *desc); + d10 adjsp (d10 val, a10 ea); void ibp (a10 ea, int32 pflgs); d10 ldb (a10 ea, int32 pflgs); @@ -400,6 +404,7 @@ MTAB cpu_mod[] = { NULL, &show_iospace }, { MTAB_XTD|MTAB_VDV|MTAB_NMO|MTAB_SHP, 0, "HISTORY", "HISTORY", &cpu_set_hist, &cpu_show_hist }, + { MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "SERIAL", "SERIAL", &cpu_set_serial, &cpu_show_serial }, { 0 } }; @@ -2104,8 +2109,14 @@ return; t_bool aprid (a10 ea, int32 prv) { -Write (ea, (Q_ITS)? UC_AIDITS: UC_AIDDEC, prv); -return FALSE; + d10 value = (Q_ITS)? UC_AIDITS: UC_AIDDEC; + if( (apr_serial == -1) || (!Q_ITS && apr_serial < 4096) ) + value |= (Q_ITS)? UC_SERITS: UC_SERDEC; + else + value |= apr_serial; + + Write (ea, value, prv); + return FALSE; } /* Checked against KS10 ucode */ @@ -2419,3 +2430,34 @@ for (k = 0; k < lnt; k++) { /* print specified */ } /* end for */ return SCPE_OK; } + +/* Set serial */ + +t_stat cpu_set_serial (UNIT *uptr, int32 val, char *cptr, void *desc) +{ +int32 lnt; +t_stat r; + +if (cptr == NULL) { + apr_serial = -1; + return SCPE_OK; + } +lnt = (int32) get_uint (cptr, 10, 077777, &r); +if ((r != SCPE_OK) || (lnt <= 0) || (!Q_ITS && lnt < 4096)) + return SCPE_ARG; +apr_serial = lnt & 077777; +return SCPE_OK; +} + +/* Show serial */ + +t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, void *desc) +{ +fprintf (st, "Serial: " ); +if( (apr_serial == -1) || (!Q_ITS && apr_serial < 4096) ) { + fprintf (st, "%d (default)", (Q_ITS)? UC_SERITS: UC_SERDEC); + return SCPE_OK; +} +fprintf (st, "%d", apr_serial); +return SCPE_OK; +} diff --git a/PDP10/pdp10_defs.h b/PDP10/pdp10_defs.h index fac99a78..0a161f33 100644 --- a/PDP10/pdp10_defs.h +++ b/PDP10/pdp10_defs.h @@ -476,8 +476,8 @@ typedef t_int64 d10; /* PDP-10 data (36b) */ #define UC_SERDEC 4097 /* serial number */ #define UC_SERITS 1729 #define UC_AIDDEC (UC_INHCST | UC_UBABLT | UC_KIPAGE | UC_KLPAGE | \ - UC_VERDEC | UC_SERDEC) -#define UC_AIDITS (UC_KIPAGE | UC_VERITS | UC_SERITS) + UC_VERDEC) +#define UC_AIDITS (UC_KIPAGE | UC_VERITS) #define UC_HSBDEC 0376000 /* DEC initial HSB */ #define UC_HSBITS 0000500 /* ITS initial HSB */ @@ -619,7 +619,6 @@ typedef struct pdp_dib DIB; #define DZ_MUXES 4 /* max # of muxes */ #define DZ_LINES 8 /* lines per mux */ -#define DUP_LINES 4 /* max # of DUP11's */ #define DIB_MAX 100 /* max DIBs */ #define DEV_V_UBUS (DEV_V_UF + 0) /* Unibus */ @@ -659,6 +658,12 @@ typedef struct pdp_dib DIB; #define IOLN_UBMNT3 001 #define IOBA_XU (IO_UBA3 + 0774510) /* DEUNA/DELUA */ #define IOLN_XU 010 +#define IOBA_DMR (IO_UBA3 + 0764000) /* DMR11 */ +#define IOLN_DMR 010 +#define IOBA_DUP (IO_UBA3 + 0760300) /* DUP11 */ +#define IOLN_DUP 010 +#define IOBA_KMC (IO_UBA3 + 0760540) /* KMC11 */ +#define IOLN_KMC 010 #define IOBA_CR (IO_UBA3 + 0777160) /* CD/CR/CM */ #define IOLN_CR 010 #define IOBA_RY (IO_UBA3 + 0777170) /* RX211 */ @@ -697,6 +702,10 @@ typedef struct pdp_dib DIB; #define INT_V_RP 6 /* RH11/RP,RM drives */ #define INT_V_TU 7 /* RH11/TM03/TU45 */ +#define INT_V_KMCA 8 /* KMC11 */ +#define INT_V_KMCB 9 +#define INT_V_DMRA 10 /* DMR11 */ +#define INT_V_DMRB 11 #define INT_V_DMCRX 13 #define INT_V_DMCTX 14 #define INT_V_XU 15 /* DEUNA/DELUA */ @@ -707,12 +716,13 @@ typedef struct pdp_dib DIB; #define INT_V_PTP 25 #define INT_V_LP20 26 /* LPT20 */ #define INT_V_CR 27 /* CD20 (CD11) */ -#define INT_V_CR 27 /* CD20 (CD11) */ -#define INT_V_DUPRX 28 /* DUP11 */ -#define INT_V_DUPTX 29 #define INT_RP (1u << INT_V_RP) #define INT_TU (1u << INT_V_TU) +#define INT_KMCA (1u << INT_V_KMCA) +#define INT_KMCB (1u << INT_V_KMCB) +#define INT_DMRA (1u << INT_V_DMRA) +#define INT_DMRB (1u << INT_V_DMRB) #define INT_DMCRX (1u << INT_V_DMCRX) #define INT_DMCTX (1u << INT_V_DMCTX) #define INT_XU (1u << INT_V_XU) @@ -723,19 +733,19 @@ typedef struct pdp_dib DIB; #define INT_PTP (1u << INT_V_PTP) #define INT_LP20 (1u << INT_V_LP20) #define INT_CR (1u << INT_V_CR) -#define INT_DUPRX (1u << INT_V_DUPRX) -#define INT_DUPTX (1u << INT_V_DUPTX) #define IPL_RP 6 /* int levels */ #define IPL_TU 6 +#define IPL_KMCA 5 +#define IPL_KMCB 5 +#define IPL_DMRA 5 +#define IPL_DMRB 5 #define IPL_DMCRX 5 #define IPL_DMCTX 5 #define IPL_XU 5 #define IPL_DZRX 5 #define IPL_DZTX 5 #define IPL_RY 5 -#define IPL_DUPRX 5 -#define IPL_DUPTX 5 #define IPL_PTR 4 #define IPL_PTP 4 #define IPL_LP20 4 @@ -759,6 +769,10 @@ typedef struct pdp_dib DIB; #define VEC_RY 0264 #define VEC_DZRX 0340 #define VEC_DZTX 0344 +#define VEC_KMCA 0540 +#define VEC_KMCB 0544 +#define VEC_DMRA 0610 +#define VEC_DMRB 0614 #define VEC_LP20 0754 #define VEC_AUTO 0 /* Set by Auto Configure */