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

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