AggerLatchRoseDetails.mesa
Copyright © 1985 by Xerox Corporation. All rights reversed.
Spreitzer, October 22, 1985 3:00:13 pm PDT
DIRECTORY BasicTime, BitTwiddling, Core, CoreProperties, GetMe, IO, Rope, RoseBehavior, AggerLatchRoseDefs;
AggerLatchRoseDetails: CEDAR PROGRAM
IMPORTS GetMe, RoseBehavior
=
BEGIN OPEN RoseBehavior, AggerLatchRoseDefs;
LatchState: TYPE = REF LatchStatePrivate;
LatchStatePrivate: TYPE = RECORD [
val: PACKED SEQUENCE length: NAT OF BOOL];
EvalLatch
: PROC [
argsAny, switchAny, simpleAny, strengthAny, stateAny: REF ANY,
perturb: PROC [portPath: PortPath]
]
= {
io: REF AggerLatchSimple = NARROW[simpleAny];
drive: REF AggerLatchDrive = NARROW[strengthAny];
state: LatchState = NARROW[stateAny];
drive.load ← drive.in ← none;
drive.out ← drive;
IF io.load THEN FOR i: NAT IN [0 .. state.length) DO state[i] ← io.in[i] ENDLOOP;
FOR i: NAT IN [0 .. state.length) DO io.out[i] ← state[i] ENDLOOP;
};
CreateLatchState: PROC [argsAny: REF ANYNIL] RETURNS [stateAny: REF ANYNIL] = {
rw: REF INT = NARROW[argsAny];
stateAny ← NEW [LatchStatePrivate[rw^]];
};
RegisterDetails[
"AggerLatch",
NEW [DetailsRec ← [EvalSimple: EvalLatch, CreateState: CreateLatchState]],
GetMe.GetVersion[]
];
END.