RadioLock.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Barth, October 24, 1989 2:13:26 pm PDT
DIRECTORY
Core, Rosemary, RosemaryUser, Ports;
RadioLock:
CEDAR
PROGRAM
IMPORTS Rosemary, RosemaryUser, Ports =
BEGIN OPEN Ports;
RadioLockPorts: TYPE = REF RadioLockPortsRec;
RadioLockPortsRec:
TYPE =
RECORD[
Clock, Walkman, Lock: Port ← NIL];
RadioLockTestProc: RosemaryUser.TestProc = {
ports: RadioLockPorts ← Initialize[p, cellType.public, Eval ! Rosemary.Stop => IF reason = $BoolWireHasX THEN RESUME ELSE REJECT];
{OPEN ports;
PB[Walkman, TRUE, force];
CycleClock[ports, Eval];
DO
CycleClock[ports, Eval];
ENDLOOP;
Initialize:
PROC [p: Ports.Port, public: Core.Wire, eval: RosemaryUser.TestEvalProc]
RETURNS [ports: RadioLockPorts]= {
ports ← NEW[RadioLockPortsRec];
{OPEN ports;
[Clock, Walkman, Lock] ← Ports.BindPorts[public, p, "Clock", "Walkman", "Lock"];
PB[Walkman, FALSE, force];
CycleClock[ports, eval];
}};
CycleClock:
PROC [ports: RadioLockPorts, eval: RosemaryUser.TestEvalProc] = {
OPEN ports;
PB[Clock, FALSE, force];
eval[clockEval: TRUE];
eval[clockEval: FALSE];
PB[Clock, TRUE, force];
eval[clockEval: TRUE];
eval[clockEval: FALSE];
};
RosemaryUser.RegisterTestProc["RadioLock", RadioLockTestProc];
END.