1
0
Fork 0

ShiftQueue: added a helper object

This commit is contained in:
Wesley W. Terpstra 2017-09-06 14:26:26 -07:00
parent 3e3024c256
commit 50d5d8c1fd
1 changed files with 9 additions and 0 deletions

View File

@ -52,3 +52,12 @@ class ShiftQueue[T <: Data](gen: T,
io.mask := valid.asUInt
io.count := PopCount(io.mask)
}
object ShiftQueue
{
def apply[T <: Data](enq: DecoupledIO[T], entries: Int = 2, pipe: Boolean = false, flow: Boolean = false): DecoupledIO[T] = {
val q = Module(new ShiftQueue(enq.bits.cloneType, entries, pipe, flow))
q.io.enq <> enq
q.io.deq
}
}