Line 41... |
Line 41... |
{
|
{
|
MEMLOC32 mem32 = 0;
|
MEMLOC32 mem32 = 0;
|
unsigned long i;
|
unsigned long i;
|
|
|
for(i=nFrom; i<nTo; i+=4) {
|
for(i=nFrom; i<nTo; i+=4) {
|
mem32 = i;
|
mem32 = (unsigned long*)i;
|
*mem32 = 0UL;
|
*mem32 = 0UL;
|
}
|
}
|
}
|
}
|
|
|
unsigned long mc_test_row_8(int run, int seq, unsigned long nFrom, unsigned long nTo)
|
unsigned long mc_test_row_8(int run, int seq, unsigned long nFrom, unsigned long nTo)
|
Line 86... |
Line 86... |
pattern32 = (pattern16 << 16); break;
|
pattern32 = (pattern16 << 16); break;
|
case 4:
|
case 4:
|
pattern32 = pattern16 = pattern = 0; inc = 1; break;
|
pattern32 = pattern16 = pattern = 0; inc = 1; break;
|
} /*switch*/
|
} /*switch*/
|
|
|
printf ("\tmc_test_row_8(0x%02lX, %d, 0x%08lX, 0x%08lX);\n", pattern, seq, nFrom, nTo);
|
printf ("\tmc_test_row_8(0x%02dX, %d, 0x%08lX, 0x%08lX);\n", pattern, seq, nFrom, nTo);
|
|
|
switch (seq) {
|
switch (seq) {
|
case 0: /*seq. row write, row read*/
|
case 0: /*seq. row write, row read*/
|
for (i=nFrom; i<nTo; i++) {
|
for (i=nFrom; i<nTo; i++) {
|
mem8 = i;
|
mem8 = (unsigned char*)i;
|
*mem8 = pattern;
|
*mem8 = pattern;
|
if (inc) pattern++;
|
if (inc) pattern++;
|
} /*for*/
|
} /*for*/
|
|
|
if (inc) pattern = 0;
|
if (inc) pattern = 0;
|
for (i=nFrom; i<nTo; i++) {
|
for (i=nFrom; i<nTo; i++) {
|
mem8 = i;
|
mem8 = (unsigned char*)i;
|
read = *mem8;
|
read = *mem8;
|
|
|
if ( read != pattern ) {
|
if ( read != pattern ) {
|
printf("\ti=%lX, read=0x%02lX, pattern=0x%02lX\n", i, read, pattern);
|
printf("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
|
return (unsigned long)mem8;
|
return (unsigned long)mem8;
|
}
|
}
|
|
|
if (inc) pattern++;
|
if (inc) pattern++;
|
} /*for*/
|
} /*for*/
|
break;
|
break;
|
case 1: /*seq. word write, word read*/
|
case 1: /*seq. word write, word read*/
|
for (i=nFrom; i<nTo; i++) {
|
for (i=nFrom; i<nTo; i++) {
|
mem8 = i;
|
mem8 = (unsigned char*)i;
|
*mem8 = pattern;
|
*mem8 = pattern;
|
read = *mem8;
|
read = *mem8;
|
|
|
if (read != pattern ) {
|
if (read != pattern ) {
|
printf("\ti=%lX, read=0x%02lX, pattern=0x%02lX\n", i, read, pattern);
|
printf("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
|
return (unsigned long)mem8;
|
return (unsigned long)mem8;
|
}
|
}
|
|
|
mem16 = (i & 0xFFFFFFFELU);
|
mem16 = (unsigned short*)(i & 0xFFFFFFFELU);
|
read16 = *mem16;
|
read16 = *mem16;
|
if (read16 != pattern16) {
|
if (read16 != pattern16) {
|
printf("\ti=%lX, read16=0x%04lX, pattern16=0x%04lX\n", i, read16, pattern16);
|
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
|
return (unsigned long)mem16;
|
return (unsigned long)mem16;
|
}
|
}
|
mem32 = (i & 0xFFFFFFFCLU);
|
mem32 = (unsigned long*)(i & 0xFFFFFFFCLU);
|
read32 = *mem32;
|
read32 = *mem32;
|
if (read32 != pattern32) {
|
if (read32 != pattern32) {
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
return (unsigned long)mem32;
|
return (unsigned long)mem32;
|
}
|
}
|
Line 152... |
Line 152... |
} /*switch i%4*/
|
} /*switch i%4*/
|
} /*for*/
|
} /*for*/
|
break;
|
break;
|
case 2: /*rand. word write, word read*/
|
case 2: /*rand. word write, word read*/
|
for (i=0; i<nWords; i++) {
|
for (i=0; i<nWords; i++) {
|
mem8 = nFrom + random(nWords);
|
mem8 = (unsigned char*)(nFrom + random(nWords));
|
*mem8 = pattern;
|
*mem8 = pattern;
|
read = *mem8;
|
read = *mem8;
|
|
|
if (read != pattern ) {
|
if (read != pattern ) {
|
printf("\ti=%lX, read=0x%02lX, pattern=0x%02lX\n", i, read, pattern);
|
printf("\ti=%lX, read=0x%02dX, pattern=0x%02dX\n", i, read, pattern);
|
return (unsigned long)mem8;
|
return (unsigned long)mem8;
|
}
|
}
|
|
|
if (inc) pattern++;
|
if (inc) pattern++;
|
}
|
}
|
Line 201... |
Line 201... |
pattern32 = (pattern16 << 16); break;
|
pattern32 = (pattern16 << 16); break;
|
case 4:
|
case 4:
|
pattern16 = pattern32 = 0; inc = 1; break;
|
pattern16 = pattern32 = 0; inc = 1; break;
|
} /*switch*/
|
} /*switch*/
|
|
|
printf ("\tmc_test_row_16(0x%04lX, %d, 0x%08lX, 0x%08lX);\n", pattern16, seq, nFrom, nTo);
|
printf ("\tmc_test_row_16(0x%04dX, %d, 0x%08lX, 0x%08lX);\n", pattern16, seq, nFrom, nTo);
|
|
|
switch (seq) {
|
switch (seq) {
|
case 0: /*seq. row write, row read*/
|
case 0: /*seq. row write, row read*/
|
for (i=nFrom; i<nTo; i+=2) {
|
for (i=nFrom; i<nTo; i+=2) {
|
mem16 = i;
|
mem16 = (unsigned short*)i;
|
*mem16 = pattern16;
|
*mem16 = pattern16;
|
if (inc) pattern16++;
|
if (inc) pattern16++;
|
} /*for*/
|
} /*for*/
|
|
|
if (inc) pattern16 = 0;
|
if (inc) pattern16 = 0;
|
for (i=nFrom; i<nTo; i+=2) {
|
for (i=nFrom; i<nTo; i+=2) {
|
mem16 = i;
|
mem16 = (unsigned short*)i;
|
read16 = *mem16;
|
read16 = *mem16;
|
|
|
if ( read16 != pattern16 ) {
|
if ( read16 != pattern16 ) {
|
printf("\ti=%lX, read16=0x%04lX, pattern16=0x%04lX\n", i, read16, pattern16);
|
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
|
return (unsigned long)mem16;
|
return (unsigned long)mem16;
|
}
|
}
|
|
|
if (inc) pattern16++;
|
if (inc) pattern16++;
|
} /*for*/
|
} /*for*/
|
break;
|
break;
|
case 1: /*seq. word write, word read*/
|
case 1: /*seq. word write, word read*/
|
for (i=nFrom; i<nTo; i+=2) {
|
for (i=nFrom; i<nTo; i+=2) {
|
mem16 = i;
|
mem16 = (unsigned short*)i;
|
*mem16 = pattern16;
|
*mem16 = pattern16;
|
read16 = *mem16;
|
read16 = *mem16;
|
|
|
if (read16 != pattern16 ) {
|
if (read16 != pattern16 ) {
|
printf("\ti=%lX, read16=0x%04lX, pattern16=0x%04lX\n", i, read16, pattern16);
|
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
|
return (unsigned long)mem16;
|
return (unsigned long)mem16;
|
}
|
}
|
|
|
mem32 = (i & 0xFFFFFFFCLU);
|
mem32 = (unsigned long*)(i & 0xFFFFFFFCLU);
|
read32 = *mem32;
|
read32 = *mem32;
|
if (read32 != pattern32) {
|
if (read32 != pattern32) {
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
return (unsigned long)mem32;
|
return (unsigned long)mem32;
|
}
|
}
|
Line 253... |
Line 253... |
} /*switch i%4*/
|
} /*switch i%4*/
|
} /*for*/
|
} /*for*/
|
break;
|
break;
|
case 2: /*rand. word write, word read*/
|
case 2: /*rand. word write, word read*/
|
for (i=0; i<nWords; i++) {
|
for (i=0; i<nWords; i++) {
|
mem16 = nFrom + random(nWords)*2;
|
mem16 = (unsigned short*)(nFrom + random(nWords)*2);
|
*mem16 = pattern16;
|
*mem16 = pattern16;
|
read16 = *mem16;
|
read16 = *mem16;
|
|
|
if (read16 != pattern16 ) {
|
if (read16 != pattern16 ) {
|
printf("\ti=%lX, read16=0x%04lX, pattern16=0x%04lX\n", i, read16, pattern16);
|
printf("\ti=%lX, read16=0x%04dX, pattern16=0x%04dX\n", i, read16, pattern16);
|
return (unsigned long)mem16;
|
return (unsigned long)mem16;
|
}
|
}
|
|
|
if (inc) pattern16++;
|
if (inc) pattern16++;
|
}
|
}
|
Line 299... |
Line 299... |
printf ("\tmc_test_row_32(0x%08lX, %d, 0x%08lX, 0x%08lX);\n", pattern32, seq, nFrom, nTo);
|
printf ("\tmc_test_row_32(0x%08lX, %d, 0x%08lX, 0x%08lX);\n", pattern32, seq, nFrom, nTo);
|
|
|
switch (seq) {
|
switch (seq) {
|
case 0: /*seq. row write, row read*/
|
case 0: /*seq. row write, row read*/
|
for (i=nFrom; i<nTo; i+=4) {
|
for (i=nFrom; i<nTo; i+=4) {
|
mem32 = i;
|
mem32 = (unsigned long*)i;
|
*mem32 = pattern32;
|
*mem32 = pattern32;
|
if (inc) pattern32 += 4;
|
if (inc) pattern32 += 4;
|
} /*for*/
|
} /*for*/
|
|
|
if (inc) pattern32 = nFrom;
|
if (inc) pattern32 = nFrom;
|
for (i=nFrom; i<nTo; i+=4) {
|
for (i=nFrom; i<nTo; i+=4) {
|
mem32 = i;
|
mem32 = (unsigned long *)i;
|
read32 = *mem32;
|
read32 = *mem32;
|
|
|
if ( read32 != pattern32 ) {
|
if ( read32 != pattern32 ) {
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
return (unsigned long)mem32;
|
return (unsigned long)mem32;
|
Line 319... |
Line 319... |
if (inc) pattern32 += 4;
|
if (inc) pattern32 += 4;
|
} /*for*/
|
} /*for*/
|
break;
|
break;
|
case 1: /*seq. word write, word read*/
|
case 1: /*seq. word write, word read*/
|
for (i=nFrom; i<nTo; i+=4) {
|
for (i=nFrom; i<nTo; i+=4) {
|
mem32 = i;
|
mem32 = (unsigned long*)i;
|
*mem32 = pattern32;
|
*mem32 = pattern32;
|
read32 = *mem32;
|
read32 = *mem32;
|
|
|
if (read32 != pattern32 ) {
|
if (read32 != pattern32 ) {
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
Line 334... |
Line 334... |
|
|
}
|
}
|
break;
|
break;
|
case 2: /*rand. word write, word read*/
|
case 2: /*rand. word write, word read*/
|
for (i=0; i<nWords; i++) {
|
for (i=0; i<nWords; i++) {
|
mem32 = nFrom + random(nWords)*4;
|
mem32 = (unsigned long*)(nFrom + random(nWords)*4);
|
if (inc) pattern32 = mem32;
|
if (inc)
|
|
pattern32 = (unsigned long)mem32;
|
*mem32 = pattern32;
|
*mem32 = pattern32;
|
read32 = *mem32;
|
read32 = *mem32;
|
|
|
if (read32 != pattern32 ) {
|
if (read32 != pattern32 ) {
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|
printf("\ti=%lX, read32=0x%08lX, pattern32=0x%08lX\n", i, read32, pattern32);
|