CRIllinoisTest.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last Edited by: Gasbarro August 28, 1985 5:53:58 pm PDT
DIRECTORY
Basics,
BitmapViewer,
BitOps,
CRIO,
ImagerPixelMap,
Process,
ViewerClasses;
CRIllinoisTest:
CEDAR
PROGRAM
IMPORTS Basics, BitmapViewer, BitOps, CRIO, ImagerPixelMap, Process =
BEGIN
Address: TYPE = [0..2048);
Size: INT = LAST[Address]+1;
DataIndex: TYPE = [0..32);
LastDataIndex: DataIndex = 31;
LastRow: INT = 255;
LastColumn: INT = 255;
rectangle: ImagerPixelMap.DeviceRectangle = [0, 0, LastRow+1, LastColumn+1];
dataViewer: ViewerClasses.Viewer;
dataBitmap: ImagerPixelMap.PixelMap;
errorViewer: ViewerClasses.Viewer;
errorBitmap: ImagerPixelMap.PixelMap;
hardwareExists: BOOL ← FALSE;
Start:
PROCEDURE = {
dataViewer ← BitmapViewer.Create[info: [name: "CrossRAM Data Bit Map"]];
dataBitmap ← ImagerPixelMap.Create[0, rectangle];
errorViewer ← BitmapViewer.Create[info: [name: "CrossRAM Error Bit Map"]];
errorBitmap ← ImagerPixelMap.Create[0, rectangle];
BitmapViewer.SetBitmap[dataViewer, dataBitmap];
BitmapViewer.SetBitmap[errorViewer, errorBitmap];
CRIO.Init[TRUE];
CRIO.EmergencyRefresh[TRUE];
CRIO.Test[TRUE];
Process.Pause[Process.MsecToTicks[500]];
};
IllinoisPattern:
PROCEDURE [] = {
StepIndex: TYPE = [0..8);
complementUpper: ARRAY StepIndex OF BOOL = [TRUE,TRUE,FALSE,TRUE,FALSE,FALSE,TRUE,FALSE];
writeData: ARRAY StepIndex OF BOOL = [TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,FALSE];
readData: ARRAY StepIndex OF BOOL = [FALSE,FALSE,FALSE,TRUE,TRUE,TRUE,TRUE,FALSE];
halfBit: INT ← Size;
ClearErrorMap[];
write zero to all locations
divide RAM by columns instead of rows
FOR address: Address
IN Address
DO
CycleRAM[address, 0, TRUE];
ENDLOOP;
UNTIL (halfBit ← halfBit/2) = 4
DO
FOR step: StepIndex
IN StepIndex
DO
HalfStep[upper: complementUpper[step], data: writeData[step], write: TRUE, halfbit: halfBit];
HalfStep[upper: NOT complementUpper[step], data: readData[step], write: FALSE, halfbit: halfBit];
Refresh[];
Process.CheckForAbort[];
ENDLOOP;
ENDLOOP;
};
HalfStep:
PROC [upper:
BOOL, data:
BOOL, write:
BOOL, halfbit:
INT] = {
address: CARDINAL ← IF upper THEN halfbit ELSE 0;
addressMod: CARDINAL;
DO
CycleRAM[address, IF data THEN 0FFFFFFFFH ELSE 0, write];
address ← address + 1;
addressMod ← address MOD (2*halfbit);
IF (upper AND addressMod=0) OR (NOT upper AND addressMod=halfbit) THEN address ← address + halfbit;
IF address>=Size THEN EXIT;
ENDLOOP;
};
CycleRAM:
PROC [address: Address, data:
LONG
CARDINAL, write:
BOOL] = {
dataBits: BitOps.BitDWord ← BitOps.ILID[data, BitOps.BitDWordZero, 32, 0, 32];
IF write
THEN {
IF hardwareExists THEN CRIO.CRWrite[address, data];
FOR bit:
CARDINAL
IN [0..32)
DO
PutBit[dataBitmap, address, bit, BitOps.EBFD[dataBits, 32, bit]];
ENDLOOP;
}
ELSE {
readData: LONG CARDINAL ← data;
IF hardwareExists THEN readData ← CRIO.CRRead[address];
IF readData#data
THEN {
readBits: BitOps.BitDWord ← BitOps.ILID[readData, BitOps.BitDWordZero, 32, 0, 32];
FOR bit:
CARDINAL
IN [0..32)
DO
IF BitOps.EBFD[dataBits, 32, bit]#BitOps.EBFD[readBits, 32, bit] THEN PutBit[errorBitmap, address, bit, TRUE];
ENDLOOP;
}
};
};
PutBit:
PROC [bitmap: ImagerPixelMap.PixelMap, address: Address, bit: DataIndex, data:
BOOL] = {
the low order bits address left to right
the high order bits address from top to bottom
the data bits are in order from left to right
address ← Basics.BITXOR[address, 2A0H];
ImagerPixelMap.PutPixel[source: bitmap, s: address/8, f: bit*8 + (address MOD 8), val: LOOPHOLE[data, CARDINAL]];
};
Refresh:
PROC = {
BitmapViewer.TouchUp[dataViewer, rectangle];
BitmapViewer.TouchUp[errorViewer, rectangle];
};
ClearErrorMap:
PROC = {
FOR address: Address
IN Address
DO
FOR bit: DataIndex
IN [0..LastDataIndex]
DO
PutBit[errorBitmap, address, bit, FALSE];
ENDLOOP;
ENDLOOP;
};
END.