Here's what I'm trying to accomplish: I have a Chisel accelerator which calls another Chisel accelerator and passes in a value. I want the second one to have a while loop in it where the condition is partially based on the input value. Here's some sample code:
class Module1 extends Module {
val in = 0.U
val Module2Module = Module2()
Module2Module.io.in := in
}
class Module2 extends Module {
val io = IO(new Bundle {
val in = Input(Reg(UInt))
}
val test = 0.U
while (test < io.in) {
}
}
I'm getting the error that "test < io.in" is a chisel.Bool, not a Boolean. I know that I can't convert that to Scala types, right?
What is the proper way to implement this? Is it by having signals sent to/from Module1 to Module2 to indicate that the accelerator isn't done yet and to only proceed when it is? If so, wouldn't this get complex quickly, if you have several functions, each in different modules?