summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main
diff options
context:
space:
mode:
authorSchuyler Eldridge2019-05-09 16:48:36 -0400
committerSchuyler Eldridge2019-05-09 19:45:25 -0400
commit356d5c99c233540e4d993ccc365a7069d9d2beaa (patch)
tree82453617fec3957e33724eb3a0fd25dd060d803f /chiselFrontend/src/main
parent6be76f79f873873497e40fa647f9456391b4d59a (diff)
PRNG state UInt->Vec[Bool], make async reset safe
Changes the internal state of PRNG to use Vec[Bool] instead of UInt. This fixes an @aswaterman identified future problem with asynchronous reset. A register with an asynchronous reset can only be reset to a literal. Previously, an LFSR would store state as a UInt. If it was not parameterized with a seed it should have its least significant bit reset to something to avoid locking up. It's ideal to not reset the full UInt (better test coverage, decreased reset fanout). However, it's difficult to only reset one bit of a UInt. Conversely, it's trivial to reset one bit of a Vec[Bool]. This also moves PRNG/LFSR closer to a canonical representation of their internal state, i.e., it's natural to think of generalizing Vec[Bool] to arbitrary finite fields (Vec[A <: Field]) whereas UInt is tightly coupled to GF2. Minor updates: - Updates/fixes to some scaladoc - Add assertion to period test to make sure LFSR is changing Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'chiselFrontend/src/main')
0 files changed, 0 insertions, 0 deletions