SoftcardToolVariousBitsImpl.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Willie-Sue, March 6, 1987 1:42:43 pm PST
DIRECTORY
Buttons USING [Create],
IO,
Labels USING [Create],
PopUpSelection USING [Request],
SoftcardOps,
SoftcardToolPrivate;
SoftcardToolVariousBitsImpl: CEDAR PROGRAM
IMPORTS
Buttons, Labels, PopUpSelection,
SoftcardOps, SoftcardToolPrivate
EXPORTS
SoftcardToolPrivate
= BEGIN OPEN IO, SoftcardToolPrivate;
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
BuildVariousButtons: PUBLIC PROC[topViewer, sibx: Viewer] RETURNS[sib: Viewer] = {
builds the miscellaneous buttons - sibx is the last button created in caller
sib ← sibx;
ControlBits
sib ← Labels.Create[
info: [ name: " ControlBits ", parent: topViewer,
 wx: leftEdge, wy: sib.wy + sib.wh + betweenHeight, wh: entryHeight,
 border: FALSE, scrollable: FALSE],
font: labelFont ];
sib ← Buttons.Create[
info: [ name: " Read ", parent: topViewer,
 wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight,
 border: TRUE, scrollable: FALSE],
font: activeFont, proc: ReadControlBits ];
sib ← Buttons.Create[
info: [name: " Set ", parent: topViewer,
 wx: sib.wx+sib.ww+1, wy: sib.wy, wh: entryHeight,
 border: TRUE, scrollable: FALSE ],
font: activeFont, proc: SetControlBits ];
sib ← Buttons.Create[
info: [name: " Reset ", parent: topViewer,
wx: sib.wx+sib.ww+1, wy: sib.wy, wh: entryHeight,
border: TRUE, scrollable: FALSE ],
font: activeFont, proc: ResetControlBits ];
StatusBits
sib ← Labels.Create[
info: [ name: " StatusBits ", parent: topViewer,
 wx: leftEdge, wy: sib.wy + sib.wh + betweenHeight, wh: entryHeight,
 border: FALSE, scrollable: FALSE],
font: labelFont ];
sib ← Buttons.Create[
info: [ name: " Read ", parent: topViewer,
 wx: sib.wx+sib.ww+5, wy: sib.wy, wh: entryHeight,
 border: TRUE, scrollable: FALSE],
font: activeFont, proc: ReadStatusBits ];
sib ← Buttons.Create[
info: [name: " Reset ", parent: topViewer,
wx: sib.wx+sib.ww+1, wy: sib.wy, wh: entryHeight,
border: TRUE, scrollable: FALSE ],
font: activeFont, proc: ResetStatusBits ];
};
*********************************************
ReadControlBits: PUBLIC ClickProc = {
which: SoftcardOps.ControlBit;
name: ROPE;
val: BOOL;
[which, name] ← SelectControlBit[];
IF name = NIL THEN RETURN;
val ← SoftcardOps.ReadControlBit[which];
TSOutPutF[" %g is %g\n", [rope[name]], [boolean[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];
TSOutPutF[" %g has been set: previous value was %g\n",
 [rope[name]], [boolean[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];
TSOutPutF[" %g has been reset: previous value was %g\n",
 [rope[name]], [boolean[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];
TSOutPutF[" %g is %g\n", [rope[name]], [boolean[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
TSOutPutF["Cannot reset %g\n", [rope[name]] ]
ELSE {
prev ← SoftcardOps.ResetStatusBit[which];
TSOutPutF[" %g has been reset: previous value was %g\n",
[rope[name]], [boolean[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];
};
END.