bios/sdram: Use an LFSR to speed up pseudo-random number generation
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 6 May 2020 19:54:27 +0000 (21:54 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 6 May 2020 19:56:10 +0000 (21:56 +0200)
commit99c5b0fca1d1db5317d53407f7f238d25d10e8a2
tree3d51fcf0cc63b87af8aa5c4dd1e32ff5b32db854
parent34f268689aa82057a95771329d3f425bf256a136
bios/sdram: Use an LFSR to speed up pseudo-random number generation

This speeds up the memory test by an order of magnitude, esp. on
cores without a hardware multiplier by getting rid of the
multiplication in the loop.

The LFSR implementation comes from microwatt's simple_random test
project.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
litex/soc/software/bios/lfsr.h [new file with mode: 0644]
litex/soc/software/bios/sdram.c