DIRECTORY Buttons, ChoiceButtons, Core, CoreFlat, RefTab, IO, PlotGraph, Ports, Rosemary, ViewerClasses; RosemaryUser: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Core.ROPE; DisplayViewer: PROC [simulation: Rosemary.Simulation, cellType: Core.CellType, name: ROPE _ NIL, displayWires: CoreFlat.FlatWires _ NIL, graphWires: CoreFlat.FlatWires _ NIL] RETURNS [handle: RoseDisplay]; LogSettle: PROC [handle: RoseDisplay, time: INT, memory: BOOL _ TRUE]; UpdateDisplay: PROC [handle: RoseDisplay]; InitializeDeltas: PROC [handle: RoseDisplay]; RecordDelta: PROC [handle: RoseDisplay, wire: Rosemary.RoseWire, time: INT]; DeltaFinished: PROC [handle: RoseDisplay, time: INT]; RecordStateSample: PROC [handle: RoseDisplay, roseInstance: Rosemary.RoseCellInstance, value: Ports.LevelSequence, time: INT]; TestProcedureViewer: PROC [cellType: Core.CellType, testButtons: LIST OF ROPE, name: ROPE _ NIL, displayWires: CoreFlat.FlatWires _ NIL, graphWires: CoreFlat.FlatWires _ NIL, cutSet: CoreFlat.CutSet _ NIL, historySize: NAT _ 0, steady: BOOL _ FALSE, recordDeltas: BOOL _ TRUE] RETURNS [tester: Tester]; StartTest: PROC [tester: Tester]; SetProceedUntil: PROC [tester: Tester, count: INT]; RegisterTestProc: PROC [name: ROPE, proc: TestProc]; TestProc: TYPE = PROC [simulation: Rosemary.Simulation, cellType: Core.CellType, p: Ports.Port, Eval: TestEvalProc]; TestEvalProc: TYPE = PROC [memory: BOOL _ TRUE, clockEval: BOOL _ FALSE, checkPorts: BOOL _ TRUE]; RoseDisplayFor: PROC [cellType: Core.CellType] RETURNS [RoseDisplay]; DisplayPortLeafWires: PROC [root: Core.CellType, flatCell: CoreFlat.FlatCellTypeRec _ CoreFlat.rootCellType] RETURNS [displayWires: CoreFlat.FlatWires]; AddWireToPlot: PROC [handle: RoseDisplay, wire: CoreFlat.FlatWire] RETURNS [msg: ROPE _ NIL]; RemoveWireFromPlot: PROC [handle: RoseDisplay, wire: CoreFlat.FlatWire] RETURNS [found: BOOL _ FALSE]; WireTimeValue: PROC [handle: RoseDisplay, flatWire: CoreFlat.FlatWire, time: INT] RETURNS [value: Ports.LevelSequence]; AddStateToPlot: PROC [handle: RoseDisplay, flatCell: CoreFlat.FlatCellType, data: REF ANY _ NIL] RETURNS [msg: ROPE _ NIL]; RemoveStateFromPlot: PROC [handle: RoseDisplay, flatCell: CoreFlat.FlatCellType, data: REF ANY _ NIL] RETURNS [found: BOOL _ FALSE]; stateToMaxCharsProcProp: ATOM; -- $RoseStateToMaxCharsProc StateToMaxCharsProc: TYPE = PROC [stateAny: REF ANY, data: REF ANY _ NIL] RETURNS [maxChars: NAT _ 0]; stateToRopeProcProp: ATOM; -- $RoseStateToRopeProc StateToRopeProc: TYPE = PROC [stateAny: REF ANY, value: Ports.LevelSequence, data: REF ANY _ NIL] RETURNS [rope: ROPE]; StateTimeValue: PROC [handle: RoseDisplay, flatCell: CoreFlat.FlatCellType, time: INT] RETURNS [value: Ports.LevelSequence]; CheckCoverage: PROC [handle: RoseDisplay] RETURNS [ok: BOOL]; Tester: TYPE = REF TesterRec; TesterRec: TYPE = RECORD [ intermediatePort: Ports.Port _ NIL, runState: ViewerClasses.Viewer _ NIL, evalsSinceStart: ViewerClasses.Viewer _ NIL, evalSinceStartCount: INT, proceedUntil: ViewerClasses.Viewer _ NIL, evalUntil: INT, historyTrigger: ViewerClasses.Viewer _ NIL, historyTriggerCount: INT, currentStatePoint: NAT _ 0, displayedStatePoint: NAT _ 0, validStates: NAT _ 0, historySize: NAT _ 0, testVectorBuffer: Rosemary.PortSequence _ NIL, proceed: CONDITION, testStarted: BOOL _ FALSE, waiting: BOOL _ FALSE, abort: BOOL _ FALSE, interrupt: BOOL _ FALSE, singleEval: BOOL _ FALSE, testButtonList: LIST OF Buttons.Button, currentTestProc: ROPE _ NIL, display: RoseDisplay _ NIL, steadyInit: BOOL _ TRUE]; timeBlock: NAT = 4096; TimeSteps: TYPE ~ REF TimeStepsRep; -- keeps time->mossim step relation TimeStepsRep: TYPE ~ ARRAY [0..timeBlock) OF INT; RoseDisplay: TYPE = REF RoseDisplayRec; RoseDisplayRec: TYPE = RECORD [ name: ROPE _ NIL, cellType: Core.CellType, simulation: Rosemary.Simulation, displayWires: LIST OF ChoiceButtons.PromptDataRef _ NIL, tsin: IO.STREAM _ NIL, tsout: IO.STREAM _ NIL, path: ViewerClasses.Viewer _ NIL, currentWire: ViewerClasses.Viewer _ NIL, plot: PlotGraph.Plot _ NIL, ps: IO.STREAM _ NIL, psLock: BOOL _ FALSE, psWait: CONDITION, lastValidTime: INT _ -1, wDir: REF ANY _ NIL, traceChanges: BOOL _ FALSE, recordDeltas: BOOL _ TRUE, -- data must be logged on backing file recordSteps: BOOL _ FALSE, -- if recordDeltas, log at MosSim step granularity plotStyle: {allSteps, waveSteps, noSteps} _ noSteps, -- should MosSim steps appear on plot cutSet: CoreFlat.CutSet _ NIL, wBuff: REF TEXT _ NIL, -- output logging speedup filePos: INT _ 0, -- logical position in backing file timeSteps: ARRAY [0..1024) OF TimeSteps _ ALL[NIL]]; END. @RosemaryUser.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. Barth, December 17, 1987 4:22:58 pm PST Bertrand Serlet October 17, 1986 10:03:12 pm PDT Last Edited by: Gasbarro October 14, 1987 10:26:38 am PDT Jean-Marc Frailong December 24, 1987 5:49:23 pm PST Client Controlled Simulations NOTE: The procedures in this section are low-level procedures for clients who do not wish to use the Tester abstraction. Reading the implementation of the tester abstraction may help the foolhardy. Same as Rosemary.Settle but pays attention to the log button and records changes. Resets the initial state of all the wires to the current state. Must be called from a Rosemary.UpdateProc if plotting is to be used. Says that data is valid up to time. To be called by Rosemary.InitProc procedures when the state is initialized and Rosemary.EvalProc procedures whenever the state changes. The implementation, not the client, is responsible for saving only the last sample for a given Eval call. The level sequence is owned by the client. Test Procedure Simulations Create the tester and its viewer. When the viewer is destroyed, all associated viewers and data structures will also be destroyed. Wire Display and Access Recover the RoseDisplay structure associated to a celltype Gets the value of the wire. May raise Rosemary.NotInstantiated. Will return NIL if information is not available. State Display and Access 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. Put this on the cell type or cell class. Sets the maximum number of characters that will be returned by the StateToRopeProc Put this on the cell type or cell class to provide coercion from level sequence to rope. The level sequence is owned by the implementation. The client should not alter the contents nor should it retain the ref with the expectation that the value will not change. Gets the value of the cell state encoded as an LS. May raise Rosemary.NotInstantiated. Will return NIL if information is not available. Odds and ends Returns TRUE iff all nodes in the simulation reach the H and L levels. Nodes that do not are printed on the simulation log. Data Structures Not intended to be understood by clients. สบ˜codešœ™Kšœ ฯmœ7™BK™'K™0K™9K™3—K˜šฯk œ1žœ,˜hK˜—Kšฯn œžœž œž˜'K˜Kšžœžœžœ˜head™™ลK™—šŸ œžœBžœžœ%žœ#žœžœ˜อJ˜—š Ÿ œžœžœ žœžœ˜FJ™QJ˜—šŸ œžœ˜*J˜—šŸœžœ˜-J™?J˜—šŸ œžœ6žœ˜LJšœD™DJ˜—šŸ œžœžœ˜5J™#J˜—šŸœžœbžœ˜~K™ž——™š Ÿœžœ(žœžœžœžœžœ%žœ#žœžœžœžœžœžœžœžœ˜ฎK™‚K˜—šŸ œžœ˜!J˜—šŸœžœžœ˜3J˜—šŸœžœžœ˜4J˜—šœ žœžœ_˜tK˜—Kšœžœžœ žœžœ žœžœ žœžœ˜b—™šŸœžœžœ˜EK™:K™—šŸœžœSžœ$˜˜K˜—š Ÿ œžœ0žœžœžœ˜]K˜—š Ÿœžœ0žœ žœžœ˜fK˜—šŸ œžœ:žœžœ˜wKšœMžœ!™q——™šŸœžœ>žœžœžœžœžœžœ˜{Kšœษ™ษK™—šŸœžœ>žœžœžœžœ žœžœ˜„K™—šœžœฯc˜:K™(K™—šœžœžœ žœžœžœžœžœžœ žœ˜fK™RK˜—šœžœ ˜2K™XK™—šœžœžœ žœžœ$žœžœžœžœžœ˜wK™ฎK™—šŸœžœ>žœžœ˜|Kšœˆ™ˆ——™ šŸ œžœžœžœ˜=Kšœžœo™{——™K™)K™Kšœžœžœ ˜procšœ žœžœ˜Kšœžœ˜#Jšœ!žœ˜%Jšœ(žœ˜,Jšœžœ˜Jšœ%žœ˜)Jšœ žœ˜Jšœ'žœ˜+Jšœžœ˜Jšœžœ˜Jšœžœ˜Jšœ žœ˜Jšœ žœ˜Jšœ*žœ˜.Jšœ ž œ˜Jšœ žœžœ˜Jšœ žœžœ˜Jšœžœžœ˜Jšœ žœžœ˜Jšœ žœžœ˜Jšœžœžœ˜'Kšœžœžœ˜Kšœžœ˜Kšœ žœžœ˜K˜—Kšœ žœ˜Kšœ žœžœ #˜Gš œžœžœžœžœ˜1K˜—Jšœ žœžœ˜'šœžœžœ˜Jšœžœžœ˜Kšœ˜Jšœ ˜ Jšœžœžœžœ˜8Kšœžœžœžœ˜Kšœžœžœžœ˜Kšœžœ˜!Kšœ$žœ˜(Kšœžœ˜Kšœžœžœžœ˜Jšœžœžœ˜Jšœž œ˜Kšœžœ˜Kšœžœžœžœ˜Kšœžœžœ˜Kšœžœžœ &˜BKšœ žœžœ 2˜MKšœ5 %˜ZKšœžœ˜Kšœžœžœžœ ˜0Kšœ žœ #˜5Kš œ žœ žœ žœžœ˜4J˜——Jšžœ˜J˜—…—๘!๒