1
0
Fork 0
sifive-blocks/src/main/scala/util/ShiftReg.scala

12 lines
259 B
Scala
Raw Normal View History

2016-11-29 13:08:44 +01:00
// See LICENSE for license details.
package sifive.blocks.util
import Chisel._
object ShiftRegisterInit {
def apply[T <: Data](in: T, n: Int, init: T): T =
(0 until n).foldLeft(in) {
case (next, _) => Reg(next, next = next, init = init)
}
}