diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index 712138d23..6907041a4 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -841,6 +841,51 @@ static int memtest_addr(void) return errors; } +static void memspeed(void) +{ + volatile unsigned int *array = (unsigned int *)MAIN_RAM_BASE; + int i; + unsigned int start, end; + unsigned long write_speed; + unsigned long read_speed; + __attribute__((unused)) unsigned int data; + + /* init timer */ + timer0_en_write(0); + timer0_reload_write(0); + timer0_load_write(0xffffffff); + timer0_en_write(1); + + /* write speed */ + timer0_update_value_write(1); + start = timer0_value_read(); + for(i=0;i