ShiftQueue: added a helper object
This commit is contained in:
parent
3e3024c256
commit
50d5d8c1fd
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user