Name PDPMAIN1; Assembly 0001; Revision 2.73; PartNo U4 ATF1508AS; Device f1508ispplcc84; Company S100Computers.com; Designer John Monahan; Location San Ramon,CA; Date 8/26/2018; property ATMEL { xor_synthesis=on }; property ATMEL { logic_doubling=on }; property ATMEL { jtag=on }; PROPERTY ATMEL { preassign keep }; PROPERTY ATMEL { TMS_pullup=on }; PROPERTY ATMEL { TDI_pullup=on }; PROPERTY ATMEL { open_collector=ABORT}; /* * ---------- BOARD CPLD IS SETUP TO RUN AS A S100 BUS >>>> SLAVE <<<<< PDP11 Board(V2.5f), U15 --------- * Pin assignments * Make all data and address outputs fast slew and all chip selects slow * Note this version allows for 16 & 8 bit RAM and Ports access. * * V0.9a 3/29/2017 ;Tested on V0.9a board * V0.9b 4/5/2017 ;Added DV input back to PDP CPU * V1.0 8/19/2017 ;Added output for S100_IO * V2.41 11/6/2017 ;All 4 UART Interrupts working from Support board. * V2.5f 12/3/2017 ;Rearrange pins slightly for V2.5F CPLD * V2.7 12/24/2017 ;Added Event Timer Circuit * V2.72 1/22/2018 ;Added ELM timer circuit to CPU board * V2.72A 5/8/2018 ;Added code to detect invalid IO Ports * V2.73 8/26/2018 ;Corrected bug with TMA transfer with a second slave in system (68K). */ Pin 83 = UART_CLK_IN; /* 20MHz */ Pin 2 = MASTER_CLK; /* Clock input from PDP11 CPU, Pin 34 */ Pin 81 = PHI; /* Actual S100 bus Phi clock. (Frequency depends on current bus master) */ Pin 4 = BAUD_CLK; /* (156.24/16)KHz = 9600 Baud (Approx)for UART */ Pin 5 = TMAx; Pin 6 = HOLD; Pin 8 = pHLDA; Pin 9 = Master_Slave; /* Unused currently, can allow jumper for master/slave configurations below */ Pin 10 = XFERI; /* Active low */ Pin 11 = XFERII; Pin 15 = ALE; /* Inverted ALE* signal from CPU pin 40 */ Pin 16 = PDP_WR; Pin 17 = VALID_PORT; /* LOW if the current I/O Port address is valid */ Pin 18 = P26; /* Spare */ Pin 20 = P14; /* Spare */ Pin 21 = DV; Pin 22 = BUFCTL; /* Active LOW, LOW = Read data to CPU */ Pin 24 = bpSYNC; Pin 25 = READY; Pin 27 = bpWR; Pin 28 = bpDBIN; Pin 29 = bsXTRQ; Pin 30 = bMWRT; Pin 31 = bsHLTA; Pin 33 = bsINTA; Pin 34 = bsWO; Pin 35 = bsM1; Pin 36 = bsOUT; Pin 37 = bsINP; Pin 39 = bsMEMR; Pin 40 = PHANTOM; Pin 41 = SIXTN; /* Low if bus can handle 16 bit data */ Pin 44 = DIRECTION_L; Pin 46 = DIRECTION_H; Pin 48 = LA0; Pin 49 = ROM_ACTIVE; /* LED D1 */ Pin 50 = DIAGNOSTIC_LED; /* LED D10 */ Pin 51 = OE_A; Pin 52 = OE_B; Pin 54 = OE_C; Pin 55 = OE_D; Pin 56 = UART_ADDRESS; /* Active Low */ Pin 57 = ROM_ADDRESS; /* Active Low */ Pin 58 = ROM_CS; Pin 60 = NDEF3; /* S100 bus Output, currently not used */ Pin 61 = NDEF1; /* S100 bus Input, currently not used */ Pin 63 = CPU_INIT; /* Currently not used */ Pin 64 = DMR; /* Currently not used */ Pin 65 = RFU1; /* S100 bus Output, currently not used */ Pin 67 = UART_CS; /* Active LOW. Don't access the S100 bus I/O ports if PDP ia addressing UART ports */ Pin 68 = ABORT; /* Active low, Note, Open Collector output, currently not used */ Pin 69 = SCTL; /* Active low input from CPU */ Pin 70 = STRB; /* Active low input from CPU */ Pin 73 = CONT; /* Output, pulse low ends a stretch cycle */ Pin 74 = LBS0; /* Input from CPU */ Pin 75 = LBS1; /* Input from CPU */ Pin 76 = LAIO3; /* Input from CPU */ Pin 77 = LAIO2; /* Input from CPU */ Pin 79 = LAIO1; /* Input from CPU */ Pin 80 = LAIO0; /* Input from CPU */ Pin 84 = MAP; /* Active low input from CPU, currently unused */ Pin 1 = MASTER_RESET; /* S100 Bus reset. Active LOW */ Pin 12 = INACTIVATE_CONTROL_LINES; Pin 45 = INACTIVATE_DATA_LINES; INACTIVATE_DATA_LINES = 'b'1; /* Just to be safe, for now, pull these unimplemented signals high for now */ INACTIVATE_CONTROL_LINES = 'b'1; /* Need to divide the 20Hz Oscillator down to obtain the correct BAUD Rate for the UART. */ /* For 9600 Baud (156.24/16 = 9765) is close enough for most Serial ports. Never a problem with the USB/Serial adaptors */ Pinnode = [CD9..0]; CD0.t = 'b'1; /* 10MHz */ CD1.t = CD0; /* 5 MHz */ CD2.t = CD0 & CD1; /* 2.5 MHz */ CD3.t = CD0 & CD1 & CD2; /* 1.25 Mhz */ CD4.t = CD0 & CD1 & CD2 & CD3; /* 625 KHz */ CD5.t = CD0 & CD1 & CD2 & CD3 & CD4; /* 312 KHz */ CD6.t = CD0 & CD1 & CD2 & CD3 & CD4 & CD5; /* 156 KHz */ CD7.t = CD0 & CD1 & CD2 & CD3 & CD4 & CD5 & CD6; /* 78 KHz */ CD8.t = CD0 & CD1 & CD2 & CD3 & CD4 & CD5 & CD6 & CD7; /* 39 KHz */ CD9.t = CD0 & CD1 & CD2 & CD3 & CD4 & CD5 & CD6 & CD7 & CD8; /* 19 KHz */ [CD9..0].ckmux = UART_CLK_IN; /* BAUD_CLK = CD4; ~38400 Baud */ /* BAUD_CLK = CD5; ~19200 Baud */ BAUD_CLK = CD6; /* ~ 9600 Baud = 9765 baud (156Hz/16 = 9750 */ /* BAUD_CLK = CD7; */ /* ~ 4800 Baud = ~78.1 KHz on scope */ /* BAUD_CLK = CD8; */ /* ~ 2400 Baud = ~ 39 KHz on scope */ Pinnode = [reg8..0]; /* Need a few D typer Flip Flops */ reg0.d = TMAx; /* TMAx goes low-> high */ reg0.ck = !PHI; reg0.ar = !MASTER_RESET; /* Return to high on reset */ !HOLD = reg0; /* Lower S100 bus HOLD line */ XFERI = !(pHLDA & reg0); reg1.d = reg0; reg1.ck = pHLDA; reg1.ar = !reg0; reg2.d = reg1; reg2.ck = !PHI; reg2.ar = !reg1; XFERII = !reg1; reg3.d = reg2; reg3.ckmux = BAUD_CLK; reg3.ar = !MASTER_RESET; !CPU_INIT = reg3 & TMAx; HALT = 'b'0; /* A HIGH in default mode, forces the CPU to the ODT mode */ DMR = 'b'1; /* Note: Unlike our previous CPU boards the status lines will go to bus via a 74LS244,U27 */ /* not a 74LS240, so the S100 bus status signals from the CPLD will NOT be invreted here. */ /* Note BUFCTL is actully BUFCTL* */ Pinnode = BUS_READ; /* BUS CYCLE TYPE */ Pinnode = BUS_BYTE_WRITE; Pinnode = BUS_WORD_WRITE; Pinnode = LBS_MEM; Pinnode = LBS_SYS; Pinnode = LBS_IO; Pinnode = LSB_INT; !LBS_MEM = !LBS1 & !LBS0; /* Need to decode LBS0 & LBS1 */ !LBS_SYS = !LBS1 & LBS0; !LBS_IO = LBS1 & !LBS0; !LSB_INT = LBS1 & LBS0; !BUS_READ = ((LAIO3 & LAIO2 & !LAIO1 & !LAIO0) /* Instruction read - request */ # (LAIO3 & !LAIO2 & LAIO1 & LAIO0) /* Read-modify-write no bus lock */ # (LAIO3 & !LAIO2 & LAIO1 & !LAIO0) /* Read-modify-write bus lock */ # (LAIO3 & !LAIO2 & !LAIO1 & LAIO0) /* Data read */ # (LAIO3 & !LAIO2 & !LAIO1 & !LAIO0)); /* Instruction read - demand */ !BUS_WORD_WRITE = !LAIO3 & !LAIO2 & !LAIO1 & LAIO0; /* Bus Word WRITE*/ !BUS_BYTE_WRITE = !LAIO3 & !LAIO2 & LAIO1 & LAIO0; /* Bus BYTE WRITE */ !P14 = !VALID_PORT & !LBS_IO & !SCTL & !XFERI; /* If VALID_PORT is LOW then an Invalid Port, P14 pulses low */ !ABORT = !P14; /* For debugging use P14 to detect an invalid port */ !DIAGNOSTIC_LED = !ABORT; /* For debugging, the LED should not come on! */ bsINTA = LAIO3 & LAIO2 & !LAIO1 & LAIO0; /* Instruction INTA vector read request from CPU */ bpSYNC = STRB & !XFERII; bMWRT = BUFCTL & !PDP_WR & (!LBS_MEM & ROM_CS) & !XFERII & !bsINTA; !bpWR = BUFCTL & !PDP_WR & ((!LBS_MEM & ROM_CS) # (!LBS_IO & UART_ADDRESS)) & !XFERII & !bsINTA; bsMEMR = !BUFCTL & PDP_WR & (!LBS_MEM & ROM_CS) & !XFERII & !BUS_READ & !bsINTA; /* Onboard ROMS local to board */ bpDBIN = !BUFCTL & PDP_WR & ((!LBS_MEM & ROM_CS) # (!LBS_IO & UART_ADDRESS)) & !BUS_READ & !XFERII; bsOUT = BUFCTL & !PDP_WR & !LBS_IO & !XFERII & (!BUS_WORD_WRITE # !BUS_BYTE_WRITE) & UART_ADDRESS & !bsINTA; bsINP = !BUFCTL & PDP_WR & !LBS_IO & !XFERII & !BUS_READ & UART_ADDRESS & !bsINTA; DIRECTION_L = BUFCTL; /* BUFCTL is active LOW = Read, 74LS245 Direction B->A, to CPU */ DIRECTION_H = BUFCTL; !OE_C = (((!bpWR & !BUS_WORD_WRITE & !XFERII & !bsINTA) # (bpDBIN & !XFERII & !bsINTA)) /* U17, 16 Bit Rd or /Wr and 8 bit Rd, DAL 8-15 */ #(bsINTA & !XFERII & !bsINTA)); !OE_D = !bpWR & !BUS_BYTE_WRITE & LA0 & !XFERII & !bsINTA; /* U20, 8 Bit Write Odd address on DAL 8-15 */ !OE_A = ((bpDBIN & !LBS_IO & !LA0 & !XFERII) & !bsINTA & SIXTN); /* U22, 8 Bit I/O Read on DAL 0-7 */ !OE_B = (((!bpWR & !BUS_WORD_WRITE & !XFERII & !bsINTA) # (bpDBIN & !XFERII & !bsINTA & !SIXTN)) /* U23, 16 Bit Rd or Wr and 8 bit (RAM) Rd */ # (!bpWR & !BUS_BYTE_WRITE & !LA0 & !XFERII & !bsINTA)); /* 8 Bit Write Even address (DAL 0-7) */ !bsXTRQ = bpDBIN # (!bpWR & !BUS_WORD_WRITE); /* All reads are 16 bit. For S100 Bus BYTE Write, bsXREQ must be HIGH */ !bsWO = bMWRT # bsOUT; bsM1 = ((ALE & !XFERII & (LAIO3 & LAIO2 & !LAIO1 & !LAIO0)) /* 1100 Instruction Read (request) */ # (ALE & !XFERII & (LAIO3 & !LAIO2 & !LAIO1 & !LAIO0))); /* 1000 Instruction Read (demand) */ !ROM_CS = !ROM_ADDRESS & !BUS_READ & !XFERII; /* Onboard ROMs CS* (Pin 20 of 28C64's) */ !PHANTOM = !ROM_CS; /* Prevent conflict with onboard RAM/ROM with S100 bus RAM */ !UART_CS = !UART_ADDRESS & !LBS_IO; /* UART is 3FFF70-3FFF77 (No S100 bus ports IF not using PDP Support board) */ !CONT = !SCTL & !READY & !XFERII; /* S100 Bus wait states required, stretch PDP-11 Cycle */ /* READY* goes high if there are wait states U34B */ /* Also required to keep CPU in hold state after power up until it has bus */ DV = !SCTL & !BUFCTL; /* Required for stretched cycles to latch data into the CPU */