(FILECREATED "18-Dec-86 10:35:17" {ERIS}<TAMARIN>TSIM>SIMCOMPARES.;45 25050  

      changes to:  (FNS SetupTransSim SetSimClocks)

      previous date: "17-Sep-86 10:46:42" {ERIS}<TAMARIN>TSIM>SIMCOMPARES.;44)


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

(PRETTYCOMPRINT SIMCOMPARESCOMS)

(RPAQQ SIMCOMPARESCOMS ((GLOBALVARS setsections compsections compnodes ionodes errortracefile gpot 
				      recordchanges ErrorCycles ErrorCount)
			  (VARS setsections compsections compnodes ionodes)
			  (* * Emulator Support Functions)
			  (FNS SetSimClocks SetupTransSim SetTransSim ExecuteTrans CompTransSim 
			       ExecuteTransComp MakeTransCompList)
			  (* * Value Setup & Compare Functions)
			  (FNS MakeSetFns SetOneNode MakeCompFns CompOneNode)
			  (FNS setupsimvals setsimvals)
			  (FNS packname transbits clock setclocks makeunknownlist showunknowns)
			  (MACROS findnodemacro)))
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS setsections compsections compnodes ionodes errortracefile gpot recordchanges ErrorCycles 
	    ErrorCount)
)

(RPAQQ setsections (Pads-In Dswap-In))

(RPAQQ compsections (DataPathD2Set Rom-Out VMM-Out PadLogic Pins-In Pads-Out RPads DPads DPads-Out 
				     Misc-Out Misc-Pla CCode-Out SNI-Out OpPla-Out RegMux-Out 
				     ClockPla DataPath-Out DataPath-Op DataPathD2Set Euop-CCodes 
				     CondA))

(RPAQQ compnodes NIL)

(RPAQQ ionodes (RPads DPads DPads-Out CondA))
(* * Emulator Support Functions)

