NewRosemaryUser.mesa
Copyright Ó 1985, 1986, 1988 by Xerox Corporation. All rights reserved.
Barth, June 9, 1988 4:29:56 pm PDT
DIRECTORY Buttons, ChoiceButtons, Core, CoreFlat, RefTab,
IO, PlotGraph, Ports, Rope, NewRosemary, ViewerClasses;
Simulation Creation and Control
CreateTester:
PROC [testerName: Rope.
ROPE, cellType: Core.CellType, cutSet: CoreFlat.CutSet ←
NIL]
RETURNS [tester: Tester];
Creates a simulation and a viewer for it. The viewer has three panels, the control panel, the plot panel and the typescript panel. There is a sliding bar between the plot panel and typescript panel. The control panel has a menu line for selecting the test procedure to be called if more than one test procedure is registered with same testerName. It also contains the simulation state as one of {idle, initializing, running, interrupted}. It displays the time as a pair of integers, the eval count, and the MOSSIM step count within the eval. It has a pair of integers to control stopping the simulation at a specific eval and step value.
CellTypeTester:
PROC [cellType: Core.CellType]
RETURNS [tester: Tester];
Get the Tester associated with a CellType
Start:
PROC [tester: Tester];
Abort:
PROC [tester: Tester];
Interrupt:
PROC [tester: Tester];
SingleEval:
PROC [tester: Tester];
Proceed:
PROC [tester: Tester];
SetProceedUntil:
PROC [tester: Tester, eval:
INT, step:
INT ← 0];
SetTrace:
PROC [tester: Tester, on:
BOOL ←
FALSE];
SetRecord:
PROC [tester: Tester, record: RecordFlavor ← eval];
RecordFlavor: TYPE = {nothing, eval, step};
SetPlot:
PROC [tester: Tester, record: PlotFlavor ← eval];
PlotFlavor: TYPE = {eval, waveStep, step};
RegisterTestProc:
PROC [testerName: Rope.
ROPE, testName:
ROPE, testProc: TestProc];
TestProc:
TYPE =
PROC [simulation: Rosemary.Simulation, cellType: Core.CellType, Eval: TestEvalProc];
TestEvalProc: TYPE = PROC [memory: BOOL ← TRUE, clockEval: BOOL ← FALSE, checkPorts: BOOL ← TRUE];
State Display and Access
AddWireToPlot:
PROC [tester: Tester, wire: CoreFlat.FlatWire]
RETURNS [msg:
ROPE ←
NIL];
If msg is not NIL then something bad happened and the wire was not added to the plot.
RemoveWireFromPlot:
PROC [tester: Tester, wire: CoreFlat.FlatWire]
RETURNS [found:
BOOL ←
FALSE];
WireValue:
PROC [tester: Tester, flatWire: CoreFlat.FlatWire, eval:
INT, step:
INT ← 0]
RETURNS [value: NewRosemary.LevelSequence];
Gets the value of the wire at the specific time. May raise Rosemary.NotInstantiated. Will return NIL if information is not available.
AddStateToPlot:
PROC [tester: Tester, flatCell: CoreFlat.FlatCellType, data:
REF
ANY ←
NIL]
RETURNS [msg:
ROPE ←
NIL];
Adds the state vector of the specified flatCell to the plot. Implementation calls stateToRope found by CoreProperties.InheritCellTypeProp for each displayed state or calls Ports.LSToRope if not found.
RemoveStateFromPlot:
PROC [tester: Tester, flatCell: CoreFlat.FlatCellType, data:
REF
ANY ←
NIL]
RETURNS [found:
BOOL ←
FALSE];
stateToMaxCharsProcProp:
ATOM;
-- $RoseStateToMaxCharsProc
Put this on the cell type or cell class.
StateToMaxCharsProc:
TYPE =
PROC [stateAny:
REF
ANY, data:
REF
ANY ←
NIL]
RETURNS [maxChars:
NAT ← 0];
Sets the maximum number of characters that will be returned by the StateToRopeProc
stateToRopeProcProp:
ATOM;
-- $RoseStateToRopeProc
Put this on the cell type or cell class to provide coercion from level sequence to rope.
StateToRopeProc:
TYPE =
PROC [stateAny:
REF
ANY, value: NewRosemary.LevelSequence, data:
REF
ANY ←
NIL]
RETURNS [rope: Rope.
ROPE];
The level sequence is owned by the Rosemary implementation. The client should not alter the contents nor should it retain the ref with the expectation that the value will not change.
StateValue:
PROC [tester: Tester, flatCell: CoreFlat.FlatCellType, eval:
INT, step:
INT ← 0]
RETURNS [value: NewRosemaryLevelSequence];
Gets the value of the cell state encoded as an LS. May raise Rosemary.NotInstantiated. Will return NIL if information is not available.