RoseRun.mesa
Last Edited by: Spreitzer, October 9, 1984 1:53:46 pm PDT
DIRECTORY IO, List, OrderedSymbolTableRef, PrincOps, Rope, RoseEvents, RoseTypes;
RoseRun: CEDAR DEFINITIONS =
BEGIN OPEN RoseTypes;
Run: PROC [sim: Simulation];
Next: PROC [sim: Simulation] RETURNS [stepType: StepType];
StepSim:
PROC [sim: Simulation]
RETURNS [stepType: StepType];
StepType: TYPE = {noStep, switchStep, otherStep};
stop:
BOOLEAN;
To suspend all running, set this; when sampled, Stop will be raised.
ActivityReport: TYPE = REF ActivityReportRep;
ActivityReportRep:
TYPE =
RECORD [
node: Node,
socket: Socket];
Watching events $SimpleChanged, $NewSpecialSwitchInstructions, or $SwitchChanged (watched = NIL), recieve an ActivityReport as arg.
FindExteriorVicinity: PROC [cell: Cell, index: CARDINAL, evenIfInput: BOOL ← FALSE];
PerturbNode: PROC [node: Node, within: Cell, evenIfInput: BOOL ← FALSE];
PerturbPort: PROC [cell: Cell, index: CARDINAL, evenIfInput: BOOL ← FALSE];
ValueChanged: PROC [node: Node];
ScheduleCell: PROC [Cell];
StrEvals: EvalProcs;
StrMirrorEvals: EvalProcs;
NewToOld: PROC [cell: Cell];
Copies newIO to oldIO
PreSimple:
PROC [cell: Cell, reallyCopy:
BOOL ←
TRUE];
The right way to prepare for calling an EvalSimple.
Copies newIO to oldIO, and on specials sets UD to [none, none] and Val from node.
Setting reallyCopy to FALSE inhibits the copy.
AllowToModify:
PROC [cell: Cell, modifier: ModifyProc, blindly, mayRescheduleSelf:
BOOLEAN ←
FALSE];
Arrange to call modifier as if it were the cell's evalSimple.
If blindly, then don't differentiate --- all ports are assumed to change.
ModifyProc:
TYPE =
PROC [cell: Cell]
RETURNS [subtle:
BOOLEAN ←
FALSE];
Called as if it were the cell's evalSimple: may read and modify newIO, affecting simple and special ports.
Setting subtle forces the cell to be scheduled even if no changes detected in newIO.
Test:
PROC [sim: Simulation, cth: CellTestHandle, parms: TestParms, testData:
REF
ANY ←
NIL];
Calls the Cell's Test proc, possibly surrounded by SIGNAL Stop["About to eval/Just eval'ed", cell].
TestParms: TYPE = REF TestParmsRep;
TestParmsRep:
TYPE =
RECORD [
stopBefore, stopAfter: BOOLEAN ← FALSE];
Eval:
PROC [handle: CellTestHandle, returnAfter: ReturnAfter ← returnWhenSettled]
RETURNS [happened: StepType];
ReturnAfter: TYPE = PACKED ARRAY MaskableStepType OF BOOLEAN;
MaskableStepType: TYPE = StepType[switchStep .. otherStep];
returnWhenSettled: ReturnAfter = [FALSE, FALSE];
DisableableStop:
PROC [proc:
UNSAFE
PROC
ANY
RETURNS
ANY, msg:
ROPE, data:
REF
ANY ←
NIL];
Raises RoseTypes.Stop, unless disabled.
DisableThisStop:
PROC [fh: PrincOps.FrameHandle]
RETURNS [ok:
BOOL];
Disables Raising RoseTypes.Stop from PC where DisableableStop.proc is called, in stack of fh.
END.