Walkpat内存测试

时间:2013-06-27 09:08:13

标签: c testing ram

有没有人知道有关学习RAM上的walkpat内存测试的任何好资源?如果你能提供更好的伪代码或C代码。提前谢谢!

1 个答案:

答案 0 :(得分:0)

volatile int *ptr;  // volatile because the compiler would otherwise outsmart you and not actually read the memory

for(ptr=0; ptr<SIZE; ptr++) {
    int test = 1;
    do {
        *ptr = test;
        if( *ptr != test ) FAIL();
        test <<= 1;        // walk that 1 through the word, until it falls off the end.
    } while(test);
}