DIRECTORY CoreFlat, Ports, Rosemary; RoseTV: CEDAR DEFINITIONS = BEGIN Bool: TYPE = BOOL; Nat: TYPE = NAT; Cardinal: TYPE = CARDINAL; Int: TYPE = INT; -- [lsw, msw] LongCard: TYPE = LONG CARDINAL; -- [lsw, msw] Real: TYPE = REAL; -- [lsw, msw] ROPE: TYPE = Rosemary.ROPE; RTVal: TYPE = REF RTValRec; RTValRec: TYPE = RECORD[ path: ROPE _ NIL, field: ROPE _ NIL, ref: REF _ NIL, bad: BOOL _ FALSE, fldBitNm: FldBitNmProc _ NIL, buf: Ports.LevelSequence _ NIL, seq: SEQUENCE wwrSize: CARDINAL OF SignedFlatWire]; SignedFlatWire: TYPE = RECORD[ wire: CoreFlat.FlatWire _ NIL, inverted: BOOL _ FALSE ]; New: PROC[path, field: ROPE, ref: REF, struc: BOOL _ TRUE, fldBitNm: FldBitNmProc _ SimpleDotIndexing] RETURNS[rtv: RTVal]; NotImplemented: ERROR; XFer: PROC[sim: Rosemary.Simulation, rtv: RTVal] RETURNS[ref: REF]; XFerList: PROC[sim: Rosemary.Simulation, rtvs: LIST OF RTVal]; SimpleDotIndexing: FldBitNmProc; FldBitNmProc: TYPE = PROC[rtv: RTVal, index: INT] RETURNS[fieldBitNm: ROPE]; END. 4RoseTV.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Curry, October 13, 1986 3:50:31 pm PDT Don Curry October 24, 1986 5:05:33 pm PDT This module can be used to transfer values between a Rosemary simulation and a REF to a simple CEDAR type. Most simple types (eg BOOL, INT, subrange, enumerated) can be used as well as RECORDs. Among the currently unimplemented types one can find ARRAY's, SEQUENCE and all varieties of pointers. If you try one of these you'll get the ERROR NotImplemented. Path.Cat[ ".", field] is the full path rope to the field of interest. ref is a REF of the field's type. struc => structured wire. This proc sets the bits in ref^ based on the current values found in the simulation. The returned REF is for convinence only since it is the same one supplied to NewRTV. Κ`˜™ Jšœ Οmœ1™J˜JšŸœ˜!Jš œžœžœžœžœ žœ˜MJ˜Jšžœ˜—J˜J˜—…— ²