(FILECREATED "10-Aug-85 15:39:33" {ERIS}<LISPCORE>BUSMASTER>NEW>BUSMASTERTEST.;1 6014   

      changes to:  (FNS BUSMASTERTEST)

      previous date: "11-May-85 18:17:50" {ERIS}<LISPCORE>BUSMASTER>BUSMASTERTEST.;5)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT BUSMASTERTESTCOMS)

(RPAQQ BUSMASTERTESTCOMS ((FILES BUSMASTER)
			  (FNS BMTEST BUSMASTERTEST)))
(FILESLOAD BUSMASTER)
(DEFINEQ

(BMTEST
  [LAMBDA (FOUND EXPECT MASK TESTNAME)
    (PROG ((MASKEDFOUND (IF MASK
			    THEN (LOGAND MASK FOUND)
			  ELSE FOUND)))
          (IF VERBOSEFLG
	      THEN (PRIN1 "Testing: ")
		   (PRINT TESTNAME))
          (IF (NEQ EXPECT MASKEDFOUND)
	      THEN (PRIN1 "Expected: ")
		   (PRIN1 EXPECT)
		   (PRIN1 ", Found: ")
		   (PRIN1 MASKEDFOUND)
		   (PRIN1 ", Error in test: ")
		   (PRINT TESTNAME])

(BUSMASTERTEST
  [LAMBDA (VERBOSEFLG)                                    (* edited: "10-Aug-85 15:37")

          (* * Run confidence tests on PC-bus BusMaster)


    (PROG ((CtrlReg 4)
	   (StatReg 4)
	   (DataReg 5)
	   (AddrHiReg 6)
	   (AddrLoReg 7)
	   (StatInProgress 1)
	   (StatIOChChk 2)
	   (StatIOChRdy 4)
	   (StatA0 64)
	   (StatBhen 128)
	   (StatTestbit0 256)
	   (StatA8 512)
	   (StatA16 1024)
	   (StatSlaveNot 8192)
	   (StatMasterNot 16384)
	   (CtrlMemR 1)
	   (CtrlMemW 2)
	   (CtlIOR 4)
	   (CtlIOW 8)
	   (CtrlTestbit0 64)
	   (CtrlBhen 2048)
	   (CtrlMultibus 32768)
	   (RcvrData 532)
	   (RcvrAddrHi 533)
	   (RcvrAddrLo 534))
          (PROGN (WRITEPRINTERPORT 65535)
		 (BMTEST (READPRINTERPORT)
			 0 224 "Wrong CPE-FP connector")
		 (WRITEPRINTERPORT 0)
		 (BMTEST (READPRINTERPORT)
			 0 64 "Check power and flat cable"))
          (PROGN (BX.OUTPUT 0 CtrlReg)
		 (BX.OUTPUT 0 DataReg)
		 (BMTEST (BX.INPUT StatReg)
			 0 StatTestbit0 "BusMaster Card: Testbit0 zero")
		 (BX.OUTPUT CtrlTestbit0 CtrlReg)
		 (BMTEST (BX.INPUT StatReg)
			 0 StatTestbit0 "BusMaster Card: Testbit0 still zero")
		 (BX.OUTPUT 0 DataReg)
		 (BMTEST (BX.INPUT StatReg)
			 StatTestbit0 StatTestbit0 "BusMaster Card: Testbit0 one"))
          (PROGN (BX.OUTPUT 0 CtrlReg)
		 (BX.OUTPUT 0 DataReg)
		 (BMTEST (BX.INPUT StatReg)
			 StatBhen StatBhen "BusMaster Card: Status BHEN zero")
		 (BX.OUTPUT CtrlBhen CtrlReg)
		 (BMTEST (BX.INPUT StatReg)
			 StatBhen StatBhen "BusMaster Card: Status BHEN still zero")
		 (BX.OUTPUT 0 DataReg)
		 (BMTEST (BX.INPUT StatReg)
			 0 StatBhen "BusMaster Card: Status BHEN one"))
          (PROGN (BUS.RESET)
		 (BMTEST (BX.INPUT StatReg)
			 StatIOChRdy StatIOChRdy "IOChRdy (PC-bus pin 10) stuck")
		 (BMTEST (BX.INPUT StatReg)
			 0 StatInProgress "DMA Request stuck or Bad BusMaster: InProgress stuck")
		 (PCBUS.INPUT RcvrData)
		 (BMTEST (BX.INPUT StatReg)
			 StatIOChRdy StatIOChRdy "IOChRdy (PC-bus pin 10) stuck after input")
		 (BMTEST (BX.INPUT StatReg)
			 0 StatInProgress "DRQn stuck or Bad BusMaster: InProgress stuck after input")
		 )
          (PROGN (PCBUS.OUTPUT RcvrData 0)
		 (BMTEST (BX.INPUT DataReg)
			 0 NIL "Check flat cable: BX low test zeros")
		 (PCBUS.OUTPUT RcvrData 65535)
		 (BMTEST (BX.INPUT DataReg)
			 255 NIL "Check flat cable: BX low test ones")
		 (BX.OUTPUT RcvrData AddrLoReg)
		 (BX.OUTPUT (PLUS CtrlMultibus CtlIOW)
			    CtrlReg)
		 (BX.OUTPUT 0 DataReg)
		 (BMTEST (BX.INPUT DataReg)
			 0 NIL "Check flat cable: BX high test zeros")
		 (BX.OUTPUT 65535 DataReg)
		 (BMTEST (BX.INPUT DataReg)
			 65535 NIL "Check flat cable: BX high test ones"))
          (PROGN (PCBUS.WRITE 0 0)
		 (BMTEST (BX.INPUT StatReg)
			 0 StatA0 "BusMaster Card: A0 test zero")
		 (BMTEST (BX.INPUT StatReg)
			 0 StatA8 "BusMaster Card: A8 test zero")
		 (BMTEST (BX.INPUT StatReg)
			 0 StatA16 "BusMaster Card: A16 test zero")
		 (PCBUS.WRITE 1048575 0)
		 (BMTEST (BX.INPUT StatReg)
			 StatA0 StatA0 "BusMaster Card: A0 test one")
		 (BMTEST (BX.INPUT StatReg)
			 StatA8 StatA8 "BusMaster Card: A8 test one")
		 (BMTEST (BX.INPUT StatReg)
			 StatA16 StatA16 "BusMaster Card: A16 test one"))
          (PROGN (BMTEST (BX.INPUT StatReg)
			 0 StatMasterNot "Jumper E7 in for PC-bus")
		 (BMTEST (BX.INPUT StatReg)
			 StatSlaveNot StatSlaveNot "Jumper E5 out for PC-bus"))
          (PROGN (PCBUS.OUTPUT RcvrData 0)
		 (PCBUS.WRITEHL 15 255 255)
		 (BMTEST (PCBUS.INPUT RcvrData)
			 0 NIL "IBM Receiver Card Loopback: data zeros")
		 (BMTEST (PCBUS.INPUT RcvrAddrLo)
			 255 NIL "IBM Receiver Card Loopback: AddrLo ones")
		 (BMTEST (PCBUS.INPUT RcvrAddrHi)
			 0 NIL "IBM Receiver Card Loopback: AddrHi zeros")
		 (PCBUS.OUTPUT RcvrData 255)
		 (PCBUS.WRITEHL 15 65280 0)
		 (BMTEST (PCBUS.INPUT RcvrData)
			 255 NIL "IBM Receiver Card Loopback: data ones")
		 (BMTEST (PCBUS.INPUT RcvrAddrLo)
			 0 NIL "IBM Receiver Card Loopback: AddrLo zeros")
		 (BMTEST (PCBUS.INPUT RcvrAddrHi)
			 255 NIL "IBM Receiver Card Loopback: AddrHi ones"))
          (PROGN (PCBUS.WRITEHL 1 0 0)
		 (PCBUS.WRITEHL 1 65535 255)
		 (BMTEST (PCBUS.READHL 1 0)
			 0 NIL "Remote Bank 1 Memory: zeros at zero")
		 (BMTEST (PCBUS.READHL 1 65535)
			 255 NIL "Remote Bank 1 Memory: ones at ones")
		 (PCBUS.WRITEHL 1 0 255)
		 (PCBUS.WRITEHL 1 65535 0)
		 (BMTEST (PCBUS.READHL 1 0)
			 255 NIL "Remote Bank 1 Memory: ones at zero")
		 (BMTEST (PCBUS.READHL 1 65535)
			 0 NIL "Remote Bank 1 Memory: zeros at ones"))
          (RETURN "BusMaster, Receiver and bank 1 memory OK except as printed."])
)
(PUTPROPS BUSMASTERTEST COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (431 5930 (BMTEST 441 . 925) (BUSMASTERTEST 927 . 5928)))))
STOP