bios/memtest improve memspeed performances
This commit is contained in:
parent
3510daaf0c
commit
eccd64348d
|
@ -262,6 +262,9 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only, bool rando
|
||||||
unsigned long read_speed;
|
unsigned long read_speed;
|
||||||
__attribute__((unused)) unsigned long data;
|
__attribute__((unused)) unsigned long data;
|
||||||
const unsigned int sz = sizeof(unsigned long);
|
const unsigned int sz = sizeof(unsigned long);
|
||||||
|
int burst_size = 4;
|
||||||
|
volatile unsigned long *ptr, *ptr_max = (volatile unsigned long )(((char *)array) + size - sz*burst_size);
|
||||||
|
|
||||||
|
|
||||||
printf("Memspeed at %p (", addr);
|
printf("Memspeed at %p (", addr);
|
||||||
if (random)
|
if (random)
|
||||||
|
@ -281,9 +284,16 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only, bool rando
|
||||||
if (!read_only) {
|
if (!read_only) {
|
||||||
timer0_update_value_write(1);
|
timer0_update_value_write(1);
|
||||||
start = timer0_value_read();
|
start = timer0_value_read();
|
||||||
for(i = 0; i < size/sz; i++) {
|
|
||||||
array[i] = -1ul;
|
ptr = array;
|
||||||
}
|
do{
|
||||||
|
ptr[0] = -1ul;
|
||||||
|
ptr[1] = -1ul;
|
||||||
|
ptr[2] = -1ul;
|
||||||
|
ptr[3] = -1ul;
|
||||||
|
ptr += burst_size;
|
||||||
|
} while(ptr <= ptr_max);
|
||||||
|
|
||||||
timer0_update_value_write(1);
|
timer0_update_value_write(1);
|
||||||
end = timer0_value_read();
|
end = timer0_value_read();
|
||||||
uint64_t numerator = ((uint64_t)size)*((uint64_t)CONFIG_CLOCK_FREQUENCY);
|
uint64_t numerator = ((uint64_t)size)*((uint64_t)CONFIG_CLOCK_FREQUENCY);
|
||||||
|
@ -311,9 +321,14 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only, bool rando
|
||||||
data = array[seed_32 % num];
|
data = array[seed_32 % num];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < size/sz; i++) {
|
ptr = array;
|
||||||
data = array[i];
|
do{
|
||||||
}
|
data = ptr[0];
|
||||||
|
data = ptr[1];
|
||||||
|
data = ptr[2];
|
||||||
|
data = ptr[3];
|
||||||
|
ptr += burst_size;
|
||||||
|
} while(ptr <= ptr_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
timer0_update_value_write(1);
|
timer0_update_value_write(1);
|
||||||
|
|
Loading…
Reference in New Issue