From 83d24d087d4c7856d672f3316a492adbf48205fd Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Wed, 8 Jul 2020 17:13:37 +1000 Subject: [PATCH] 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 --- litex/soc/software/libbase/memtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- 2.30.2