hdlspinalhdl

How to connect a Flow to a Stream in SpinalHDL


I have a write sensitive APB register which shall push into a FIFO with clock domain crossing. I though I would write:

val myFlow = Flow(...)
busCtrl.driveFlow(myFlow,address=4)
val myFifo = StreamFifoCC(...)
myFifo.io.push << myFlow

But the << operator requires a Stream, so a type error happens.


Solution

  • myFifo.io.push << myFlow.toStream
    

    Should be fine, if the fifo overflow, the myFlow transaction will be lost