
70 Chapter 6: Memory
baseAddress[offset] = pattern;
}
/*
* Check for address bits stuck high.
*/
testOffset = 0;
baseAddress[testOffset] = antipattern;
for (offset = sizeof(datum); (offset & addressMask) != 0; offset <<= 1)
{
if (baseAddress[offset] != pattern)
{
return ((datum *) &baseAddress[offset]);
}
}
baseAddress[testOffset] = pattern;
/*
* Check for address bits stuck low or shorted.
*/
for (testOffset = sizeof(datum); (testOffset & addressMask) != 0;
testOffset <<= 1)
{
baseAddress[testOffset] = antipattern;
for (offset = sizeof(datum); (offset & addressMask) != 0;
offset <<= 1)
{
if ((baseAddress[offset] != pattern) && (offset != testOffset))
{
return ((datum *) &baseAddress[testOffset]);
}
}
baseAddress[testOffset] = pattern;
}
return (NULL);
} /* memTestAddressBus() */
Device test
Once you know that the address and data bus wiring are correct, it is necessary to
test the integrity of the memory device itself. The thing to test is that every bit in
the device is capable of holding both 0 and 1. This is a fairly straightforward test
to implement, but it takes significantly longer to execute than the previous two.
For a complete device test, you must visit (write and verify) every memory loca-
tion twice. You are free to choose any data value for the first pass, so long as you
invert that value during the second. And because there is a possibility of missing