root/src/dps8/dps8_cable.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * vim: filetype=c:tabstop=4:ai:expandtab
   3  * SPDX-License-Identifier: ICU
   4  * scspell-id: 5d03518d-f62d-11ec-a03b-80ee73e9b8e7
   5  *
   6  * ---------------------------------------------------------------------------
   7  *
   8  * Copyright (c) 2013-2016 Charles Anthony
   9  * Copyright (c) 2021-2024 The DPS8M Development Team
  10  *
  11  * This software is made available under the terms of the ICU License.
  12  * See the LICENSE.md file at the top-level directory of this distribution.
  13  *
  14  * ---------------------------------------------------------------------------
  15  */
  16 
  17 extern char * ctlr_type_strs [/* *enum ctlr_type_e */];
  18 extern char * chan_type_strs [/* *enum chan_type_e */];
  19 
  20 typedef enum chanType { chanTypeCPI, chanTypePSI, chanTypeDirect } chanType;
  21 
  22 // Multics devices (from prph card, AM81-04, pp 7-21 on)
  23 //
  24 //  CCUn   Combination record units  CCU0401
  25 //  DIAn   Direct Interface Adapter
  26 //  DSKn   Disk MSU0400 MSU0402 MSU0451 MSU0500 MSU0501 MSU3380 MSU3381
  27 //  FNPn   FNP DN6670
  28 //  OPCn   Operator Console CSU6001 CSU6004 CSU6601
  29 //  PRTn   Printer PRT401 PRT402 PRU1000 PRU1200 PRU1201 PRU1203 PRU1600
  30 //  PUNn   Card Punch PCU0120 PCU0121 CPZ201 PCU0300 CPZ300 CPZ301
  31 //  RDRn   Card Reader CRZ201 CRZ301 CRU0500 CRU0501 CRU1050
  32 //  TAPn   Tape Drive MTU0500 MTU0500 MTU0600 MTU0610 MTUo630 MTU8200
  33 //
  34 
  35 // Controllers
  36 //   mpc card, AM81-04, pp 7-15 on.
  37 //
  38 //   mpc mtpx model -- mtp is tape controller
  39 //    MTC501   mtp 501.
  40 //    MTC502   mtp 502.
  41 //    MTC0602  mtp 602.
  42 //    MTC0600  mtp 600.
  43 //    MTP0610  mtp 610.
  44 //    MTP0611  mtp 611.
  45 //    MTP8021  mtp 611.
  46 //    MTP8022  mtp 611.
  47 //    MTP8023  mtp 611.
  48 //
  49 //   mpc mspx model -- msp is disk controller
  50 //    MSP0400  msp 400.
  51 //    DSC0451  msp 451.
  52 //    MSP0451  msp 451.
  53 //    MSP0601  msp 601.
  54 //    MSP0603  msp 603.
  55 //    MSP0607  msp 607.
  56 //    MSP0609  msp 609.
  57 //    MSP0611  msp 611.
  58 //    MSP0612  msp 612.
  59 //    MSP8021  msp 800.
  60 //    MSP8022  msp 800.
  61 //    MSP8022  msp 800.
  62 //
  63 //   mpc urpx model -- urp is unit record controller
  64 //    URC002   urp   2.
  65 //    URP0600  urp 600.
  66 //    URP0601  urp 601.
  67 //    URP0602  urp 602.
  68 //    URP0604  urp 604.
  69 //
  70 
  71 enum chan_type_e { chan_type_CPI, chan_type_PSI, chan_type_direct };
  72 // DEVT_NONE must be zero for memset to init it properly.
  73 enum ctlr_type_e
  74   {
  75      CTLR_T_NONE = 0,
  76      CTLR_T_MTP,
  77      CTLR_T_MSP,
  78      CTLR_T_IPC,
  79      CTLR_T_OPC,
  80      CTLR_T_URP,
  81      CTLR_T_FNP,
  82      CTLR_T_ABSI,
  83      CTLR_T_MGP,
  84      CTLR_T_SKC,
  85      // DEVT_DN355
  86   };
  87 
  88 // Connect SCU to IOM/CPU
  89 //
  90 //    (iom#, port#) = scu_to_iom (scu#, port#, subport#)
  91 //    (scu#, port#, subport#) = iom_to_scu (iom#, port#)
  92 //
  93 //    (cpu#, port#) = scu_to_cpu (scu#, port#, subport#)
  94 //    (scu#, port#, subport#) = cpu_to_scu (cpu#, port#)
  95 //
  96 //    cable SCUx port# IOMx port#
  97 //    cable SCUx port# CPUx port#
  98 //
  99 
 100 struct scu_to_iom_s
 101   {
 102     bool in_use;
 103     uint iom_unit_idx;
 104     uint iom_port_num;
 105   };
 106 
 107 struct iom_to_scu_s
 108   {
 109     bool in_use;
 110     uint scu_unit_idx;
 111     uint scu_port_num;
 112     uint scu_subport_num;
 113   };
 114 
 115 struct scu_to_cpu_s
 116   {
 117     bool in_use;
 118     uint cpu_unit_idx;
 119     uint cpu_port_num;
 120   };
 121 
 122 struct cpu_to_scu_s
 123   {
 124     bool in_use;
 125     uint scu_unit_idx;
 126     uint scu_port_num;
 127     uint scu_subport_num;
 128   };
 129 
 130 //
 131 // Connect iom to controller
 132 //
 133 //    (ctrl#, port#) = iom_to_ctlr (iom#, chan#)
 134 //    (iom#, chan#) = ctlr_to_iom (ctlr#, port#)
 135 //
 136 //    cable IOMx chan# MTPx [port#]  // tape controller
 137 //    cable IOMx chan# MSPx [port#] // disk controller
 138 //    cable IOMx chah# IPCx [port#] // FIPS disk controller
 139 //    cable IOMx chan# OPCx       // Operator console
 140 //    cable IOMx chan# FNPx       // FNP
 141 //    cable IOMx chan# ABSIx      // ABSI
 142 //    cable IOMx chan# URPx       // Unit record processor
 143 //    cable IOMx chan# SKx        // Socket
 144 //
 145 
 146 struct iom_to_ctlr_s
 147   {
 148     bool in_use;
 149     uint ctlr_unit_idx; // unit number ("ctrl#")
 150     uint port_num; // port#
 151     enum ctlr_type_e ctlr_type; // TAPE, DISK, CON, ...
 152     enum chan_type_e chan_type; // CPI, PSI, Direct
 153     DEVICE * dev; // ctlr device
 154     UNIT * board; // points into iomUnit
 155     iom_cmd_t * iom_cmd;
 156   };
 157 
 158 struct ctlr_to_iom_s
 159   {
 160     bool in_use;
 161     uint iom_unit_idx;
 162     uint chan_num;
 163   };
 164 
 165 // Connect controller to device
 166 //
 167 //    device# = ctlr_to_dev (ctlr#, dev_code)
 168 //    (ctlr#, dev_code) = dev_to_ctlr (disk#)
 169 //
 170 //   msp ctlr to disk
 171 //
 172 //     cable MSPx dev_code DISKx
 173 //
 174 //   ipc ctlr to disk
 175 //
 176 //     cable FIPSx dev_code DISKx
 177 //
 178 //   fnp doesn't have a device
 179 //
 180 //   absi doesn't have a device
 181 //
 182 //   opc doesn't have a device
 183 //
 184 //   mpt to tape
 185 //
 186 //     cable MTPx dev_code TAPEx
 187 //
 188 //   urp to  device
 189 //
 190 //     cable URPx dev_code RDRx
 191 //     cable URPx dev_code PUNx
 192 //     cable URPx dev_code PRTx
 193 //
 194 //  skc doesn't have a cableable device; channel n connects to unit n.
 195 
 196 struct ctlr_to_dev_s
 197   {
 198     bool in_use;
 199     uint unit_idx;
 200     iom_cmd_t * iom_cmd;
 201   };
 202 
 203 struct dev_to_ctlr_s
 204   {
 205     bool in_use;
 206     uint ctlr_unit_idx;
 207     uint dev_code;
 208     enum ctlr_type_e ctlr_type; // Used by disks to determine if the controller
 209                                 // is MSP or IPC
 210   };
 211 
 212 struct cables_s
 213   {
 214     // SCU->unit
 215     //  IOM
 216     struct scu_to_iom_s scu_to_iom   [N_SCU_UNITS_MAX]  [N_SCU_PORTS];
 217     struct iom_to_scu_s iom_to_scu   [N_IOM_UNITS_MAX]  [N_IOM_PORTS];
 218     //  CPU
 219     struct scu_to_cpu_s scu_to_cpu   [N_SCU_UNITS_MAX]  [N_SCU_PORTS] [N_SCU_SUBPORTS];
 220     struct cpu_to_scu_s cpu_to_scu   [N_CPU_UNITS_MAX]  [N_CPU_PORTS];
 221 
 222     // IOM->CTLR
 223     struct iom_to_ctlr_s iom_to_ctlr [N_IOM_UNITS_MAX]  [MAX_CHANNELS];
 224     //   mtp
 225     struct ctlr_to_iom_s mtp_to_iom  [N_MTP_UNITS_MAX]  [MAX_CTLR_PORTS];
 226     //   msp
 227     struct ctlr_to_iom_s msp_to_iom  [N_MSP_UNITS_MAX]  [MAX_CTLR_PORTS];
 228     //   ipc
 229     struct ctlr_to_iom_s ipc_to_iom  [N_IPC_UNITS_MAX]  [MAX_CTLR_PORTS];
 230     //   urp
 231     struct ctlr_to_iom_s urp_to_iom  [N_URP_UNITS_MAX]  [MAX_CTLR_PORTS];
 232     //   dia
 233     struct ctlr_to_iom_s dia_to_iom  [N_DIA_UNITS_MAX]  [MAX_CTLR_PORTS];
 234     //   fnp
 235     struct ctlr_to_iom_s fnp_to_iom  [N_FNP_UNITS_MAX]  [MAX_CTLR_PORTS];
 236     //   absi
 237     struct ctlr_to_iom_s absi_to_iom [N_ABSI_UNITS_MAX] [MAX_CTLR_PORTS];
 238     //   mgp
 239     struct ctlr_to_iom_s mgp_to_iom  [N_MGP_UNITS_MAX]  [MAX_CTLR_PORTS];
 240     //   console
 241     struct ctlr_to_iom_s opc_to_iom  [N_OPC_UNITS_MAX]  [MAX_CTLR_PORTS];
 242     //   socket
 243     struct ctlr_to_iom_s sk_to_iom   [N_SKC_UNITS_MAX]  [MAX_CTLR_PORTS];
 244 
 245     // CTLR->DEV
 246     //   mtp->tape
 247     struct ctlr_to_dev_s mtp_to_tape [N_MTP_UNITS_MAX]  [N_DEV_CODES];
 248     struct dev_to_ctlr_s tape_to_mtp [N_MT_UNITS_MAX];
 249     //   ipc->disk
 250     struct ctlr_to_dev_s ipc_to_dsk  [N_IPC_UNITS_MAX]  [N_DEV_CODES];
 251     //   msp->disk
 252     struct ctlr_to_dev_s msp_to_dsk  [N_MSP_UNITS_MAX]  [N_DEV_CODES];
 253     struct dev_to_ctlr_s dsk_to_ctlr [N_DSK_UNITS_MAX];
 254     //   urp->rdr/pun/prt
 255     struct ctlr_to_dev_s urp_to_urd  [N_URP_UNITS_MAX]  [N_DEV_CODES];
 256     struct dev_to_ctlr_s rdr_to_urp  [N_RDR_UNITS_MAX];
 257     struct dev_to_ctlr_s pun_to_urp  [N_PUN_UNITS_MAX];
 258     struct dev_to_ctlr_s prt_to_urp  [N_PRT_UNITS_MAX];
 259   };
 260 
 261 extern struct cables_s * cables;
 262 
 263 t_stat sys_cable (UNUSED int32 arg, const char * buf);
 264 
 265 // Accessors
 266 
 267 // Get controller index from (IOM index, channel)
 268 
 269 #define get_ctlr_idx(iom_unit_idx, chan) \
 270    (cables->iom_to_ctlr[iom_unit_idx][chan].ctlr_unit_idx)
 271 
 272 // Get controller in_use from (IOM index, channel)
 273 
 274 #define get_ctlr_in_use(iom_unit_idx, chan) \
 275    (cables->iom_to_ctlr[iom_unit_idx][chan].in_use)
 276 
 277 // Get SCU index from (CPU index, port)
 278 
 279 #define get_scu_idx(cpu_unit_idx, cpu_port_num) \
 280    (cables->cpu_to_scu[cpu_unit_idx][cpu_port_num].scu_unit_idx)
 281 
 282 // Get SCU in_use from (CPU index, port)
 283 
 284 #define get_scu_in_use(cpu_unit_idx, cpu_port_num) \
 285    (cables->cpu_to_scu[cpu_unit_idx][cpu_port_num].in_use)
 286 
 287 t_stat sys_cable (UNUSED int32 arg, const char * buf);
 288 t_stat sys_cable_ripout (UNUSED int32 arg, UNUSED const char * buf);
 289 t_stat sys_cable_show (UNUSED int32 arg, UNUSED const char * buf);
 290 void sysCableInit (void);

/* [previous][next][first][last][top][bottom][index][help] */