For the VecShiftRegisterParam problem, I see that using 'until' in the for loop as follows fails, but using 'to' passes. What is the difference between the two?
class VecShiftRegisterParam(val n: Int, val w: Int) extends Module {
val io = IO(new Bundle {
val in = Input(UInt(w.W))
val out = Output(UInt(w.W))
})
// Implement below ----------
val values = Seq.fill(n) {0.U(w.W)}
val regs = RegInit(Vec(values))
for (i <- 0 until n-2) {
regs(i) := regs(i+1)
}
regs(n-1) := io.in
io.out := regs(0)
}
For the VecShiftRegisterParam problem, I see that using 'until' in the for loop as follows fails, but using 'to' passes. What is the difference between the two?