-- File: [Indigo]Dragon>DragonArbiterImpl1.sak -- 15-Mar-82 9:19:33 DIRECTORY DragonArbiter1, SakuraRT; DragonArbiterImpl1: MONITOR IMPORTS SakuraRT EXPORTS DragonArbiter1 = { Arbiter: PUBLIC DEVICE = { IN ClockA, ClockB, Proc1Rq, Proc2Rq: BOOLEAN OUT Proc1Gr, Proc2Gr: BOOLEAN GUARDIAN {} CONTROL { granted: BOOLEAN _ FALSE; last: CARDINAL _ 0; Grant: ENTRY PROC = { IF last=1 THEN { IF Proc1Rq AND granted THEN RETURN ELSE IF Proc2Rq THEN {Proc1Gr _ FALSE; last _ 2; Proc2Gr _ TRUE; granted _ TRUE} ELSE IF Proc1Rq THEN {Proc1Gr _ TRUE; granted _ TRUE} ELSE {Proc1Gr _ FALSE; granted _ FALSE} } ELSE IF last=2 THEN { IF Proc2Rq AND granted THEN RETURN ELSE IF Proc1Rq THEN {Proc2Gr _ FALSE; last _ 1; Proc1Gr _ TRUE; granted _ TRUE} ELSE IF Proc2Rq THEN {Proc2Gr _ TRUE; granted _ TRUE} ELSE {Proc2Gr _ FALSE; granted _ FALSE} } ELSE IF Proc1Rq THEN {last _ 1; Proc1Gr _ TRUE; granted _ TRUE} ELSE IF Proc2Rq THEN {last _ 2; Proc2Gr _ TRUE; granted _ TRUE} }; -- Grant DO WHEN ClockB UP: Grant[]; ENDLOOP } }; }.