azonenberg / openfpga

Open FPGA tools
Other
257 stars 30 forks source link

Use a RNG independent of machine, OS, endianness, etc #15

Closed whitequark closed 7 years ago

whitequark commented 8 years ago

Instead of libc rand().

cliffordwolf commented 7 years ago

There's a "replace with something a bit more random!" TODO comment at https://github.com/azonenberg/openfpga/commit/69bbfee5166b9b68955917a297fba9ad337bcbe6#diff-b579c079e629248e4673f0d09231a2f2R46.

May I suggest xorshift, xorshift*, or xorshift+? Comparable (xorshift) or better (xorshift*, xorshift+) randomness than Mersenne Twister, but simpler coder and much faster.

cliffordwolf commented 7 years ago

^^ Ignore this. I've just seen Robert did already replace it with PCG.