Show speeds in bytes per second.
Forcing megabytes per second for everyone does not make sense. Showing bytes per second allows to distinguish between low performance and a performance measurement bug. Anyway previous code claims speeds were in MiB/s, they were not, actually MB/s.
This commit is contained in:
parent
cbbbb3f468
commit
f71275a3f1
|
@ -179,7 +179,7 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only)
|
||||||
{
|
{
|
||||||
volatile unsigned long *array = (unsigned long *)addr;
|
volatile unsigned long *array = (unsigned long *)addr;
|
||||||
int i;
|
int i;
|
||||||
unsigned int start, end;
|
uint32_t start, end;
|
||||||
unsigned long write_speed = 0;
|
unsigned long write_speed = 0;
|
||||||
unsigned long read_speed;
|
unsigned long read_speed;
|
||||||
__attribute__((unused)) unsigned long data;
|
__attribute__((unused)) unsigned long data;
|
||||||
|
@ -202,8 +202,10 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only)
|
||||||
}
|
}
|
||||||
timer0_update_value_write(1);
|
timer0_update_value_write(1);
|
||||||
end = timer0_value_read();
|
end = timer0_value_read();
|
||||||
write_speed = (size*(CONFIG_CLOCK_FREQUENCY/1000000))/(start - end);
|
uint64_t numerator = ((uint64_t)size)*((uint64_t)CONFIG_CLOCK_FREQUENCY);
|
||||||
printf(" Write: %ldMiB/s\n", write_speed);
|
uint64_t denominator = ((uint64_t)start - (uint64_t)end);
|
||||||
|
write_speed = numerator/denominator;
|
||||||
|
printf(" Write speed: %lub/s\n", write_speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flush CPU and L2 caches */
|
/* flush CPU and L2 caches */
|
||||||
|
@ -221,8 +223,10 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only)
|
||||||
}
|
}
|
||||||
timer0_update_value_write(1);
|
timer0_update_value_write(1);
|
||||||
end = timer0_value_read();
|
end = timer0_value_read();
|
||||||
read_speed = (size*(CONFIG_CLOCK_FREQUENCY/1000000))/(start - end);
|
uint64_t numerator = ((uint64_t)size)*((uint64_t)CONFIG_CLOCK_FREQUENCY);
|
||||||
printf(" Read: %ldMiB/s\n", read_speed);
|
uint64_t denominator = ((uint64_t)start - (uint64_t)end);
|
||||||
|
read_speed = numerator/denominator;
|
||||||
|
printf(" Read speed: %lub/s\n", read_speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
int memtest(unsigned int *addr, unsigned long maxsize)
|
int memtest(unsigned int *addr, unsigned long maxsize)
|
||||||
|
|
Loading…
Reference in New Issue