DynaSeer.mesa 
Copyright © 1986 by Xerox Corporation. All rights reserved.
Written By: Pradeep Sindhu September 18, 1986 3:58:44 pm PDT
Pradeep Sindhu September 26, 1986 8:49:30 pm PDT
Last Edited by: Louis Monier September 24, 1986 3:53:30 pm PDT
DIRECTORY
IO, Random, Rope;
DynaSeer: CEDAR DEFINITIONS = BEGIN
Type Definitions
ROPE: TYPE = Rope.ROPE;
Handle: TYPE = REF HandleRec;
HandleRec: TYPE = RECORD [
numCycles: INT ← 0,
cycleNumber: INT ← 1,
devices: LIST OF Device ← NIL,
firstmem, lastmem, memPtr: DeviceId,
bubblesPerSwitch: NAT ← 2,
lastNonDataCycle: Cycle,  -- Used in computing bubbles
memRequests: ARRAY DeviceId OF Request ← ALL[NIL],
firstcache, lastcache, display, cacheLPPtr, cacheHPPtr: DeviceId,
cacheHPRequests: ARRAY DeviceId OF Request ← ALL[NIL],
cacheLPRequests: ARRAY DeviceId OF Request ← ALL[NIL],
displayHPRequest: Request ← NIL,
displayLPRequest: Request ← NIL,
history: LIST OF Cycle ← NIL,
in, out: IO.STREAM,
arbLatency: INT,
stats: REFNIL
];
Cmd: TYPE = {NoOp, DataCycle, Bubble, RBRqst, RBRply, WBRqst, WBRply, WSRqst, WSRply};
Cycle: TYPE = REF CycleRec;
CycleRec: TYPE = RECORD [
cmd: Cmd,
deviceId: DeviceId ← 0,
master: DeviceId ← 0,
data: INT ← 0,
grantLatency: NAT ← 0
];
Cycles: TYPE = LIST OF Cycle;
DeviceId: TYPE = [0..256);
Length: TYPE = {One, Two, Five}; -- One is used for NoOps
Priority: TYPE = {Low, High};
Request: TYPE = REF RequestRec;
RequestRec: TYPE = RECORD[
length: Length,
cycles: LIST OF Cycle,
priority: Priority
];
Device: TYPE = REF DeviceRec;
DeviceRec: TYPE = RECORD [
deviceId: DeviceId,
state: REF,
init: InitProc,
cycle: CycleProc
];
InitProc: TYPE = PROC [handle: Handle, device: Device];
CycleProc: TYPE = PROC [handle: Handle, device: Device, cycle: Cycle];
procCycle: REAL = 100.0; -- ns
busCycle: REAL = 25.0; -- ns
Device and Bus Procs
CreateDevice: PROC [] RETURNS [device: Device];
MakeCycle: PROC [cmd: Cmd, deviceId, master: DeviceId ← 0, data: INT ← 0] RETURNS [cycle: Cycle];
MakeNoOp: PROC [] RETURNS [cycle: Cycle];
MakeDataCycles: PROC [length: Length] RETURNS [Cycles];
MakeBubble: PROC [] RETURNS [cycle: Cycle];
MakeRequest: PROC [length: Length, header: Cycle, priority: Priority ← Low] RETURNS [request: Request];
IsDataCycle: PROC [cycle: Cycle] RETURNS [BOOLFALSE];
IsUsefulCycle: PROC [cycle: Cycle] RETURNS [BOOLFALSE];
IsHeaderCycle: PROC [cycle: Cycle] RETURNS [BOOLFALSE];
IsReplyCycle: PROC [cycle: Cycle] RETURNS [BOOLFALSE];
IsRequestCycle: PROC [cycle: Cycle] RETURNS [BOOLFALSE];
IsDisplay: PROC [handle: Handle, deviceId: DeviceId] RETURNS [BOOLFALSE];
IsCache: PROC [handle: Handle, deviceId: DeviceId] RETURNS [BOOLFALSE];
IsMemory: PROC [handle: Handle, deviceId: DeviceId] RETURNS [BOOLFALSE];
Simulation Procs
CreateSimulation: PROC [in, out: IO.STREAM, numCycles, numMemories, numCaches, arbLatency: INT] RETURNS [handle: Handle];
GetIntParm: PROC [in, out: IO.STREAM, prompt: ROPE, default: INT] RETURNS [val: INT];
GetRealParm: PROC [in, out: IO.STREAM, prompt: ROPE, default: REAL] RETURNS [val: REAL];
RunSimulation: PROC [handle: Handle];
END.