Replies: 4 comments 12 replies
-
It seems like a fifo whose content can be read by index. |
Beta Was this translation helpful? Give feedback.
-
If it's a small window I've tried using multiple stream stages then concatenating the data from each one. This also exposes the valid signals. You'll need some logic to let it fill properly. |
Beta Was this translation helpful? Give feedback.
-
Well I've written my own version as per @kleinai 's idea. Any suggestions? class PE(g: PEGenerics) extends Component {
import g._
val io = new Bundle {
val input = slave Stream (Pixel)
val output = master Stream (Vec(Pixel, 3))
}
val shift = Vec(Stream(Pixel), 3)
shift.last <-< io.input
for (i <- 0 until (shift.length - 1)) {
shift(i) <-< shift(i + 1)
}
io.output << shift(0).haltWhen(~shift.map(_.valid).andR).translateWith {
Vec(shift.map(_.payload))
}
} |
Beta Was this translation helpful? Give feedback.
-
I'm sorry to revive this old post but... I'm considering whether it is sensible to use the proposed design, under scenarios when the payload is small(one bit as an extreme example) and the overhead might be... not negligible. |
Beta Was this translation helpful? Give feedback.
-
To implement a convolution layer in CNN, the hardware will first extract, in sequential or in parallel, all possible subsets from the input array. And since every subset overlaps with its neighbour and shares the same data, it is often wise to use a set of shift registers. But how does it fit into the
Stream
model?Specifically, I'd like to ask if and how the following design can be made:
Given a row of input pixels:
In sequential, the hardware will output:
Beta Was this translation helpful? Give feedback.
All reactions