DIRECTORY Buttons USING [Create], Containers USING [ChildXBound, ChildYBound], Convert USING [CardFromRope, Error, IntFromRope], FS USING [SetKeep], IO, Labels USING [Create], PopUpSelection USING [Request], Rules USING [Create], TypeScript USING [ChangeLooks, Create], ViewerIO USING [CreateViewerStreams], ViewerTools USING [GetContents], SoftcardOps, SoftcardToolPrivate; SoftcardToolUtilsImpl: CEDAR PROGRAM IMPORTS Buttons, Containers, Convert, FS, IO, Labels, PopUpSelection, Rules, TypeScript, ViewerIO, ViewerTools, SoftcardOps, SoftcardToolPrivate EXPORTS SoftcardToolPrivate = BEGIN OPEN IO, SoftcardToolPrivate; InitArrays: PUBLIC PROC = { freqSelectArray[0] _ ["stopped", 0]; freqSelectArray[1] _ ["6.6 mhz", 1]; freqSelectArray[2] _ ["10 mhz", 2]; freqSelectArray[3] _ ["5 mhz", 3]; euSelectArray[0] _ ["left", 0]; euSelectArray[1] _ ["right", 1]; euSelectArray[2] _ ["st2A", 2]; euSelectArray[3] _ ["st2B", 3]; euSelectArray[4] _ ["st3A", 4]; euSelectArray[5] _ ["r2B", 7]; euSelectArray[6] _ ["r3A", 8]; euSelectArray[7] _ ["r3B", 9]; euSelectArray[8] _ ["dataIn", 15]; }; GetAsInt: PUBLIC PROC[who: Viewer] RETURNS[val: INT] = { rope: ROPE = ViewerTools.GetContents[who]; val _ -1; val _ Convert.IntFromRope[rope ! Convert.Error => CONTINUE]; }; GetAsCard: PUBLIC PROC[who: Viewer] RETURNS[val: LONG CARDINAL] = { rope: ROPE = ViewerTools.GetContents[who]; val _ LAST[LONG CARDINAL]; val _ Convert.CardFromRope[rope ! Convert.Error => CONTINUE]; }; ReadControlBits: PUBLIC ClickProc = { which: SoftcardOps.ControlBit; name: ROPE; val: BOOL; [which, name] _ SelectControlBit[]; IF name = NIL THEN RETURN; val _ SoftcardOps.ReadControlBit[which]; tsOut.PutF[" %g is %g\n", IO.rope[name], IO.bool[val] ]; }; SetControlBits: PUBLIC ClickProc = { which: SoftcardOps.ControlBit; name: ROPE; prev: BOOL; [which, name] _ SelectControlBit[]; IF name = NIL THEN RETURN; prev _ SoftcardOps.SetControlBit[which]; IF which = dragonRun THEN SetDragonStateLabelButton[running]; tsOut.PutF[" %g has been set: previous value was %g\n", IO.rope[name], IO.bool[prev] ]; }; ResetControlBits: PUBLIC ClickProc = { which: SoftcardOps.ControlBit; name: ROPE; prev: BOOL; [which, name] _ SelectControlBit[]; IF name = NIL THEN RETURN; prev _ SoftcardOps.ResetControlBit[which]; IF which = dragonRun THEN SetDragonStateLabelButton[stopped]; tsOut.PutF[" %g has been reset: previous value was %g\n", IO.rope[name], IO.bool[prev] ]; }; controlBitList: LIST OF ROPE = LIST[ "resetDragon", "notInterruptDragonToIOP", "interruptDragonToMesa", "dragonRun", "dragonStep", "writeParity", "virtualMemAccessIOP", "virtualMemAccessMesa", "virtualMemAccessIFU", "virtualMemAccessEU", "resetIFUCacheStateMachine", "notResetIFUCache", "ifuBreakpointEnabled", "resetEUCacheStateMachine", "notResetEUCache", "euBreakpointEnabled", "iopIntToDragon", "mesaIntToDragon", "notResetClock"]; SelectControlBit: PROC RETURNS[SoftcardOps.ControlBit, ROPE] = { which: INT = PopUpSelection.Request[ header: "ControlBit", choice: controlBitList]; SELECT which FROM 1 => RETURN[resetDragon, "resetDragon"]; 2 => RETURN[interruptDragonToIOP, "interruptDragonToIOP"]; 3 => RETURN[interruptDragonToMesa, "interruptDragonToMesa"]; 4 => RETURN[dragonRun, "dragonRun"]; 5 => RETURN[dragonStep, "dragonStep"]; 6 => RETURN[writeParity, "writeParity"]; 7 => RETURN[virtualMemAccessIOP, "virtualMemAccessIOP"]; 8 => RETURN[virtualMemAccessMesa, "virtualMemAccessMesa"]; 9 => RETURN[virtualMemAccessIFU, "virtualMemAccessIFU"]; 10 => RETURN[virtualMemAccessEU, "virtualMemAccessEU"]; 11 => RETURN[resetIFUCacheStateMachine, "resetIFUCacheStateMachine"]; 12 => RETURN[notResetIFUCache, "notResetIFUCache"]; 13 => RETURN[ifuBreakpointEnabled, "ifuBreakpointEnabled"]; 14 => RETURN[resetEUCacheStateMachine, "resetEUCacheStateMachine"]; 15 => RETURN[notResetEUCache, "notResetEUCache"]; 16 => RETURN[euBreakpointEnabled, "euBreakpointEnabled"]; 17 => RETURN[iopIntToDragon, "iopIntToDragon"]; 18 => RETURN[mesaIntToDragon, "mesaIntToDragon"]; 19 => RETURN[notResetClock, "notResetClock"]; ENDCASE => RETURN[resetDragon, NIL]; }; ReadStatusBits: PUBLIC ClickProc = { which: SoftcardOps.StatusBit; name: ROPE; val: BOOL; [which, name] _ SelectStatusBit[]; IF name = NIL THEN RETURN; val _ SoftcardOps.ReadStatusBit[which]; tsOut.PutF[" %g is %g\n", IO.rope[name], IO.bool[val] ]; }; ResetStatusBits: PUBLIC ClickProc = { which: SoftcardOps.StatusBit; name: ROPE; prev: BOOL; [which, name] _ SelectStatusBit[]; IF name = NIL THEN RETURN; IF which = dOutIFU OR which = dOutEU OR which = phaseA THEN tsOut.PutF["Cannot reset %g\n", IO.rope[name] ] ELSE { prev _ SoftcardOps.ResetStatusBit[which]; tsOut.PutF[" %g has been reset: previous value was %g\n", IO.rope[name], IO.bool[prev] ]; }; }; statusBitList: LIST OF ROPE = LIST[ "dOutIFU", "dOutEU", "phaseA", "periodicIntToDragon", "notMemoryError", "euBkptReached", "ifuBkptReached", "mapError"]; SelectStatusBit: PROC RETURNS[SoftcardOps.StatusBit, ROPE] = { which: INT = PopUpSelection.Request[ header: "StatusBit", choice: statusBitList]; SELECT which FROM 1 => RETURN[dOutIFU, "dOutIFU"]; 2 => RETURN[dOutEU, "dOutEU"]; 3 => RETURN[phaseA, "phaseA"]; 4 => RETURN[periodicIntToDragon, "periodicIntToDragon"]; 5 => RETURN[notMemoryError, "notMemoryError"]; 6 => RETURN[euBkptReached, "euBkptReached"]; 7 => RETURN[ifuBkptReached, "ifuBkptReached"]; 8 => RETURN[mapError, "mapError"]; ENDCASE => RETURN[dOutIFU, NIL]; }; BuildMiscButtons: PUBLIC PROC[topViewer, sibx: Viewer, tsLogFile: ROPE] = { y: INTEGER; sib: Viewer _ sibx; sib _ Buttons.Create[ info: [ name: "ResetBoard", parent: topViewer, wx: leftEdge, wy: sib.wy + sib.wh + 2*betweenHeight, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: ResetProc ]; sib _ Buttons.Create[ info: [ name: "ReadClock", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: ReadClockProc ]; sib _ Buttons.Create[ info: [ name: "ResetClock", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: ResetClockProc ]; sib _ Buttons.Create[ info: [ name: "EUPBusData", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: EUPBusDataProc ]; sib _ Buttons.Create[ info: [ name: "IFUPBusData", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: IFUPBusDataProc ]; sib _ Buttons.Create[ info: [ name: "EUPBusCmd", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: EUPBusCmdProc ]; sib _ Buttons.Create[ info: [ name: "IFUPBusCmd", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: IFUPBusCmdProc ]; sib _ Labels.Create[ info: [ name: "CacheStateMachines", parent: topViewer, wx: leftEdge, wy: sib.wy + sib.wh + betweenHeight, wh: entryHeight, border: FALSE, scrollable: FALSE] ]; sib _ Buttons.Create[ info: [ name: "ResetIFU", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: ResetIFUCacheStateProc ]; sib _ Buttons.Create[ info: [ name: "ResetEU", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: ResetIFUCacheStateProc ]; sib _ Buttons.Create[ info: [ name: "DisableEUCache", parent: topViewer, wx: leftEdge, wy: sib.wy + sib.wh + betweenHeight, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: DisableEUCacheProc ]; sib _ Buttons.Create[ info: [ name: "DisableIFUCache", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: DisableIFUCacheProc ]; sib _ Buttons.Create[ info: [ name: "FlushEUCache", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: FlushEUCacheProc ]; sib _ Buttons.Create[ info: [ name: "FlushIFUCache", parent: topViewer, wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight, border: TRUE, scrollable: FALSE], proc: FlushIFUCacheProc ]; sib _ Rules.Create[ info: [parent: topViewer, wy: sib.wy+sib.wh+1, ww: topViewer.ww, wh: 2]]; Containers.ChildXBound[topViewer, sib]; y _ sib.wy+sib.wh+4; tsViewer _ TypeScript.Create[ info: [parent: topViewer, ww: sib.cw, wy: y, wh: topViewer.ch - y, border: FALSE] ]; TypeScript.ChangeLooks[tsViewer, 'f]; Containers.ChildYBound[topViewer, tsViewer]; Containers.ChildXBound[topViewer, tsViewer]; tsOut _ ViewerIO.CreateViewerStreams[NIL, tsViewer, tsLogFile, FALSE].out; FS.SetKeep[tsLogFile, 6]; tsOut.PutF["\tTypescript on file: %g\n", IO.rope[tsLogFile]]; tsOut.Flush[]; }; ResetProc: ClickProc = { tsOut.PutRope[" Not yet implemented - ResetDragon\n"] }; ReadClockProc: ClickProc = { val: LONG CARDINAL = SoftcardOps.ReadClock[]; tsOut.PutF[" Current clock reading is: %xH\n", IO.card[val] ]; }; EUPBusDataProc: ClickProc = { val: LONG CARDINAL = SoftcardOps.ReadEUPBusData[]; tsOut.PutF[" EUPBusData: %xH\n", IO.card[val] ]; }; IFUPBusDataProc: ClickProc = { val: LONG CARDINAL = SoftcardOps.ReadIFUPBusData[]; tsOut.PutF[" IFUPBusData: %xH\n", IO.card[val] ]; }; EUPBusCmdProc: ClickProc = { val: SoftcardOps.EUPBusCmd = SoftcardOps.ReadEUCmd[]; tsOut.PutF[" EUPBusCmd: [userMode: %g, unspecifiedAsYet: %xH]\n", IO.bool[val.userMode], IO.int[val.unspecifiedAsYet] ]; }; IFUPBusCmdProc: ClickProc = { val: SoftcardOps.IFUPBusCmd = SoftcardOps.ReadIFUCmd[]; tsOut.PutF[" IFUPBusCmd: %g\n", IO.rope[IF val = noAccess THEN "noAccess" ELSE "access"] ]; }; ResetEUCacheStateProc: ClickProc = { SoftcardOps.ResetEUCacheStateMachine[]; tsOut.PutRope[" ResetEUCacheStateMachine has been done\n"]; }; ResetIFUCacheStateProc: ClickProc = { SoftcardOps.ResetIFUCacheStateMachine[]; tsOut.PutRope[" ResetIFUCacheStateMachine has been done\n"]; }; ResetClockProc: ClickProc = { SoftcardOps.ResetClock[]; tsOut.PutRope[" ResetClock has been done\n"]; }; DisableEUCacheProc: ClickProc = { SoftcardOps.DisableEUCache[]; tsOut.PutRope[" DisableEUCache has been done\n"]; }; DisableIFUCacheProc: ClickProc = { SoftcardOps.DisableIFUCache[]; tsOut.PutRope[" DisableIFUCache has been done\n"]; }; FlushEUCacheProc: ClickProc = { SoftcardOps.FlushEUCache[]; tsOut.PutRope[" FlushEUCache has been done\n"]; }; FlushIFUCacheProc: ClickProc = { SoftcardOps.FlushIFUCache[]; tsOut.PutRope[" FlushIFUCache has been done\n"]; }; END. ’SoftcardToolUtilsImpl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Willie-Sue, February 20, 1987 3:04:16 pm PST * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * builds the miscellaneous buttons - sib is the last button created line 1 of miscellaneous buttons line 2 of miscellaneous line 8 of Buttons - miscellaneous the rest of the viewer - typescript Κ δ˜codešœ™Kšœ<™šœœ˜$Jšœ˜J˜—šœ˜Jšœœ˜!Jšœœ˜Jšœœ˜Jšœœ-˜9Jšœœ#˜/Jšœœ!˜-Jšœœ#˜/Jšœœ˜#Jšœœ œ˜ —J˜J˜—JšœA™Ašžœœœ%œ˜KJšœœ˜ Jšœ˜J˜™šœ˜šœ.˜.JšœF˜FJšœ œœ˜"—Jšœ˜J˜—šœ˜šœ-˜-Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜—šœ˜šœ.˜.Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜—šœ˜šœ.˜.Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜—šœ˜šœ/˜/Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜—šœ˜šœ-˜-Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜—šœ˜šœ.˜.Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜——™šœ˜šœ6˜6JšœD˜DJšœ œœ˜%—J˜—šœ˜šœ,˜,Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜—šœ˜šœ+˜+Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜——™!šœ˜šœŸœ˜2JšœD˜DJšœ œœ˜"JšœŸœ˜—J˜—šœ˜šœŸœ˜3Jšœ2˜2Jšœ œœ˜"—JšœŸœ˜J˜—šœ˜šœ0˜0Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜—šœ˜šœ1˜1Jšœ2˜2Jšœ œœ˜"—Jšœ˜J˜——™#˜JšœI˜I—Jšœ'˜'J˜Jšœœ˜˜JšœLœ˜U—Jšœ%˜%Jšœ,˜,Jšœ,˜,Jšœ%œœ˜JJšœ˜Jšœ)œ˜=J˜—J˜J˜—šž œH˜QJ˜—šž œ˜Jšœœœ˜-Jšœ/œ ˜>J˜J˜—šžœ˜Jšœœœ ˜2Jšœ!œ ˜0J˜J˜—šžœ˜Jšœœœ!˜3Jšœ"œ ˜1J˜J˜—šž œ˜Jšœœ$˜5šœA˜AJšœœ˜6—J˜J˜—šžœ˜Jšœœ&˜7šœ˜Jšœœœ œ ˜;—J˜J˜—šžœ˜$Jšœ'˜'Jšœ;˜;J˜J˜—šžœ˜%Jšœ(˜(Jšœ<˜