2 ** Fill RAM with pseudoranom data and read back its content
6 volatile uint32_t *ram_begin = (uint32_t *) 0x80100000; // test start
7 volatile uint32_t *ram_end = (uint32_t *) 0x82000000; // test end
10 static uint32_t rngseed = 123459876;
18 * Compute x[n + 1] = (7^5 * x[n]) mod (2^31 - 1).
19 * From "Random number generators: good ones are hard to find",
20 * Park and Miller, Communications of the ACM, vol. 31, no. 10,
21 * October 1988, p. 1195.
23 /* Can't be initialized with 0, so use another value. */
24 if ((x = rngseed) == 0)
28 t = 16807 * lo - 2836 * hi;
35 void ram_test(char *a)
37 volatile uint32_t *addr;
39 static uint32_t seed = 123459876;
41 for(addr = ram_begin; addr < ram_end; addr +=4)
44 for(addr = ram_begin; addr < ram_end; addr +=4)
48 sprintf(a, "RAM: ERRORS:%d FAIL\n", errors);
50 sprintf(a, "RAM: OK\n");
51 seed++; // change seed each time