PBusCacheProg4.mesa
Copyright Ó 1987, 1988 by Xerox Corporation. All rights reserved.
Created by Jean Gastinel, May 21, 1988 6:20:57 pm PDT
Jean Gastinel July 11, 1988 5:28:34 pm PDT
DIRECTORY
Atom; 
PBusCacheProg4: CEDAR PROGRAM
IMPORTS Atom
EXPORTS
~ BEGIN
C: PROC [c: CARD] RETURNS [rc: REF ANY] = {rc ← NEW[CARD ← c]};
Atom.PutProp[$PBusEmul, $PKList, LIST[
LIST[$ClearFlag, $WriteDone],
LIST[$Wait, C[2]],
LIST[$WaitSync, $MemReady],
Testing for Conditionnal Write Single
LIST[$SetMode,C[0]],    -- test in Kernel mode
LIST[$SetByteSelect,C[0FH]],   -- Word selection
LIST[$IOWrite,C[9H],C[01234567H]],     -- AID register
LIST[$IOReadAndCheck,C[9H],C[01234567H]],  
LIST[$SetMode,C[1]],    -- test in User mode
    
LIST[$IOWrite,C[1H],C[01234567H]],     -- Old Value
LIST[$IOWrite,C[3H],C[00112233H]],     -- New Value
LIST[$CondWriteSingleAndCheck,C[00112288H],C[0]],  -- Fetch & Non Matche
LIST[$CondWriteSingleAndCheck,C[0011228AH],C[00010001H]], -- No Fetch & Non Matche
LIST[$CondWriteSingleAndCheck,C[00112289H],C[01234567H]], -- No Fetch & Matche
LIST[$SetFlag, $WriteDone], 
LIST[$WaitSync, $LocShared], -- wait for the Exerciser making this location shared 
$LoopWait,
LIST[$CondWriteSingleAndCheck,C[00112289H],C[00112233H]], -- No Fetch & no Match
LIST[$SkipIfTrue, $LocShared],
LIST[$Jump, $LoopWait],
LIST[$IOWrite,C[1H],C[00112233H]],     -- New Value
LIST[$IOWrite,C[3H],C[0ABCDEF9H]],    -- New Value
LIST[$CondWriteSingleAndCheck,C[00112289H],C[00112233H]], -- No Fetch & Matche & Shared
            
$StopSimul,
$Nop,
LIST[$Jump, $Nop]
]];
END.