RadioLock.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Barth, October 25, 1989 4:43:01 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, LC, Edge, Legal, Illegal, 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];
THROUGH [1..25] DO CycleClock[ports, Eval]; ENDLOOP;
PB[Walkman, FALSE, force];
THROUGH [1..25] 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, LC, Edge, Legal, Illegal, Lock] ← Ports.BindPorts[public, p, "Clock", "Walkman", "LC", "Edge", "Legal", "Illegal", "Lock"];
PB[Walkman, FALSE, force];
PDW[LC, 1, force];
PB[Edge, FALSE, none];
PB[Legal, FALSE, none];
PB[Illegal, FALSE, none];
PB[Lock, FALSE, none];
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.