-
-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add initialize argument to StreamFifo #1680
base: dev
Are you sure you want to change the base?
Conversation
Hi,
I have no idea how to fix this on scala 2.11.12. need help!!! |
Ahh i already have seen that kinda of scala weird behaviour. It is related to initPayload : => T = null.asInstanceOf[T] |
How about |
Look good |
Spinal error occurs for following StreamFifo instance: case class FifoDemo() extends Component {
val io = new Bundle {
val input = slave Stream (Bool())
val output = master Stream (Bool())
}
val fifo = new StreamFifo(cloneOf(io.input.payload), 1, initPayload = Some(io.input.payload.getZero))
fifo.io.push << io.input
io.output << fifo.io.pop
} Error message:
Looks the problem happens on m2sPipe. Is it possible to change |
into what ? |
If change the |
Hi, case class FrameCtrl() extends Bundle {
val frameStart = Bool()
val frameEnd = Bool()
}
case class StreamM2SPipe[T<:Data] (dataType: HardType[T], initPayload: Option[T] = None) extends Component {
val io = new Bundle {
val in = slave(Stream(dataType))
val out = master(Stream(dataType))
}
initPayload match {
case Some(initValue) => io.out << io.in.m2sPipe(holdPayload = true, initPayload = initValue.asInstanceOf[T])
case None => io.out << io.in.m2sPipe(holdPayload = true)
}
}
object StreamM2SPipeInst extends App {
Config.spinal.generateVerilog(StreamM2SPipe(cloneOf(FrameCtrl()), Some(FrameCtrl().getZero)))
//Config.spinal.generateVerilog(StreamM2SPipe(Bits(32 bits)))
} Spinal errors: ` Design's errors are listed above.
` |
Ahhh would realy need to have a lambda function in the mix :/ Because the Some(FrameCtrl().getZero) does try to generate hardware directly. (that would be delayed to withing the component via a lambda function) |
Closes #
Context, Motivation & Description
Register constructed
StreamFifo
can be fully initialized when necessary.Impact on code generation
Checklist
/** */
?