SCInit.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Pradeep Sindhu, June 5, 1987 6:01:20 pm PDT
Initialize Sisyph context variables for SCLogic
DIRECTORY
SCUtils,
Rope,
SCPmCode,
Sisyph USING [Context, Store];
SCInit: CEDAR PROGRAM
IMPORTS SCUtils, SCPmCode, Sisyph
~ BEGIN
SetCacheParms: PUBLIC PROC [cx: Sisyph.Context, numBitsPerByte, numBytesPerWord, numCyclesPerLine, numMemLines, numIOLines, numFIFOLines: NAT] ~ {
numWordsPerCycle: NAT ← 2; -- this is fixed by the bus architecture
Define all the independent variables
BEGIN
Sisyph.Store[cx, "numBitsPerByte", NEW[NAT ← numBitsPerByte]];
Sisyph.Store[cx, "numBytesPerWord", NEW[NAT ← numBytesPerWord]];
Sisyph.Store[cx, "numWordsPerCycle", NEW[NAT ← numWordsPerCycle]];
Sisyph.Store[cx, "numCyclesPerLine", NEW[NAT ← numCyclesPerLine]];
Sisyph.Store[cx, "numMemLines", NEW[NAT ← numMemLines]];
Sisyph.Store[cx, "numIOLines", NEW[NAT ← numIOLines]];
Sisyph.Store[cx, "numFIFOLines", NEW[NAT ← numFIFOLines]];
Sisyph.Store[cx, "numStackBits", NEW[NAT ← SCPmCode.NumStackBits]];
Sisyph.Store[cx, "numPCBits", NEW[NAT ← SCPmCode.NumPCBits]];
Sisyph.Store[cx, "CWSOldNewVPagePattern", ""];
Sisyph.Store[cx, "CWSOldNewVBlockPattern", ""];
Sisyph.Store[cx, "StatusClearVPagePattern", ""];
Sisyph.Store[cx, "StatusClearVBlockPattern", ""];
Sisyph.Store[cx, "NullVPagePattern", ""];
Sisyph.Store[cx, "NullVBlockPattern", ""];
Sisyph.Store[cx, "FaultAIdStatusMaskVPagePattern", ""];
Sisyph.Store[cx, "FaultAIdStatusMaskVBlockPattern", ""];
Sisyph.Store[cx, "StatusSetVPagePattern", ""];
Sisyph.Store[cx, "StatusSetVBlockPattern", ""];
Sisyph.Store[cx, "ModesVPagePattern", ""];
Sisyph.Store[cx, "ModesVBlockPattern", ""];
Sisyph.Store[cx, "CWSOldNewRPagePattern", ""];
Sisyph.Store[cx, "CWSOldNewRBlockPattern", ""];
Sisyph.Store[cx, "StatusClearRPagePattern", ""];
Sisyph.Store[cx, "StatusClearRBlockPattern", ""];
Sisyph.Store[cx, "NullRPagePattern", ""];
Sisyph.Store[cx, "NullRBlockPattern", ""];
Sisyph.Store[cx, "FaultAIdStatusMaskRPagePattern", ""];
Sisyph.Store[cx, "FaultAIdStatusMaskRBlockPattern", ""];
Sisyph.Store[cx, "StatusSetRPagePattern", ""];
Sisyph.Store[cx, "StatusSetRBlockPattern", ""];
Sisyph.Store[cx, "ModesRPagePattern", ""];
Sisyph.Store[cx, "ModesRBlockPattern", ""];
END;
Define all the dependent variables
BEGIN
numBitsPerWord: NAT ← numBitsPerByte*numBytesPerWord;
numBitsPerCycle: NAT ← numBitsPerWord*numWordsPerCycle;
numBitsPerLine: NAT ← numBitsPerCycle*numCyclesPerLine;
numWordsPerLine: NAT ← numWordsPerCycle*numCyclesPerLine;
logNumWordsPerLine: NAT ← SCUtils.Log2[numWordsPerLine];
numPageBits: NAT ← (22*numBitsPerWord)/32;
numBlockBits: NAT ← numBitsPerWord-numPageBits-logNumWordsPerLine;
numDevIdBits: NAT ← (10*numBitsPerCycle)/64;
numBitsPerHeader: NAT ← 7+numDevIdBits+numBitsPerWord;
Sisyph.Store[cx, "numBitsPerWord", NEW[NAT ← numBitsPerWord]];
Sisyph.Store[cx, "numBitsPerCycle", NEW[NAT ← numBitsPerCycle]];
Sisyph.Store[cx, "numBitsPerLine", NEW[NAT ← numBitsPerLine]];
Sisyph.Store[cx, "numWordsPerLine", NEW[NAT ← numWordsPerLine]];
Sisyph.Store[cx, "logNumWordsPerLine", NEW[NAT ← logNumWordsPerLine]];
Sisyph.Store[cx, "numPageBits", NEW[NAT ← numPageBits]];
Sisyph.Store[cx, "numBlockBits", NEW[NAT ← numBlockBits]];
Sisyph.Store[cx, "numDevIdBits", NEW[NAT ← numDevIdBits]];
Sisyph.Store[cx, "numBitsPerHeader", NEW[NAT ← numBitsPerHeader]];
END;
};
END.