(DEFINEQ

(SetSimClocks
  [LAMBDA (noprint)                                          (* rtk "17-Dec-86 16:48")
    (if DoTransSim
	then (if DoSimLog
		   then (PRINTOUT SimLog " pPre/pClock/Op/Micro: " pPre pClock pOp pMicro 
				    " *Op/*Micro: "
				    *Op *Micro T))
	       (SetTransSim)
	       (steps)
	       (DrawClockPoints 5 5)
	       (if (AND DoSimLog (NOT noprint))
		   then (Print01List plist))
	       (IF MakeTestVectors
		   THEN (SetWireStateList))
	       (if BreakOnAll
		   then (BREAK1 NIL T (Clocks)
				    NIL])

(SetupTransSim
  [LAMBDA NIL                                                (* rtk "18-Dec-86 10:34")
    (SetClocks 0 0)
    (clearinputs)
    (queueall)
    (ExecuteTrans)
    (setall CLOW)
    (steps)
    (IF MakeTestVectors
	THEN (MakeWireStateList])

(SetTransSim
  [LAMBDA NIL                                                (* edited: "11-Sep-86 15:15")
    (ExecuteTrans])

(ExecuteTrans
  [LAMBDA NIL                                                (* edited: "11-Sep-86 15:16")
    (SetFns)
    (if recordchanges
	then (PRINTOUT T "  " T])

(CompTransSim
  [LAMBDA NIL                                                (* edited: "12-Sep-86 15:56")
    (PROG ((wereerrors NIL))
	    [if (GREATERP Cycles (IPLUS ResetCycle 2))
		then [if (TF *Clock)
			   then [ExecuteTransComp (INTERSECTION compsections
								      (QUOTE (Rom-Out RegMux-Out 
											ClockPla 
											Misc-Out 
											Misc-Pla 
										     DataPath-Out 
											PadLogic 
											Pads-Out 
											VMM-Out)))
						      (INTERSECTION compsections
								      (QUOTE (RPads DPads DPads-Out 
										    DataPathD2Set]
				  (if (AND (NOT (FMEMB (QUOTE DataPathD2Set)
							       ionodes))
					       (FMEMB (QUOTE DataPathD2Set)
							compsections))
				      then (ExecuteTransComp (QUOTE (DataPathD2Set]
		       (if (TF *Op)
			   then (ExecuteTransComp (INTERSECTION compsections
								      (QUOTE (OpPla-Out CCode-Out 
											  SNI-Out 
										      DataPath-Op)))
						      (INTERSECTION compsections (QUOTE (CondA]
	    (IF wereerrors
		THEN (SETQ ErrorCycles (ADD1 ErrorCycles])

(ExecuteTransComp
  [LAMBDA (compsectionlist iolist noerrors)                  (* edited: "12-Sep-86 15:55")
    (if (NOT noerrors)
	then (PRINTOUT T (QUOTE Comparing)
			 compsectionlist " & " iolist T))
    (if iolist
	then (PRINTOUT T "RPADENB~ " RPADENB~ " DPADENB~ " DPADENB~ T))
    (PROG ((haderrors NIL)
	     (complist NIL))
	    (CompFns)
	    (SETQ wereerrors (OR wereerrors haderrors))
	    (if haderrors
		then (if errortracefile
			   then (PRINTOUT errortracefile 
					    "****************** Errors ******************"
					    T)
				  (for i in complist do (if (NEQ (CADR i)
									   (CADDR i))
								  then (SETQ ErrorCount
									   (ADD1 ErrorCount))
									 (PRINTOUT errortracefile
										   (CAR i)
										   ": "
										   (CADR i)
										   " ← "
										   (CADDR i)
										   T)))
			 else (BREAK1 NIL T (Compare Errors)
					  NIL)))
	    (RETURN complist])

(MakeTransCompList
  [LAMBDA NIL                                                (* edited: "15-Sep-86 14:50")
    (SETQ pPre 0)
    (SETQ pClock 0)
    (SETQ pOp 0)
    (SETQ pMicro 0)
    (SETQ pFirstCy 0)
    (SETQ pSecondCy 0)
    (SETQ #OpLength=0 0)
    (SETQ #$OpLength=0 0)
    (SETQ pMicro&NewOp 0)
    (SETQ @Read 0)
    (SETQ @Write 0)
    (SETQ *Read 0)
    (SETQ *Write 0)
    (SETQ @MemRead 0)
    (SETQ @MemWrite 0)
    (SETQ *FirstCy 0)
    (SETQ *SecondCy 0)
    (SETQ #WriteOk 0)
    (SETQ $WriteOk 0)
    (SETQ *MemRead 0)
    (SETQ *DoReset 0)
    (SETQ @WriteOctal 0)
    (SETQ D1 0)
    (SETQ D2 0)
    (SETQ RE 0)
    (SETQ RO 0)
    (SETQ RD 0)
    (SETQ PC 0)
    (SETQ @RegAddr~ 0)
    (SETQ @RegCxt~ 0)
    (SETQ $NewOp 0)
    (SETQ $OpLength=0 0)
    [SETQ nodemapnames (APPEND [transbits (QUOTE ((RE Dswap-In 32 eDat)
							   (RO Dswap-In 32 oDat)
							   (#OPCODE DataPath-Op 8 #Opcode)
							   (VAD' DataPath-Out 24 (LNot @VirAddr))
							   (VAD DataPath-Out 24 @VirAddr)
							   (D1 DataPath-Out 32 D1)
							   (D2 DataPathD2Set 32 D2)
							   (#IBUFN DataPath-Out 8 #IBufN)
							   (#UK Rom-Out 9 (#MIR (MI K)))
							   (#UARG' Rom-Out 2 (#MIR (MI Arg')))
							   (#URADDR Rom-Out 3 (#MIR (MI Raddr)))
							   (#UWADDR Rom-Out 3 (#MIR (MI Waddr)))
							   (#URCXT Rom-Out 3 (#MIR (MI RCxt)))
							   (#UWCXT Rom-Out 3 (#MIR (MI WCxt)))
							   (#$OPCODE RegMux-Out 8 #$Opcode)
							   (#TOS RegMux-Out 6 #Tos)
							   (#TOS' RegMux-Out 6 #Tos')
							   (#ARG' RegMux-Out 6 #Arg')
							   (#ARG RegMux-Out 8 #Arg)
							   (#ARG2 RegMux 6 #Arg2)
							   (#NEWARG2~ RegMux 6 #NewArg2~)
							   (#NEWARG~ RegMux-Out 8 #NewArg~)
							   (#NEWTOS~ RegMux-Out 6 #NewTos~)
							   (@REGADDR~ RegMux-Out 6 @RegAddr~)
							   (@REGCXT~ RegMux-Out 3 @RegCxt~)
							   (@MUXRDSEL~ RegMux-Out 8 @MuxRdSel~)
							   (#TOPCXT RegMux-Out 2 #TopCxt)
							   (#BOTCXT RegMux-Out 2 #BotCxt)
							   (#BOT+1CXT RegMux-Out 2 #Bot+1Cxt)
							   (#BOT-1CXT RegMux-Out 2 #Bot-1Cxt)
							   (#TOP+1CXT RegMux-Out 2 #Top+1Cxt)
							   (#TOP-1CXT RegMux-Out 2 #Top-1Cxt)
							   (#NEWBOTCXT~ RegMux-Out 2 #NewBotCxt~)
							   (#NEWTOPCXT~ RegMux-Out 2 #NewTopCxt~)
							   (@QUAD ClockPla 2 @Quad)
							   (#UNEWTOS Rom-Out 3 (#MIR (MI NewTos)))
							   (#UNEWTOPCXT Rom-Out 2
									(#MIR (MI NewTopCxt)))
							   (#UNEWARG2 Rom-Out 2 (#MIR (MI NewArg2)))
							   (#UNEWARG Rom-Out 3 (#MIR (MI NewArg)))
							   (#UNEWBOTCXT Rom-Out 2
									(#MIR (MI NewBotCxt)))
							   ($OPLENGTH OpPla-Out 3 $OpLength)
							   (#STARTADDR OpPla-Out 8 #StartAddr)
							   (#UCONDCODE Rom-Out 7 (#MIR (MI CondCode)))
							   (#UCYCLE Rom-Out 3 (#MIR (MI Cycle)))
							   (#UEUOP Rom-Out 6 (#MIR (MI EUop)))
							   (#UMISC Rom-Out 5 (#MIR (MI Misc)))
							   (#UMUXRDSEL Rom-Out 3 (#MIR (MI MuxRdSel)))
							   (#UNEXTINSTA Rom-Out 9
									(#MIR (MI NextInstA)))
							   (#UNEXTINSTB Rom-Out 9
									(#MIR (MI NextInstB)))
							   (#UPC SNI-Out 8 #uPC)
							   (#URD1ADDR Rom-Out 2 (#MIR (MI RD1addr)))
							   (#URD2ADDR Rom-Out 3 (#MIR (MI RD2addr)))
							   (#UW2ADDR Rom-Out 3 (#MIR (MI W2addr)))
							   (#UTAG Rom-Out 2 (#MIR (MI Tag)))
							   (RADDR VMM-Out 12 @RAddr)
							   (XRADDR RPads 10 @RAddr]
				   [packname (QUOTE ((RD- DPads -32 39 0 RD]
				   (QUOTE ((PHIMICRO ClockPla pMicro)
					      (PHIMICRO&WRITEOK ClockPla pMicro&WriteOk)
					      (PHIMICRO&NEWOP ClockPla pMicro&NewOp)
					      (PHIOP ClockPla pOp)
					      (PHIPRE ClockPla pPre)
					      (PHIPRE7 ClockPla pPre)
					      (PHICLOCK ClockPla pClock)
					      (PHIREAD ClockPla pRead)
					      (PHIWRITE ClockPla pWrite)
					      (PHIFIRSTCY ClockPla pFirstCy)
					      (PHISECONDCY ClockPla pSecondCy)
					      (PHIMEMREAD ClockPla pMemRead)
					      (@READ ClockPla @Read)
					      (@WRITE ClockPla @Write)
					      (@MEMREAD ClockPla @MemRead)
					      (@MEMWRITE ClockPla @MemWrite)
					      (@WRITEOCTAL~ ClockPla (((Not @WriteOctal)
							      0 1 0)))
					      (+DORESET ClockPla *DoReset)
					      (+WRITE-VMM ClockPla *Write-VMM)
					      (+MEMCY ClockPla *MemCy)
					      (+CASH ClockPla *CasH)
					      (+MEMDIR ClockPla *MemDir)
					      (+READ ClockPla *Read)
					      (+WRITE ClockPla *Write)
					      (+MEMREAD ClockPla *MemRead)
					      (+SECONDCY ClockPla *SecondCy)
					      (+FIRSTCY ClockPla *FirstCy)
					      ($WRITEOK ClockPla $WriteOk)
					      ($NEWOP ClockPla $NewOp)
					      (@#FAULT ClockPla @#Fault)
					      (XCLOCKD35 Pads-In ClkD35)
					      (XCLOCKD10 Pads-In ClkD10)
					      (XCLOCK Pads-In (((Not pClock)
							0 1 0)))
					      (XPRE Pads-In (((Not pPre)
						      0 1 0)))
					      (XHOLD Pads-In Hold)
					      (XINTERRUPT Pads-In Interrupt)
					      (XREFRESH Pads-In Refresh)
					      (XRESET Pads-In Reset)
					      (XWE~ RPads-Out WE~)
					      (PRECHARGE Pins-In (((Not pPre)
							   0 1 0)))
					      (CLOCK Pins-In (((Not pClock)
							 0 1 0)))
					      (HOLD Pins-In Hold)
					      (INTERRUPT Pins-In Interrupt)
					      (REFRESH Pins-In Refresh)
					      (RESET Pins-In Reset)
					      (#ARG=0 RegMux-Out (((Eval (OZ (EQ #Arg 0)))
							0 1 0)))
					      (#ARG=ARG2 RegMux (((Eval (OZ (EQ #Arg #Arg2)))
							   0 1 0)))
					      (#FRAMESEMPTY RegMux-Out #FramesEmpty)
					      (#FRAMESFULL RegMux-Out #FramesFull)
					      (#UTOS' Rom-Out (((#MIR (MI Tos'))
							0 1 0)))
					      (#$REFCNT Misc-Out #$RefCnt)
					      (#$STACKREFILL Misc-Out #$StackRefill)
					      (#INTERRUPT Misc-Out #Interrupt)
					      (@INITIALREFILL Misc-Out @InitialRefill)
					      (#$OPLENGTH=0 Misc-Out #OpLength=0)
					      ($OPLENGTH=0 Misc-Out $OpLength=0)
					      (#REFRESH Misc-Out #Refresh)
					      (#$OUTPUTINTERRUPT Misc-Out #$OutputInt)
					      ($HOLD Misc-Out $Hold)
					      (@RESET Misc-Out @Reset)
					      (#$INTERRUPTENABLE Misc-Out #$InterruptEnable)
					      (@RESET-VMM Misc-Out @Reset-VMM)
					      (@WRITEOCTAL Misc-Out @WriteOctal)
					      (@WRITEOCTAL~ Misc-Pla (((Not @WriteOctal)
							      0 1 0)))
					      (@RDMUXSEL DataPath-Set @RdMuxSel)
					      (#CONDA DataPath-Op #CondA)
					      (#CONTREFILL DataPath-Out #ContRefill)
					      (COUT Euop-CCodes @carry)
					      (GT Euop-CCodes @greaterp)
					      (OFL Euop-CCodes @overflow)
					      (#FORCENEWOP OpPla-Out #ForceNewOp)
					      (#MODSTARTADDR OpPla-Out #ModStartAddr)
					      (#MODSTARTADDR~ OpPla-Out (((Not #ModStartAddr)
								0 1 0)))
					      (#NEWOP CCode-Out #NewOp)
					      (#WRITEOK CCode-Out #WriteOk)
					      (#REFILLRQ CCode-Out #RefillRq)
					      (#SELNEXTINSTA CCode-Out #SelNextInstA)
					      (#SELNEXTINSTB CCode-Out #SelNextInstB)
					      (#UWDDR-0 Rom-Out (((#MIR (MI Waddr))
							  0 1 0)))
					      (#UCWRITE Rom-Out (((#MIR (MI CWrite))
							  0 1 0)))
					      (#UCWRITE~ Rom-Out (((Not (#MIR (MI CWrite)))
							   0 1 0)))
					      (#UDSWAP Rom-Out (((#MIR (MI Dswap))
							 0 1 0)))
					      (#FAULT VMM-Out #Fault)
					      (#VMREFILL VMM-Out #VMRefill)
					      (SELRAS/CAS~ PadLogic @Ras-Cas~)
					      (RAS~-0 PadLogic RAS-0~)
					      (RAS~-1 PadLogic RAS-1~)
					      (RAS~-2 PadLogic RAS-2~)
					      (RAS~-3 PadLogic RAS-3~)
					      (WE~ PadLogic WE~)
					      (CAS~ PadLogic CAS~)
					      (XCAS~ RPads CAS~)
					      (XHOLDA RPads ((0 0 1 0)))
					      (XOUTPUTINTERRUPT RPads ((0 0 1 0)))
					      (XWE~ RPads WE~)
					      (XRAS~-0 RPads RAS-0~)
					      (XRAS~-1 RPads RAS-1~)
					      (XRAS~-2 RPads RAS-2~)
					      (XRAS~-3 RPads RAS-3~]
    [SETQ nodemaplist (for i in nodemapnames 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)))
    (SETQ DFNFLG T)
    (MakeCompFns)
    (MakeSetFns])
)
(* * Value Setup & Compare Functions)

(DEFINEQ

(MakeSetFns
  [LAMBDA NIL                                                (* rtk "17-Sep-86 10:44")
    (PROG [(SetFns (for i in nodemaplist when (AND (findnode (fetch (node name)
									    of (CAR i)))
							     (OR (FMEMB (CADR i)
									    setsections)
								   (FMEMB (CADR i)
									    ionodes)))
			collect (BQUOTE (SetOneNode [findnodemacro (QUOTE
									   ,
									   (fetch (node name)
										  of
										  (CAR i]
							  (QUOTE , (CADR i))
							  ,
							  (if (LISTP (CADDR i))
							      then (LIST (QUOTE ConcatBits)
									     (LIST (QUOTE QUOTE)
										     (CADDR i)))
							    else (LIST (QUOTE EvalElt)
									   (LIST (QUOTE QUOTE)
										   (CADDR i]
	    (SETQ SetFns (APPEND (LIST (QUOTE LAMBDA)
					     NIL)
				     SetFns))
	    (PUTD (QUOTE SetFns)
		    SetFns)
	    (COMPILE1 (QUOTE SetFns)
			SetFns T NIL])

(SetOneNode
  [LAMBDA (n section emulatorval)                            (* edited: "11-Sep-86 15:37")
    (PROG [(simulatorval (ELTX potto01array (fetch (node npot) of n]
	    (if (FMEMB section ionodes)
		then (SELECTQ section
				  (RPads NIL)
				  (DPads (if (TF DPADENB~)
					     then (setin n (ELTX 01topotarray emulatorval))
					   else (clrin n)))
				  (DataPathD2Set (if (OR (TF (LAND @RdMuxSel
									   (LAND *Read pClock)))
							     (TF (LAND *MemRead pClock)))
						     then (if (EQ (fetch (node name)
									   of n)
									(QUOTE D2-0))
								then (PRINTOUT T "Setting D2-0: " 
										 D2 T))
							    (setin n (ELTX 01topotarray 
									       emulatorval))
						   else (if (EQ (fetch (node name)
									 of n)
								      (QUOTE D2-0))
							      then (PRINTOUT T "Clearing D2-0" T))
							  (clrin n)))
				  (clrin n))
	      elseif (OR (NEQ emulatorval simulatorval)
			     (NOT (fetch (node input) of n)))
		then (if recordchanges
			   then (PRINTOUT T (fetch (node name) of n)
					    ": " emulatorval "  "))
		       (setin n (ELTX 01topotarray emulatorval])

(MakeCompFns
  [LAMBDA NIL                                                (* rtk "17-Sep-86 10:45")
    (PROG [(CompFns (for i in nodemaplist when (AND (findnode (fetch (node name)
									     of (CAR i)))
							      (FMEMB (CADR i)
								       compsections))
			 collect (BQUOTE (CompOneNode [findnodemacro
							      (QUOTE , (fetch (node name)
										of
										(CAR i]
							    (QUOTE , (CADR i))
							    ,
							    (LIST (QUOTE QUOTE)
								    (fetch (node name)
								       of (CAR i)))
							    ,
							    (if (LISTP (CADDR i))
								then (LIST (QUOTE ConcatBits)
									       (LIST (QUOTE
											 QUOTE)
										       (CADDR
											 i)))
							      else (LIST (QUOTE EvalElt)
									     (CADDR i]
	    (SETQ CompFns (APPEND (LIST (QUOTE LAMBDA)
					      NIL)
				      CompFns))
	    (PUTD (QUOTE CompFns)
		    CompFns)
	    (COMPILE1 (QUOTE CompFns)
			CompFns T NIL])

(CompOneNode
  [LAMBDA (n section emulatorname emulatorval)               (* edited: "11-Sep-86 16:04")
    (PROG (simulatorval)
	    (if (FMEMB section iolist)
		then (SELECTQ section
				  (CondA (if (NEQ 0 (LOGAND (fetch (MI CondCode)
								     of #MIR)
								  32))
					     then (RETURN)))
				  (RPads (if (TF RPADENB~)
					     then (RETURN)))
				  (DPads (if (TF DPADENB~)
					     then (RETURN)))
				  (DPads-Out (if (TF DPADENB~)
						 then (RETURN)))
				  (DataPathD2Set (if (fetch (node input) of n)
						     then (RETURN)))
				  (RETURN)))
	    (if (FMEMB section compsectionlist)
		then (SETQ simulatorval (ELTX potto01array (fetch (node npot) of n)))
		       (if (OR noerrors errortracefile)
			   then (SETQ complist (CONS (LIST (fetch (node name) of n)
								   simulatorval emulatorval)
							   complist)))
		       (if (AND (NEQ emulatorval simulatorval)
				    (NOT noerrors))
			   then (SETQ haderrors T)
				  (PRINTOUT T .FONT (QUOTE (GACHA 10 BOLD))
					    "*** Mismatch: "
					    (fetch (node name) of n)
					    " = " simulatorval "  " emulatorname " = " emulatorval 
					    .FONT (QUOTE (GACHA 10 STANDARD))
					    T])
)
(DEFINEQ

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

(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])
)
(DEFINEQ

(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])

(transbits
  [LAMBDA (NodeNameList)                                     (* rtk " 8-Jul-86 14:29")

          (* * List of form (NodeName Type #Bits EmulatorName))


    (for i in NodeNameList join (for j from 0 to (DIFFERENCE (CADDR i)
									   1)
					 collect (LIST (PACK (APPEND (UNPACK (CAR i))
									     (LIST (QUOTE -)
										     j)))
							   (CADR i)
							   (LIST (LIST (CADDDR i)
									   0 1 j])

(clock
  [LAMBDA (clocklist)                                        (* edited: " 3-Sep-86 15:42")
    (if (NOT (LISTP clocklist))
	then (SETQ clocklist (LIST clocklist)))
    (SETQ pre (FMEMB (QUOTE pre)
			 clocklist))
    (SETQ clk (FMEMB (QUOTE clock)
			 clocklist))
    (SETQ op (FMEMB (QUOTE op)
			clocklist))
    (SETQ micro (FMEMB (QUOTE micro)
			   clocklist))
    (SETQ firstcy (FMEMB (QUOTE firstcy)
			     clocklist))
    (SETQ secondcy (FMEMB (QUOTE secondcy)
			      clocklist))
    (SETQ micronewop (FMEMB (QUOTE micro&newop)
				clocklist))
    (SETQ microwriteok (FMEMB (QUOTE micro&writeok)
				  clocklist))
    (SETQ newop (FMEMB (QUOTE newop)
			   clocklist))
    (PRINTOUT T "Clocks: " clocklist T)
    (setinputl (QUOTE PHIOP))
    (setinputl (QUOTE PHICLOCK))
    (setinputl (QUOTE PHIMICRO))
    (setinputl (QUOTE PHIPRE))
    (setinputl (QUOTE PHIPRE7))
    (setinputl (QUOTE PHIFIRSTCY))
    (setinputl (QUOTE PHISECONDCY))
    (setinputl (QUOTE PHIMICRO&NEWOP))
    (setinputl (QUOTE PHIMICRO&WRITEOK))
    (steps)
    (DrawClockPoints 5 5)
    (if pre
	then (PRINTOUT T "pPre" T)
	       (setinputh (QUOTE PHIPRE))
	       (setinputh (QUOTE PHIPRE7)))
    (if clk
	then (PRINTOUT T "pClock" T)
	       (setinputh (QUOTE PHICLOCK)))
    (if op
	then (PRINTOUT T "pOp" T)
	       (setinputh (QUOTE PHIOP)))
    (if firstcy
	then (PRINTOUT T "firstcy" T)
	       (setinputh (QUOTE PHIFIRSTCY)))
    (if micro
	then (PRINTOUT T "pMicro" T)
	       (setinputh (QUOTE PHIMICRO)))
    (if secondcy
	then (PRINTOUT T "secondcy" T)
	       (setinputh (QUOTE PHISECONDCY)))
    (if microwriteok
	then (PRINTOUT T "pMicro&Writeok" T)
	       (setinputh (QUOTE PHIMICRO&WRITEOK)))
    (if micronewop
	then (PRINTOUT T "pMicro&Newop" T)
	       (setinputh (QUOTE PHIMICRO&NEWOP)))
    (if newop
	then (PRINTOUT T "$Newop" T)
	       (setinputh (QUOTE $NEWOP)))
    (steps)
    (DrawClockPoints 5 5)
    (setinputl (QUOTE PHIOP))
    (setinputl (QUOTE PHICLOCK))
    (setinputl (QUOTE PHIMICRO))
    (setinputl (QUOTE PHIPRE))
    (setinputl (QUOTE PHIPRE7))
    (setinputl (QUOTE PHIFIRSTCY))
    (setinputl (QUOTE PHISECONDCY))
    (setinputl (QUOTE PHIMICRO&NEWOP))
    (setinputl (QUOTE PHIMICRO&WRITEOK))
    (if newop
	then (setinputl (QUOTE $NEWOP)))
    (DrawClockPoints 5 5])

(setclocks
  [LAMBDA (clocks)                                           (* mar: " 8-Aug-86 16:43")
    (FOR i IN clocks DO (clock i])

(makeunknownlist
  [LAMBDA (sectionlist)                                      (* rtk " 3-Sep-86 09:52")
    (IF (NOT (LISTP sectionlist))
	THEN (SETQ sectionlist (LIST sectionlist)))
    (for i in nodemapnames when (FMEMB (CADR i)
					       sectionlist)
       collect i])

(showunknowns
  [LAMBDA (sectionlist)                                      (* edited: " 3-Sep-86 15:18")
    (for i in (makeunknownlist sectionlist) do (PRINTOUT T i T])
)
(DECLARE: EVAL@COMPILE 
(DEFMACRO findnodemacro x (BQUOTE (findnode \, x)))
)
(PUTPROPS SIMCOMPARES COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1503 13433 (SetSimClocks 1513 . 2123) (SetupTransSim 2125 . 2423) (SetTransSim 2425 . 
2560) (ExecuteTrans 2562 . 2748) (CompTransSim 2750 . 3954) (ExecuteTransComp 3956 . 4993) (
MakeTransCompList 4995 . 13431)) (13478 18419 (MakeSetFns 13488 . 14553) (SetOneNode 14555 . 15893) (
MakeCompFns 15895 . 17011) (CompOneNode 17013 . 18417)) (18420 19813 (setupsimvals 18430 . 18676) (
setsimvals 18678 . 19811)) (19814 24890 (packname 19824 . 20907) (transbits 20909 . 21424) (clock 
21426 . 24202) (setclocks 24204 . 24361) (makeunknownlist 24363 . 24693) (showunknowns 24695 . 24888))
)))
STOP