summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/random/GaloisLFSR.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/chisel3/util/random/GaloisLFSR.scala')
-rw-r--r--src/main/scala/chisel3/util/random/GaloisLFSR.scala16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main/scala/chisel3/util/random/GaloisLFSR.scala b/src/main/scala/chisel3/util/random/GaloisLFSR.scala
index 3a61df95..85a6afde 100644
--- a/src/main/scala/chisel3/util/random/GaloisLFSR.scala
+++ b/src/main/scala/chisel3/util/random/GaloisLFSR.scala
@@ -45,18 +45,14 @@ class GaloisLFSR(
step: Int = 1,
updateSeed: Boolean = false) extends PRNG(width, seed, step, updateSeed) with LFSR {
- def delta(s: UInt): UInt = {
- val in = s.asBools
- val first = in.head
- val out = Wire(Vec(s.getWidth, Bool()))
- out
- .zip(in.tail :+ first)
+ def delta(s: Seq[Bool]): Seq[Bool] = {
+ val first = s.head
+ (s.tail :+ first)
.zipWithIndex
- .foreach {
- case ((l, r), i) if taps(i + 1) && (i + 1 != out.size) => l := reduction(r, first)
- case ((l, r), _) => l := r
+ .map {
+ case (a, i) if taps(i + 1) && (i + 1 != s.size) => reduction(a, first)
+ case (a, _) => a
}
- out.asUInt
}
}