From: Benjamin Herrenschmidt Date: Wed, 8 Jul 2020 07:13:37 +0000 (+1000) Subject: memspeed: Write a fixed value X-Git-Tag: 24jan2021_ls180~92^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83d24d087d4c7856d672f3316a492adbf48205fd;p=litex.git memspeed: Write a fixed value Otherwise we have at least an extra addition in the loop which squews the result compared to the read loop. Signed-off-by: Benjamin Herrenschmidt --- diff --git a/litex/soc/software/libbase/memtest.c b/litex/soc/software/libbase/memtest.c index 2fd5aedc..2067d5e4 100644 --- a/litex/soc/software/libbase/memtest.c +++ b/litex/soc/software/libbase/memtest.c @@ -185,7 +185,7 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only) timer0_update_value_write(1); start = timer0_value_read(); for(i = 0; i < size/sz; i++) { - array[i] = i; + array[i] = -1ul; } timer0_update_value_write(1); end = timer0_value_read();