| 1 | /* hp2100_cpu0.c: HP 1000 unimplemented instruction set stubs\r |
| 2 | \r |
| 3 | Copyright (c) 2006-2008, J. David Bryan\r |
| 4 | \r |
| 5 | Permission is hereby granted, free of charge, to any person obtaining a\r |
| 6 | copy of this software and associated documentation files (the "Software"),\r |
| 7 | to deal in the Software without restriction, including without limitation\r |
| 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense,\r |
| 9 | and/or sell copies of the Software, and to permit persons to whom the\r |
| 10 | Software is furnished to do so, subject to the following conditions:\r |
| 11 | \r |
| 12 | The above copyright notice and this permission notice shall be included in\r |
| 13 | all copies or substantial portions of the Software.\r |
| 14 | \r |
| 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r |
| 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r |
| 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r |
| 18 | THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r |
| 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r |
| 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r |
| 21 | \r |
| 22 | Except as contained in this notice, the name of the author shall not be\r |
| 23 | used in advertising or otherwise to promote the sale, use or other dealings\r |
| 24 | in this Software without prior written authorization from the author.\r |
| 25 | \r |
| 26 | CPU0 Unimplemented firmware option instructions\r |
| 27 | \r |
| 28 | 26-Feb-08 HV Removed and implemented "cpu_vis" and "cpu_signal"\r |
| 29 | 22-Nov-07 JDB Removed and implemented "cpu_rte_ema"\r |
| 30 | 12-Nov-07 JDB Removed and implemented "cpu_rte_vma" and "cpu_rte_os"\r |
| 31 | 01-Dec-06 JDB Removed and implemented "cpu_sis".\r |
| 32 | 26-Sep-06 JDB Created\r |
| 33 | \r |
| 34 | This file contains template simulations for the firmware options that have\r |
| 35 | not yet been implemented. When a given firmware option is implemented, it\r |
| 36 | should be moved out of this file and into another (or its own, depending on\r |
| 37 | complexity).\r |
| 38 | \r |
| 39 | Primary references:\r |
| 40 | - HP 1000 M/E/F-Series Computers Technical Reference Handbook\r |
| 41 | (5955-0282, Mar-1980)\r |
| 42 | - HP 1000 M/E/F-Series Computers Engineering and Reference Documentation\r |
| 43 | (92851-90001, Mar-1981)\r |
| 44 | - Macro/1000 Reference Manual (92059-90001, Dec-1992)\r |
| 45 | \r |
| 46 | Additional references are listed with the associated firmware\r |
| 47 | implementations, as are the HP option model numbers pertaining to the\r |
| 48 | applicable CPUs.\r |
| 49 | */\r |
| 50 | \r |
| 51 | #include "hp2100_defs.h"\r |
| 52 | #include "hp2100_cpu.h"\r |
| 53 | #include "hp2100_cpu1.h"\r |
| 54 | \r |
| 55 | \r |
| 56 | t_stat cpu_ds (uint32 IR, uint32 intrq); /* Distributed System */\r |
| 57 | \r |
| 58 | \r |
| 59 | /* Distributed System\r |
| 60 | \r |
| 61 | Distributed System firmware was provided with the HP 91740A DS/1000 product\r |
| 62 | for use with the HP 12771A (12665A) Serial Interface and 12773A Modem\r |
| 63 | Interface system interconnection kits. Firmware permitted high-speed\r |
| 64 | transfers with minimum impact to the processor. The advent of the\r |
| 65 | "intelligent" 12794A and 12825A HDLC cards, the 12793A and 12834A Bisync\r |
| 66 | cards, and the 91750A DS-1000/IV software obviated the need for CPU firmware,\r |
| 67 | as essentially the firmware was moved onto the I/O cards.\r |
| 68 | \r |
| 69 | Primary documentation for the DS instructions has not been located. However,\r |
| 70 | examination of the DS/1000 sources reveals that two instruction were used by\r |
| 71 | the DVA65 Serial Interface driver (91740-18071) and placed in the trap cells\r |
| 72 | of the communications interfaces. Presumably they handled interrupts from\r |
| 73 | the cards.\r |
| 74 | \r |
| 75 | Implementation of the DS instructions will also require simulation of the\r |
| 76 | 12665A Hardwired Serial Data Interface Card and the 12620A RTE Privileged\r |
| 77 | Interrupt Fence. These are required for DS/1000.\r |
| 78 | \r |
| 79 | Option implementation by CPU was as follows:\r |
| 80 | \r |
| 81 | 2114 2115 2116 2100 1000-M 1000-E 1000-F\r |
| 82 | ------ ------ ------ ------ ------ ------ ------\r |
| 83 | N/A N/A N/A N/A 91740A 91740B 91740B\r |
| 84 | \r |
| 85 | The routines are mapped to instruction codes as follows:\r |
| 86 | \r |
| 87 | Instr. 1000-M 1000-E/F Description\r |
| 88 | ------ ------ -------- ----------------------------------------------\r |
| 89 | 105520 105300 "Open loop" (trap cell handler)\r |
| 90 | 105521 105301 "Closed loop" (trap cell handler)\r |
| 91 | 105522 105302 [unknown]\r |
| 92 | [test] 105524 105304 [self test]\r |
| 93 | \r |
| 94 | Notes:\r |
| 95 | \r |
| 96 | 1. The E/F-Series opcodes were moved from 105340-357 to 105300-317 at\r |
| 97 | revision 1813.\r |
| 98 | \r |
| 99 | 2. DS/1000 ROM data are available from Bitsavers.\r |
| 100 | \r |
| 101 | Additional references (documents unavailable):\r |
| 102 | - HP 91740A M-Series Distributed System (DS/1000) Firmware Installation\r |
| 103 | Manual (91740-90007).\r |
| 104 | - HP 91740B Distributed System (DS/1000) Firmware Installation Manual\r |
| 105 | (91740-90009).\r |
| 106 | */\r |
| 107 | \r |
| 108 | static const OP_PAT op_ds[16] = {\r |
| 109 | OP_N, OP_N, OP_N, OP_N, /* --- --- --- --- */\r |
| 110 | OP_N, OP_N, OP_N, OP_N, /* --- --- --- --- */\r |
| 111 | OP_N, OP_N, OP_N, OP_N, /* --- --- --- --- */\r |
| 112 | OP_N, OP_N, OP_N, OP_N /* --- --- --- --- */\r |
| 113 | };\r |
| 114 | \r |
| 115 | t_stat cpu_ds (uint32 IR, uint32 intrq)\r |
| 116 | {\r |
| 117 | t_stat reason = SCPE_OK;\r |
| 118 | OPS op;\r |
| 119 | uint32 entry;\r |
| 120 | \r |
| 121 | if ((cpu_unit.flags & UNIT_DS) == 0) /* DS option installed? */\r |
| 122 | return stop_inst;\r |
| 123 | \r |
| 124 | entry = IR & 017; /* mask to entry point */\r |
| 125 | \r |
| 126 | if (op_ds[entry] != OP_N)\r |
| 127 | if (reason = cpu_ops (op_ds[entry], op, intrq)) /* get instruction operands */\r |
| 128 | return reason;\r |
| 129 | \r |
| 130 | switch (entry) { /* decode IR<3:0> */\r |
| 131 | \r |
| 132 | default: /* others undefined */\r |
| 133 | reason = stop_inst;\r |
| 134 | }\r |
| 135 | \r |
| 136 | return reason;\r |
| 137 | }\r |