(FILECREATED "12-Sep-86 08:38:39" {ERIS}<TAMARIN>TSIM>MITESTS.;6 34004Q 

      changes to:  (FNS DoRead MakeMICompList DoWrite SetAddr SetREGL prd psel SearchNodeName 
			FinishOp DoRefresh TryAllRA ShowRA tryarb setarb nms)
		   (VARS MITESTSCOMS nsigList osigList)

      previous date: "29-Aug-86 21:51:21" {ERIS}<TAMARIN>TSIM>MITESTS.;3)


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

(PRETTYCOMPRINT MITESTSCOMS)

(RPAQQ MITESTSCOMS ((FNS DoRead DoRefresh DoWrite FinishOp FinishRead InitUctl MakeMICompList 
			   PulseREGL SearchNodeName SetAddr SetREGL ShowRA StartRead TryAllRA WR2 
			   cycle memstep nms packname pl prd psel setarb setsimvals setupsimvals 
			   tryarb)
	(VARS nsigList osigList)))
(DEFINEQ

(DoRead
  [LAMBDA (addr)                                             (* agb: " 3-Sep-86 18:37")
    (SetAddr addr)
    (SETQ ADPads 0)
    (SETQ *MemR' 0)
    (cycle)
    (PrintOutList (QUOTE ((*A)
			       (*AD)))
		    T)                                       (* SETQ HoldA 0)
    (cycle 140Q)
    (PrintOutList (QUOTE ((*RD)
			       (*AD)
			       (IAD)
			       (OAD)))
		    T)
    (BREAK1 NIL T)
    (SETQ *MemR' 1)
    (cycle])

(DoRefresh
  [LAMBDA NIL                                                (* agb: " 7-Sep-86 18:07")
    (SETQ *Refresh' 1)
    (memstep])

(DoWrite
  [LAMBDA (addr val)                                         (* agb: " 4-Sep-86 16:44")
    (SetAddr addr)
    (SETQ *ADaddr (LOGAND val 377Q))
    (SETQ *MemW' 0)
    (SETQ ADPads 1)
    (cycle)
    (PrintOutList (QUOTE ((*A)
			       (*AD)))
		    T)
    (cycle 140Q)
    (PrintOutList (QUOTE ((*RD)
			       (*AD)
			       (IAD)
			       (OAD)))
		    T])

(FinishOp
  [LAMBDA NIL                                                (* agb: " 3-Sep-86 20:16")
    (SETQ *MemR' 1)
    (SETQ *MemW' 1)
    (SETQ *Refresh' 0)
    (cycle])

(FinishRead
  [LAMBDA NIL                                                (* agb: "28-Aug-86 15:00")
    (cycle 96)
    [PrintOutList (QUOTE ((*RD)
			       (*AD)
			       (IAD)
			       (OAD]
    (SETQ *MemR' 1)
    (SETQ HoldA 1)
    (cycle])

(InitUctl
  [LAMBDA NIL                                                (* agb: "28-Aug-86 15:22")
    (SETQ *Ce-Io 0)
    (SETQ *Ce-M 0)
    (SETQ *MemW' 1)
    (SETQ *MemR' 1)
    (SETQ *IoW' 1)
    (SETQ *Refresh' 1)
    (SETQ *Addr 0)
    (SETQ Ale 0)
    (setsimvals nodemaplist setsections)
    (steps])

(MakeMICompList
  [LAMBDA NIL                                                (* agb: " 7-Sep-86 18:04")
    [SETQ isel (QUOTE ((ISEL]
    [SETQ tim (QUOTE ((T0 T20 T40 T50 T100 T120 T140 T160 T180 T200 T210 T240]
    [SETQ osel (QUOTE ((OSEL]
    [SETQ iad (QUOTE ((IAD]
    [SETQ oad (QUOTE ((OAD]
    (SETQ Phi1 0)
    (SETQ Phi2 0)
    (SETQ *Addr 0)
    (SETQ *ADaddr 0)
    (SETQ *Raddr 0)
    (SETQ *RD 0)
    (SETQ Addr 0)
    (SETQ *Cas' 0)
    (SETQ *Ce-Io 0)
    (SETQ *Ce-M 0)
    (SETQ *Done 0)
    (SETQ *MemR' 1)
    (SETQ *MemW' 1)
    (SETQ *We' 0)
    (SETQ *IoW' 1)
    (SETQ *Refresh' 0)
    (SETQ *Rdy 0)
    (SETQ *Ale 0)
    (SETQ HoldA 0)
    (SETQ Hold 0)
    (SETQ Ras0' 1)
    (SETQ Ras1' 1)
    (SETQ Ras2' 1)
    (SETQ Ras3' 1)
    (SETQ APads 0)
    (SETQ ADPads 0)
    (SETQ setsections (QUOTE (Ctl-In Addr-In APads)))
    (SETQ compsections (QUOTE (Ctl-Out)))
    (SETQ ionodes (QUOTE (ADPads TamarinBus)))
    [SETQ nodemaplist (for i in [APPEND [packname (QUOTE ((*A APads 11Q 7 7 *Addr)
								       (*AD ADPads 10Q 0 0 *ADaddr)
								       (*RA Ctl-Out 12Q 0 0 *Raddr)
								       (*RD0 TamarinBus -12Q 11Q 35Q 
									     *RD)
								       (*RD TamarinBus -36Q 47Q 0 *RD)
								       (A Internal 20Q 0 0 Addr]
						(QUOTE ((PHI1 Ctl-In Phi1)
							   (PHI2 Ctl-In Phi2)
							   (*CAS' Ctl-Out *Cas')
							   (*CE-IO Ctl-In *Ce-Io)
							   (*CE-M Ctl-In *Ce-M)
							   (*DONE Ctl-Out *Done)
							   (*MEMR' Ctl-In *MemR')
							   (*MEMW' Ctl-In *MemW')
							   (*WE' Ctl-Out *We')
							   (*IOW' Ctl-In *IoW')
							   (*REFRESH' Ctl-In *Refresh')
							   (*RDY Ctl-Out *Rdy)
							   (HOLD Ctl-Out Hold)
							   (*ALE Ctl-In *Ale)
							   (RAS0' Ras-Lines Ras0')
							   (RAS1' Ras-Lines Ras1')
							   (RAS2' Ras-Lines Ras2')
							   (RAS3' Ras-Lines Ras3']
			   when (findnode (CAR i))
			   collect (CONS (if (findnode (CAR i))
						 then (findnode (CAR i))
					       else (PRINTOUT T "Node not Found: " (CAR i)
								T)
						      (QUOTE (noop none 0)))
					     (CDR i]
    (PROG [(l (for i in nodemaplist collect (CADR i]
	    (SETQ typelist (INTERSECTION l l)))
    (setupsimvals])

(PulseREGL
  [LAMBDA NIL                                                (* agb: "28-Aug-86 14:25")
    (SETQ *Ce-Io 1)
    (SETQ *IoW' 0)
    (SETQ *AD 0)
    (memstep)
    (SETQ *IoW' 1)
    (memstep)
    (SETQ *Ce-Io 0)
    (memstep])

(SearchNodeName
  [LAMBDA (nam)                                              (* agb: " 4-Sep-86 14:30")
    (MAPHASH nethash (FUNCTION (LAMBDA (v k)
		   (if (STRPOS nam k)
		       then (PRINT k])

(SetAddr
  [LAMBDA (addr)                                             (* agb: " 7-Sep-86 18:05")
    (PRINT addr)
    (SETQ ADPads 1)
    (SetREGL 0 (LOGAND 177Q (LRSH addr 17Q)))
    (SetREGL 1 (LOGAND 3 (LRSH addr 26Q)))
    (SETQ *Ale 1)
    (SETQ *Addr (LOGAND 77400Q addr))
    (SETQ *ADaddr (LOGAND addr 377Q))
    (SETQ *Ce-M 1)
    (memstep)
    (SETQ *Ale 0)
    (memstep)
    (SETQ *Ce-M 0])

(SetREGL
  [LAMBDA (addr data)                                        (* agb: " 7-Sep-86 18:04")
    (SETQ ADPads 1)
    (SETQ *Addr 0)
    (SETQ *ADaddr (LOGAND addr 377Q))
    (SETQ *Ce-Io 1)
    (SETQ *Ale 1)
    (memstep)
    (SETQ *Ale 0)
    (memstep)
    (SETQ *ADaddr (LOGAND data 377Q))
    (SETQ *IoW' 0)
    (memstep)
    (SETQ *Ce-Io 0)
    (memstep)
    (SETQ *IoW' 1)
    (memstep)

          (* (SETQ *ADaddr (LOGAND data 377Q)) (if (EQ 0 addr) then (sh (QUOTE REGL)) else (sh (QUOTE REGL1))) 
	  (memstep) (sl (QUOTE REGL)) (sl (QUOTE REGL1)) (memstep))


    ])

(ShowRA
  [LAMBDA (addr)                                             (* agb: " 2-Sep-86 09:25")
    (SetAddr addr)
    (sh (QUOTE SELRAS/CAS'))
    (memstep)
    (PrintOutList (QUOTE ((*RA)
			       (*RAS0' *RAS1' *RAS2' *RAS3')
			       (IAD)
			       (SELRAS SELCAS)))
		    T)
    (sl (QUOTE SELRAS/CAS'))
    (memstep)
    (PrintOutList (QUOTE ((*RA)
			       (*RAS0' *RAS1' *RAS2' *RAS3')
			       (IAD)
			       (SELRAS SELCAS)))
		    T])

(StartRead
  [LAMBDA (addr)                                             (* agb: "28-Aug-86 14:58")
    (SETQ *Ce-M 1)
    (SETQ *ADaddr (LOGAND addr 255))
    (SETQ *MemR' 0)
    (cycle)
    (PrintOutList (QUOTE ((*A)
			       (*AD)))
		    T)
    (SETQ HoldA 0])

(TryAllRA
  [LAMBDA NIL                                                (* agb: " 2-Sep-86 16:04")
    (for i from 0 to 23 do (ShowRA (EXPT 2 i])

(WR2
  [LAMBDA (addr)                                             (* agb: "28-Aug-86 15:05")
    (SETQ HoldA 1)
    (cycle)
    (SETQ HoldA 0)
    (cycle 96)
    (PrintOutList (QUOTE ((*RD)
			       (*AD)
			       (IAD)
			       (OAD)))
		    T)
    (SETQ *MemW' 1)
    (SETQ HoldA 1)
    (cycle])

(cycle
  [LAMBDA (cyclecount)                                       (* agb: "28-Aug-86 14:53")
    (if (NOT cyclecount)
	then (SETQ cyclecount 0))
    (for i from 0 to cyclecount
       do (SETQ Phi1 1)
	    (SETQ Phi2 0)
	    (memstep)
	    (SETQ Phi1 0)
	    (memstep)
	    (SETQ Phi2 1)
	    (memstep)
	    (SETQ Phi2 0)
	    (memstep)
	    (PrintOutList (QUOTE ((*RA)
				       (*A)
				       (*AD)))
			    T])

(memstep
  [LAMBDA NIL                                                (* agb: "28-Aug-86 14:25")
    (setsimvals nodemaplist setsections ionodes)
    (steps)
    (DrawClockPoints 3 3])

(nms
  [LAMBDA NIL                                                (* agb: "31-Aug-86 20:35")
    (steps)
    (DrawClockPoints 20 20])

(packname
  [LAMBDA (NodeNameList)                                     (* agb: "28-Aug-86 11:32")

          (* * List of form (NodeName Type #Bits start# emulatorbit# LispName))


    (for i in NodeNameList
       join (if (GREATERP 0 (CAR (NTH i 3)))
		  then [for j from 0 to (DIFFERENCE (ABS (CAR (NTH i 3)))
							      1)
			    collect (LIST [PACK (APPEND (UNPACK (CAR i))
								(LIST (DIFFERENCE
									  (CAR (NTH i 4))
									  j]
					      (CAR (NTH i 2))
					      (LIST (LIST (CAR (NTH i 6))
							      0 1 (IPLUS j (CAR (NTH i 5]
		else (for j from 0 to (DIFFERENCE (CAR (NTH i 3))
							    1)
			  collect (LIST [PACK (APPEND (UNPACK (CAR i))
							      (LIST (IPLUS j
									       (CAR (NTH i 4]
					    (CAR (NTH i 2))
					    (LIST (LIST (CAR (NTH i 6))
							    0 1 (IPLUS j (CAR (NTH i 5])

(pl
  [LAMBDA (list)                                             (* agb: "28-Aug-86 15:36")
    (for i in list
       do (SETQ BOLflg T)
	    (walknet (QUOTE printnode2)
		       i)
	    (TERPRI])

(prd
  [LAMBDA NIL                                                (* agb: " 4-Sep-86 17:25")
    (Print01List (QUOTE ((*RD00 *RD01 *RD02 *RD03 *RD04 *RD05 *RD06 *RD07 *RD08 *RD09 *RD10 *RD11 
				    *RD12 *RD13 *RD14 *RD15 *RD16 *RD17 *RD18 *RD19 *RD20 *RD21 *RD22 
				    *RD23 *RD24 *RD25 *RD26 *RD27 *RD28 *RD29 *RD30 *RD31 *RD32 *RD33 
				    *RD34 *RD35 *RD36 *RD37 *RD38 *RD39])

(psel
  [LAMBDA NIL                                                (* agb: " 4-Sep-86 16:28")
    (PrintOutList (QUOTE ((SELA SELB SELC SELD SELE SELF)
			       (ISEL)
			       (OSEL)
			       (*AD])

(setarb
  [LAMBDA NIL                                                (* agb: "31-Aug-86 19:57")
    (sl (QUOTE HOLDAI))
    (sl (QUOTE REFSTART))
    (sl (QUOTE MEMSTART))
    (sl (QUOTE T20))
    (sl (QUOTE T180))
    (sl (QUOTE T240))
    (sh (QUOTE WTRQ~])

(setsimvals
  [LAMBDA (maplist sections iosections setall)               (* agb: "28-Aug-86 16:20")
    (PROG (simulatorval emualtorval section n)
	    (for i in maplist when (OR (FMEMB (SETQ section (CADR i))
							sections)
					       (FMEMB section iosections)
					       setall)
	       do (SETQ n (CAR i))
		    (SETQ simulatorval (ELTX potto01array (fetch (node npot) of n)))
		    (SETQ emualtorval (CADDR i))
		    (if (LISTP emualtorval)
			then (SETQ emualtorval (ConcatBits emualtorval))
		      else (SETQ emualtorval (GETTOPVAL emualtorval)))
		    (if (FMEMB section iosections)
			then (if (TF (GETTOPVAL section))
				   then (setin n (ELTX 01topotarray emualtorval))
				 else (setin n (QUOTE x)))
		      elseif (OR (NEQ emualtorval simulatorval)
				     (NOT (fetch (node input) of n)))
			then (setin n (ELTX 01topotarray emualtorval)
					(AND setall (NOT (FMEMB (CADR i)
								      sections])

(setupsimvals
  [LAMBDA NIL                                                (* agb: "28-Aug-86 13:44")
    (clearinputs)
    (SETQ elist T)
    (setall CLOW)
    (setsimvals nodemaplist setsections ionodes)
    (steps])

(tryarb
  [LAMBDA (flg)                                              (* agb: "31-Aug-86 20:36")
    (if (EQ flg (QUOTE ref))
	then (sh (QUOTE REFSTART))
      elseif (EQ flg (QUOTE write))
	then (sl (QUOTE WTRQ~))
	       (sh (QUOTE MEMSTART))
      else (sh (QUOTE WTRQ~))
	     (sh (QUOTE MEMSTART)))
    (nms)
    (sh (QUOTE HOLDAI))
    (nms)
    (sh (QUOTE T20))
    (nms)
    (sl (QUOTE T20))
    (nms)
    (sh (QUOTE T180))
    (nms)
    (sl (QUOTE T180))
    (nms)
    (sh (QUOTE T240))
    (nms)
    (sl (QUOTE T240))
    (nms)
    (if (EQ flg (QUOTE write))
	then (sh (QUOTE T20))
	       (nms)
	       (sl (QUOTE T20))
	       (nms)
	       (sh (QUOTE T180))
	       (nms)
	       (sl (QUOTE T180))
	       (nms)
	       (sh (QUOTE T240))
	       (nms)
	       (sl (QUOTE T240))
	       (nms))
    (sl (QUOTE HOLDAI))
    (nms)
    (sl (QUOTE MEMSTART))
    (sl (QUOTE REFSTART))
    (nms])
)

(RPAQQ nsigList (ALE *RA0 *RA1 *RA2 *RA3 *RA4 *RA5 *RA6 *RA7 *RA8 *RA9 *RAS0' *RAS1' *RAS2' *RAS3' 
		       RPADENB REGL REGL1 IAD0 IAD1 IAD2 IAD3 IAD4 IAD5 IAD6 IAD7 A8 A9 A10 A11 A12 
		       A13 A14 A15))

(RPAQQ osigList (MEMSTART MEMDONE REFSTART REFDONE HOLDI CYRQ DLIN T20 T290 T300 REFENB WRITE TX 
			    STATE~ MEMRQ~ REFRQ~ ILATCH *RAS1' *RAS0' *CAS' *WE' ALE WTRQ~ RPADENB 
			    DPADENB))
(PUTPROPS MITESTS COPYRIGHT ("Xerox Corporation" 3702Q))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1350Q 33027Q (DoRead 1362Q . 2345Q) (DoRefresh 2347Q . 2577Q) (DoWrite 2601Q . 3450Q) (
FinishOp 3452Q . 3757Q) (FinishRead 3761Q . 4407Q) (InitUctl 4411Q . 5155Q) (MakeMICompList 5157Q . 
12033Q) (PulseREGL 12035Q . 12461Q) (SearchNodeName 12463Q . 13030Q) (SetAddr 13032Q . 13773Q) (
SetREGL 13775Q . 15223Q) (ShowRA 15225Q . 16214Q) (StartRead 16216Q . 16676Q) (TryAllRA 16700Q . 
17160Q) (WR2 17162Q . 17712Q) (cycle 17714Q . 20701Q) (memstep 20703Q . 21217Q) (nms 21221Q . 21446Q) 
(packname 21450Q . 23543Q) (pl 23545Q . 24115Q) (prd 24117Q . 24742Q) (psel 24744Q . 25276Q) (setarb 
25300Q . 26003Q) (setsimvals 26005Q . 30162Q) (setupsimvals 30164Q . 30552Q) (tryarb 30554Q . 33025Q))
)))
STOP