PBusCacheProg2.mesa
Copyright Ó 1987, 1988 by Xerox Corporation. All rights reserved.
Created by Jean Gastinel, March 20, 1988 6:20:57 pm PDT
Pradeep Sindhu May 10, 1988 9:06:08 pm PDT
Jean Gastinel May 22, 1988 6:04:00 pm PDT
DIRECTORY
Atom; 
PBusCacheProg2: CEDAR PROGRAM
IMPORTS Atom
EXPORTS
~ BEGIN
C: PROC [c: CARD] RETURNS [rc: REF ANY] = {rc ← NEW[CARD ← c]};
Atom.PutProp[$PBusEmul, $PKList, LIST[
LIST[$Wait, C[100]], -- wait for the DBus and the memory controller to be intialized
Testing for Byte Access on Ram
LIST[$SetMode,C[1]],    -- test in User mode
    
LIST[$SetByteSelect,C[08H]],   -- MSB selection
LIST[$Write,C[00112233H],C[89ABCDEFH]], 
LIST[$ReadAndCheck,C[00112233H],C[89234567H]],  
LIST[$SetByteSelect,C[04H]],   -- Byte selection
LIST[$Write,C[00112233H],C[56ABCDEFH]], 
LIST[$ReadAndCheck,C[00112233H],C[89AB4567H]], 
LIST[$SetByteSelect,C[02H]],   -- Byte selection
LIST[$Write,C[00112233H],C[5678CDEFH]], 
LIST[$ReadAndCheck,C[00112233H],C[89ABCD67H]], 
LIST[$SetByteSelect,C[01H]],   -- LSB selection
LIST[$Write,C[00112233H],C[567890EFH]], 
LIST[$ReadAndCheck,C[00112233H],C[89ABCDEFH]],  
Testing that Byte select has no effect on Read
LIST[$SetByteSelect,C[0AH]],   -- Bytes selection
LIST[$ReadAndCheck,C[00112233H],C[89ABCDEFH]],
Testing Behavior of Byteselect on inernal IOWrite
First let's generate a fault becaus in User mode
LIST[$IOWrite,C[9H],C[01234567H],C[13H]],    -- AID register
  
LIST[$SetMode,C[0]],    -- Put in Kernel mode
LIST[$SetByteSelect,C[0FH]],   -- Word selection
LIST[$IOWrite,C[9H],C[01234567H]],     -- AID register
LIST[$SetByteSelect,C[0AH]],   -- Bytes selection
LIST[$IOWrite,C[9H],C[99887766H]],     -- AID register
LIST[$SetMode,C[1]],    -- Put in User mode
LIST[$SetByteSelect,C[0FH]],   -- Bytes selection
LIST[$IOWrite,C[3H],C[98765432H]],     -- CWSnew register
LIST[$IOReadAndCheck,C[9H],C[0H],C[13H]],   -- Fault access in User M 
LIST[$SetMode,C[0]],    -- Put in Kernel mode
LIST[$IOReadAndCheck,C[9H],C[99237767H]],  
LIST[$SetMode,C[1]],    -- Put in User mode
LIST[$IOReadAndCheck,C[3H],C[98765432H]],
Testing that ByteSelect IOWrite has no effect on external Adresses
LIST[$SetByteSelect,C[0AH]],   -- Bytes selection
LIST[$IOWrite,C[0ABCDEFH],C[01357H]],    -- IO external to the cache
LIST[$IOReadAndCheck,C[0ABCDEFH],C[01357H]],
       
    
$StopSimul,
$Nop,
LIST[$Jump, $Nop]
]];
END.