diff --git a/src/main/scala/util/ShiftReg.scala b/src/main/scala/util/ShiftReg.scala index 204d8195..917447f8 100644 --- a/src/main/scala/util/ShiftReg.scala +++ b/src/main/scala/util/ShiftReg.scala @@ -11,7 +11,7 @@ object ShiftRegInit { def apply[T <: Data](in: T, n: Int, init: T, name: Option[String] = None): T = (0 until n).foldRight(in) { - case (next, i) => { + case (i, next) => { val r = Reg(next, next = next, init = init) name.foreach { na => r.suggestName(s"${na}_${i}") } r @@ -52,7 +52,7 @@ object AbstractPipelineReg { } class AsyncResetShiftReg(w: Int = 1, depth: Int = 1, init: Int = 0, name: String = "pipe") extends AbstractPipelineReg(w) { - require(depth >= 0, "Depth must be greater than or equal to 0.") + require(depth > 0, "Depth must be greater than 0.") override def desiredName = s"AsyncResetShiftReg_w${w}_d${depth}_i${init}"