RoseTV.mesa
Copyright © 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
DIRECTORY CoreFlat, Ports, Rosemary;
RoseTV: CEDAR DEFINITIONS =
BEGIN
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.
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: BOOLTRUE,
fldBitNm: FldBitNmProc ← SimpleDotIndexing]
RETURNS[rtv: RTVal];
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.
NotImplemented: ERROR;
XFer: PROC[sim: Rosemary.Simulation, rtv: RTVal] RETURNS[ref: REF];
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.
XFerList: PROC[sim: Rosemary.Simulation, rtvs: LIST OF RTVal];
SimpleDotIndexing:  FldBitNmProc;
FldBitNmProc: TYPE = PROC[rtv: RTVal, index: INT] RETURNS[fieldBitNm: ROPE];
END.