simh-testsetgenerator/PDP11/pdp11_xu.h
Bob Supnik b6393b36b4 Notes For V3.3
RESTRICTION: The HP DS disk is not debugged.  DO NOT enable this
feature for normal operations.
WARNING: Massive changes in the PDP-11 make all previous SAVEd
file obsolete.  Do not attempt to use a PDP-11 SAVE file from a
prior release with V3.3!

1. New Features in 3.3

1.1 SCP

- Added -p (powerup) qualifier to RESET
- Changed SET <unit> ONLINE/OFFLINE to SET <unit> ENABLED/DISABLED
- Moved SET DEBUG under SET CONSOLE hierarchy
- Added optional parameter value to SHOW command
- Added output file option to SHOW command

1.2 PDP-11

- Separated RH Massbus adapter from RP controller
- Added TU tape support
- Added model emulation framework
- Added model details

1.3 VAX

- Separated out CVAX-specific features from core instruction simulator
- Implemented capability for CIS, octaword, compatibility mode instructions
- Added instruction display and parse for compatibility mode
- Changed SET CPU VIRTUAL=n to SHOW CPU VIRTUAL=n
- Added =n optional parameter to SHOW CPU HISTORY

1.4 Unibus/Qbus simulators (PDP-11, VAX, PDP-10)

- Simplified DMA API's
- Modified DMA peripherals to use simplified API's

1.5 HP2100 (all changes from Dave Bryan)

CPU	- moved MP into its own device; added MP option jumpers
	- modified DMA to allow disabling
	- modified SET CPU 2100/2116 to truncate memory > 32K
	- added -F switch to SET CPU to force memory truncation
	- modified WRU to be REG_HRO
	- added BRK and DEL to save console settings

DR	- provided protected tracks and "Writing Enabled" status bit
	- added "parity error" status return on writes for 12606
	- added track origin test for 12606
	- added SCP test for 12606
	- added "Sector Flag" status bit
	- added "Read Inhibit" status bit for 12606
	- added TRACKPROT modifier

LPS	- added SET OFFLINE/ONLINE, POWEROFF/POWERON
	- added fast/realistic timing
	- added debug printouts

LPT	- added SET OFFLINE/ONLINE, POWEROFF/POWERON

PTR	- added paper tape loop mode, DIAG/READER modifiers to PTR
	- added PV_LEFT to PTR TRLLIM register

CLK	- modified CLK to permit disable

1.6 IBM 1401, IBM 1620, Interdata 16b, SDS 940, PDP-10

- Added instruction history

1.7 H316, PDP-15, PDP-8

- Added =n optional value to SHOW CPU HISTORY

2. Bugs Fixed in 3.3

2.1 SCP

- Fixed comma-separated SET options (from Dave Bryan)
- Fixed duplicate HELP displays with user-specified commands

2.2 PDP-10

- Replicated RP register state per drive
- Fixed TU to set FCE on short record
- Fixed TU to return bit<15> in drive type
- Fixed TU format specification, 1:0 are don't cares
- Fixed TU handling of TMK status
- Fixed TU handling of DONE, ATA at end of operation
- Implemented TU write check

2.3 PDP-11

- Replicated RP register state per drive
- Fixed RQ, TQ to report correct controller type and stage 1 configuration
  flags on a Unibus system
- Fixed HK CS2<output_ready> flag

2.4 VAX

- Fixed parsing of indirect displacement modes in instruction input

2.5 HP2100 (all fixes from Dave Bryan)

CPU	- fixed S-register behavior on 2116
	- fixed LIx/MIx behavior for DMA on 2116 and 2100
	- fixed LIx/MIx behavior for empty I/O card slots

DP	- fixed enable/disable from either device
	- fixed ANY ERROR status for 12557A interface
	- fixed unattached drive status for 12557A interface
	- status cmd without prior STC DC now completes (12557A)
	- OTA/OTB CC on 13210A interface also does CLC CC
	- fixed RAR model
	- fixed seek check on 13210 if sector out of range

DQ	- fixed enable/disable from either device
	- shortened xtime from 5 to 3 (drive avg 156KW/second)
	- fixed not ready/any error status
	- fixed RAR model

DR	- fixed enable/disable from either device
	- fixed sector return in status word
	- fixed DMA last word write, incomplete sector fill value
	- fixed 12610 SFC operation
	- fixed current-sector determination

IPL	- fixed enable/disable from either device

LPS	- fixed status returns for error conditions
	- fixed handling of non-printing characters
	- fixed handling of characters after column 80
	- improved timing model accuracy for RTE

LPT	- fixed status returns for error conditions
	- fixed TOF handling so form remains on line 0

