DynCacheProg5.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Created by Jean Gastinel, June 2, 1988 3:38:27 pm PDT
Jean Gastinel July 8, 1988 8:05:08 pm PDT
DIRECTORY
Atom,DynaBusInterface,Rope; 
DynCacheProg5: CEDAR PROGRAM
IMPORTS Atom
EXPORTS
~ BEGIN
Quad: TYPE = DynaBusInterface.Quad;
Cmd: TYPE = DynaBusInterface.Cmd;
L: PROC [c: BOOL] RETURNS [rc: REF ANY] = {rc ← NEW[BOOL ← c]};
C: PROC [c: CARD] RETURNS [rc: REF ANY] = {rc ← NEW[CARD ← c]};
Q: PROC [c: Quad] RETURNS [rc: REF ANY] = {rc ← NEW[Quad ← c]};
Com: PROC [c: Cmd] RETURNS [rc: REF ANY] = {rc ← NEW[Cmd ← c]};
R: PROC [c: Rope.ROPE] RETURNS [rc: REF ANY] = {rc ← NEW[Rope.ROPE ← c]};
Atom.PutProp[$Simul2Sender, $PKList, LIST[
LIST[$ClearFlag, $MemReady],
LIST[$ClearFlag, $DynReadDone],
$Init,
$StartStop,
$ReceiveAll,   
LIST[$Wait, C[200]], -- for waiting DBus intit
LIST[$WaitSync, $DBusReady], -- wait DBus ready
Initialize memory controller
LIST[$IOWrite0, C[1], L[TRUE], L[TRUE], C[0],C[28],C[28],C[28],C[22],C[22]],
$WaitMsgSent,
$WaitMsgReceived, -- for the Echo
$WaitReply,
LIST[$IOWrite1, C[1],C[10],C[0],C[0]],
$WaitMsgSent,
$WaitMsgReceived, -- for the Echo
$WaitReply,
LIST[$IOWrite2, C[1],C[10],C[0]],
$WaitMsgSent,
$WaitMsgReceived, -- for the Echo
$WaitReply,
LIST[$WriteBlockRqst, Q[[0,0,0011H,2288H]],Q[[0,0,0123H,4567H]],Q[[1,1,1,1]],Q[[2,2,2,2]],Q[[3,3,3,3]]],
$WaitMsgSent,
LIST[$SetFlag, $MemReady], 
First lets pretend to be a Map Cache for one time
$WaitMapRqst,   -- first testing in Kernel mode 
LIST[$MapReply, C[0FH]], -- UserR enabled, UserW enabled, KernelW enabled, Dirty,
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2289H]]], -- for the Test one internal mapping
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2308H]]], -- for the Test one internal mapping
Testing WS inbetween
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2310H]]], -- for the Test WS inbetween
LIST[$WriteSingleRply1, Q[[0,0,0011H,2310H]], Q[[0123H,4567H,89ABH,0CDEFH]]],
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2310H]]], --for the retry
Testing WBlock inbetween
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2318H]]], -- for the Test WBlock inbetween
LIST[$WriteBlockRqst, Q[[0,0,0011H,2319H]],Q[[0,0,0123H,4567H]],Q[[1,1,1,1]],Q[[2,2,2,2]],Q[[3,3,3,3]]],
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2318H]]], --for the retry
Testing Flush Block inbetween
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2320H]]], -- for the Test Flush Block inbetween
LIST[$FlushBlockRqst, Q[[0,0,0011H,2319H]],Q[[0,0,0123H,4567H]],Q[[1,1,1,1]],Q[[2,2,2,2]],Q[[3,3,3,3]]],
Testing CWS inbetween
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2328H]]], -- for the Test CWS inbetween
LIST[$CondWSRply1, Q[[0,0,0011H,2328H]], Q[[0123H,4567H,89ABH,0CDEFH]]],
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2328H]]], --for the retry
Testing DeMap inbetween
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2330H]]], -- for the Test DeMap inbetween
LIST[$DeMapRqst, Q[[0,0,0011H,2311H]],Q[[0123H,4567H,89ABH,0CDEFH]]],
$WaitMapRqst,  
LIST[$MapReply, C[0FH]],
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2338H]]], -- for the Test DeMapRply inbetween
LIST[$DeMapRply1, Q[[0,0,0011H,2338H]],Q[[0123H,4567H,89ABH,0CDEFH]]],
$WaitMapRqst,  
LIST[$MapReply, C[0FH]],
LIST[$WaitReadBlockRqstandCheck1, Q[[0,0,0011H,2338H]]], -- for the retry


Now lets pretend to be a Map Cache
$Loop,
$WaitMapRqst,  
LIST[$MapReply, C[0FH]],
LIST[$Jump, $Loop]
]];
END.