YosysHQ / icestorm

Project IceStorm - Lattice iCE40 FPGAs Bitstream Documentation (Reverse Engineered)
ISC License
965 stars 224 forks source link

Make icebram deterministic #260

Closed whitequark closed 4 years ago

whitequark commented 4 years ago

The direct cause of this PR is WASI support. WASI doesn't have getpid. However, it does have getrandom, so using that is an alternative.

That being said, the discovery that icebram will produce nondeterministic result was an unexpected one for me, and relying on PID specifically seems to be the worst of both options: it breaks reproducible builds, but also it does not guarantee unique values, since PIDs can roll over and it doesn't take very long.

I would prefer to have deterministic icebram, so I went with that option in the PR.