SYS	- fixed display of CCA/CCB/CCE instructions

2.5 PDP-15

FPP	- fixed URFST to mask low 9b of fraction
	- fixed exception PC setting
2011-04-15 08:34:40 -07:00

305 lines
15 KiB
C

/* pdp11_xu.h: DEUNA/DELUA ethernet controller information
------------------------------------------------------------------------------
Copyright (c) 2003-2004, David T. Hittner
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
THE AUTHOR 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 the author shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the author.
------------------------------------------------------------------------------
Modification history:
05-Jan-04 DTH Added network statistics
31-Dec-03 DTH Added reserved states
28-Dec-03 DTH Corrected MODE bitmasks
23-Dec-03 DTH Corrected TXR and RXR bitmasks
03-Dec-03 DTH Refitted to SIMH v3.0 platform
05-May-03 DTH Started XU simulation
------------------------------------------------------------------------------
*/
#ifndef _PDP11_XU_H
#define _PDP11_XU_H
#if defined (VM_PDP10) /* PDP10 version */
#include "pdp10_defs.h"
#define XU_RDX 8
#define XU_WID 16
extern int32 int_req;
extern int32 int_vec[32];
#elif defined (VM_VAX) /* VAX version */
#include "vax_defs.h"
#define XU_RDX 8
#define XU_WID 16
extern int32 int_req[IPL_HLVL];
extern int32 int_vec[IPL_HLVL][32];
#else /* PDP-11 version */
#include "pdp11_defs.h"
#define XU_RDX 8
#define XU_WID 16
extern int32 int_req[IPL_HLVL];
extern int32 int_vec[IPL_HLVL][32];
#endif /* VM_PDP10 */
#include "sim_ether.h"
#define XU_QUE_MAX 500 /* message queue array */
#define XU_FILTER_MAX 11 /* mac + 10 multicast addrs */
#define XU_SERVICE_INTERVAL 100 /* times per second */
#define XU_ID_TIMER_VAL 540 /* 9 min * 60 sec */
#define UDBSIZE 100 /* max size of UDB (in words) */
enum xu_type {XU_T_DEUNA, XU_T_DELUA};
struct xu_setup {
int promiscuous; /* promiscuous mode enabled */
int multicast; /* enable all multicast addresses */
int mac_count; /* number of multicast mac addresses */
ETH_MAC macs[XU_FILTER_MAX]; /* MAC addresses to respond to */
};
/* Network Statistics -
some of these will always be zero in the simulated environment,
since there is no ability for the sim_ether network driver to see
things like incoming runts, collision tests, babbling, etc.
*/
struct xu_stats {
uint16 secs; /* seconds since last clear */
uint32 frecv; /* frames received */
uint32 mfrecv; /* multicast frames received */
uint16 rxerf; /* receive error flags */
uint32 frecve; /* frames received with errors */
uint32 rbytes; /* data bytes received */
uint32 mrbytes; /* multicast data bytes received */
uint16 rlossi; /* received frames lost - internal err */
uint16 rlossl; /* received frames lost - local buffers */
uint32 ftrans; /* frames transmitted */
uint32 mftrans; /* multicast frames transmitted */
uint32 ftrans3; /* frames transmitted with 3+ tries */
uint32 ftrans2; /* frames transmitted - two tries */
uint32 ftransd; /* frames transmitted - deferred */
uint32 tbytes; /* data bytes transmitted */
uint32 mtbytes; /* multicast data bytes transmitted */
uint16 txerf; /* transmit error flags summary */
uint16 ftransa; /* transmit frames aborted */
uint16 txccf; /* transmit collision test failure */
uint16 porterr; /* port driver errors */
uint16 bablcnt; /* babble counter */
};
struct xu_device {
/*+ initialized values - DO NOT MOVE */
ETH_PCALLBACK rcallback; /* read callback routine */
ETH_PCALLBACK wcallback; /* write callback routine */
ETH_MAC mac; /* MAC address */
enum xu_type type; /* controller type */
/*- initialized values - DO NOT MOVE */
/* I/O register storage */
uint32 irq; /* interrupt request flag */
/* buffers, etc. */
ETH_DEV* etherface;
ETH_PACK read_buffer;
ETH_PACK write_buffer;
ETH_QUE ReadQ;
int idtmr; /* countdown for ID Timer */
int sectmr; /* countup for one second timer */
struct xu_setup setup;
struct xu_stats stats; /* reportable network statistics */
/* copied from dec_deuna.h */
uint16 pcsr0; /* primary DEUNA registers */
uint16 pcsr1;
uint16 pcsr2;
uint16 pcsr3;
uint32 mode; /* mode register */
uint32 pcbb; /* port command block base */
uint32 stat; /* extended port status */
uint32 tdrb; /* transmit desc ring base */
uint32 telen; /* transmit desc ring entry len */
uint32 trlen; /* transmit desc ring length */
uint32 txnext; /* transmit buffer pointer */
uint32 rdrb; /* receive desc ring base */
uint32 relen; /* receive desc ring entry len */
uint32 rrlen; /* receive desc ring length */
uint32 rxnext; /* receive buffer pointer */
uint16 pcb[4]; /* copy of Port Command Block */
uint16 udb[UDBSIZE]; /* copy of Unibus Data Block */
uint16 rxhdr[4]; /* content of RX ring entry, during wait */
uint16 txhdr[4]; /* content of TX ring entry, during xmit */
};
struct xu_controller {
DEVICE* dev; /* device block */
UNIT* unit; /* unit block */
DIB* dib; /* device interface block */
struct xu_device* var; /* controller-specific variables */
};
typedef struct xu_controller CTLR;
/* PCSR0 register definitions */
#define PCSR0_SERI 0100000 /* <15> Status Error Intr */
#define PCSR0_PCEI 0040000 /* <14> Port Command Error Intr */
#define PCSR0_RXI 0020000 /* <13> Receive Interrupt */
#define PCSR0_TXI 0010000 /* <12> Transmit Interrupt */
#define PCSR0_DNI 0004000 /* <11> Done Interrupt */
#define PCSR0_RCBI 0002000 /* <10> Recv Buffer Unavail Intr */
#define PCSR0_USCI 0000400 /* <08> Unsolicited State Chg Inter */
#define PCSR0_INTR 0000200 /* <07> Interrupt Summary */
#define PCSR0_INTE 0000100 /* <06> Interrupt Enable */
#define PCSR0_RSET 0000040 /* <05> Reset */
#define PCSR0_PCMD 0000017 /* <03:00> Port Command field */
/* PCSR0 Port Commands */
#define CMD_NOOP 000 /* No-op */
#define CMD_GETPCBB 001 /* Get PCB base */
#define CMD_GETCMD 002 /* Get Command */
#define CMD_SELFTEST 003 /* Self-test init */
#define CMD_START 004 /* Start xmit/recv */
#define CMD_BOOT 005 /* Boot */
#define CMD_RSV06 006 /* Reserved */
#define CMD_RSV07 007 /* Reserved */
#define CMD_PDMD 010 /* Polling Demand */
#define CMD_RSV11 011 /* Reserved */
#define CMD_RSV12 012 /* Reserved */
#define CMD_RSV13 013 /* Reserved */
#define CMD_RSV14 014 /* Reserved */
#define CMD_RSV15 015 /* Reserved */
#define CMD_HALT 016 /* Halt */
#define CMD_STOP 017 /* Stop */
/* PCSR1 register definitions */
#define PCSR1_XPWR 0100000 /* <15> Tranceiver power failure */
#define PCSR1_ICAB 0040000 /* <14> Port/Link cable failure */
#define PCSR1_ECOD 0037400 /* <13:08> Self-test error code */
#define PCSR1_PCTO 0000200 /* <07> Port Command Timeout */
#define PCSR1_TYPE 0000160 /* <06:04> Interface type */
#define PCSR1_STATE 0000017 /* <03:00> State: */
/* PCSR1 Types */
#define TYPE_DEUNA (0 << 4) /* Controller is a DEUNA */
#define TYPE_DELUA (1 << 4) /* Controller is a DELUA */
/* PCSR1 States */
#define STATE_RESET 000 /* Reset */
#define STATE_PLOAD 001 /* Primary Load */
#define STATE_READY 002 /* Ready */
#define STATE_RUNNING 003 /* Running */
#define STATE_UHALT 005 /* UNIBUS Halted */
#define STATE_NHALT 006 /* NI Halted */
#define STATE_NUHALT 007 /* NI and UNIBUS Halted */
#define STATE_HALT 010 /* Halted */
#define STATE_SLOAD 017 /* Secondary Load */
/* Status register definitions */
#define STAT_ERRS 0100000 /* <15> error summary */
#define STAT_MERR 0040000 /* <14> multiple errors */
#define STAT_BABL 0020000 /* <13> Transmitter on too long [DELUA only] */
#define STAT_CERR 0010000 /* <12> collision test error */
#define STAT_TMOT 0004000 /* <11> UNIBUS timeout */
#define STAT_RRNG 0001000 /* <09> receive ring error */
#define STAT_TRNG 0000400 /* <08> transmit ring error */
#define STAT_PTCH 0000200 /* <07> ROM patch */
#define STAT_RRAM 0000100 /* <06> running from RAM */
#define STAT_RREV 0000077 /* <05:00> ROM version */
/* Mode definitions */
#define MODE_PROM 0100000 /* <15> Promiscuous Mode */
#define MODE_ENAL 0040000 /* <14> Enable All Multicasts */
#define MODE_DRDC 0020000 /* <13> Disable Data Chaining */
#define MODE_TPAD 0010000 /* <12> Transmit Msg Pad Enable */
#define MODE_ECT 0004000 /* <11> Enable Collision Test */
#define MODE_DMNT 0001000 /* <09> Disable Maint Message */
#define MODE_INTL 0000200 /* <07> Internal Loopback [DELUA only] */
#define MODE_DTCR 0000010 /* <03> Disable Transmit CRC */
#define MODE_LOOP 0000004 /* <02> Internal Loopback Mode */
#define MODE_HDPX 0000001 /* <00> Half-Duplex Mode */
/* Function Code definitions */
#define FC_NOOP 0000000 /* no-op */
#define FC_LSM 0000001 /* Load and Start Microaddress */
#define FC_RDPA 0000002 /* Read Default Physical Address */
#define FC_RPA 0000004 /* Read Physical Address */
#define FC_WPA 0000005 /* Write Physical Address */
#define FC_RMAL 0000006 /* Read Multicast Address List */
#define FC_WMAL 0000007 /* Write Multicast Address List */
#define FC_RRF 0000010 /* Read Ring Format */
#define FC_WRF 0000011 /* Write Ring Format */
#define FC_RDCTR 0000012 /* Read Counters */
#define FC_RDCLCTR 0000013 /* Read and Clear Counters */
#define FC_RMODE 0000014 /* Read Mode */
#define FC_WMODE 0000015 /* Write Mode */
#define FC_RSTAT 0000016 /* Read Status */
#define FC_RCSTAT 0000017 /* Read and Clear Status */
#define FC_DIM 0000020 /* Dump Internal Memory */
#define FC_LIM 0000021 /* Load Internal Memory */
#define FC_RSID 0000022 /* Read System ID parameters */
#define FC_WSID 0000023 /* Write System ID parameters */
#define FC_RLSA 0000024 /* Read Load Server Address */
#define FC_WLSA 0000025 /* Write Load Server Address */
/* Transmitter Ring definitions */
#define TXR_OWN 0100000 /* <15> we own it (1) */
#define TXR_ERRS 0040000 /* <14> error summary */
#define TXR_MTCH 0020000 /* <13> Station Match */
#define TXR_MORE 0010000 /* <12> Mult Retries Needed */
#define TXR_ONE 0004000 /* <11> One Collision */
#define TXR_DEF 0002000 /* <10> Deferred */
#define TXR_STF 0001000 /* <09> Start Of Frame */
#define TXR_ENF 0000400 /* <08> End Of Frame */
#define TXR_BUFL 0100000 /* <15> Buffer Length Error */
#define TXR_UBTO 0040000 /* <14> UNIBUS TimeOut */
#define TXR_UFLO 0020000 /* <13> Underflow Error */
#define TXR_LCOL 0010000 /* <12> Late Collision */
#define TXR_LCAR 0004000 /* <11> Lost Carrier */
#define TXR_RTRY 0002000 /* <10> Retry Failure (16x) */
#define TXR_TDR 0001777 /* <9:0> TDR value if RTRY=1 */
/* Receiver Ring definitions */
#define RXR_OWN 0100000 /* <15> we own it (1) */
#define RXR_ERRS 0040000 /* <14> Error Summary */
#define RXR_FRAM 0020000 /* <13> Frame Error */
#define RXR_OFLO 0010000 /* <12> Message Overflow */
#define RXR_CRC 0004000 /* <11> CRC Check Error */
#define RXR_STF 0001000 /* <09> Start Of Frame */
#define RXR_ENF 0000400 /* <08> End Of Frame */
#define RXR_BUFL 0100000 /* <15> Buffer Length error */
#define RXR_UBTO 0040000 /* <14> UNIBUS TimeOut */
#define RXR_NCHN 0020000 /* <13> No Data Chaining */
#define RXR_OVRN 0010000 /* <12> Overrun Error [DELUA only] */
#define RXR_MLEN 0007777 /* <11:0> Message Length */
/* debugging bitmaps */
#define DBG_TRC 0x0001 /* trace routine calls */
#define DBG_REG 0x0002 /* trace read/write registers */
#define DBG_WRN 0x0004 /* display warnings */
#define DBG_ETH 0x8000 /* debug ethernet device */
#endif /* _PDP11_XU_H */