RoseRun.mesa
Last Edited by: Spreitzer, May 9, 1984 8:27:13 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 or $NewSpecialSwitchInstructions (watched = NIL), recieve an ActivityReport as arg.
FindExteriorVicinity: PROC [cell: Cell, index: CARDINAL];
PerturbNode: PROC [node: Node, within: Cell];
PerturbPort: PROC [cell: Cell, index: CARDINAL];
ValueChanged: PROC [node: Node];
ScheduleCell: PROC [Cell];
StrEvals: EvalProcs;
StrMirrorEvals: EvalProcs;
NewToOld: PROC [cell: Cell];
Copies newIO to oldIO
AllowToModify: PROC [cell: Cell, modifier: ModifyProc, blindly, mayRescheduleSelf: BOOLEANFALSE];
This is the right way to alter newIO for random (i.e., other than normal evaluation) reasons.
Copies newIO into oldIO, then calls modifier, then cleans up;
If blindly, then newIO not copied into oldIO, and all ports are assumed to change.
ModifyProc: TYPE = PROC [cell: Cell] RETURNS [subtle: BOOLEANFALSE];
allowed to modify cell's output entries in newIO.
needn't first copy into oldIO.
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 ANYNIL];
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: BOOLEANFALSE];
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 ANYNIL];
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.