There is a Queue in ChiselUtil class that is described in manual as :
// Generic hardware queue. Required
// parameter entries controls the
// depth of the queues. The width of
// the queue is determined from the
// inputs.
// Example usage:
// val q = new Queue(UInt(), 16)
// q.io.enq <> producer.io.out
// consumer.io.in <> q.io.deq
class Queue[T <: Data]
(type: T, entries: Int,
pipe: Boolean = false,
flow: Boolean = false
flushable: Boolean = false)
extends Module
But in the scala code, interface parameters are different : https://github.com/ucb-bar/chisel/blob/master/src/main/scala/ChiselUtil.scala#L426
There is no "flushable" boolean input in code. I can't find the meaning of "pipe" and "flow" parameter.
Is somebody know how to use a Queue to be able to flush it ?
The flushable
parameter does not exist. Not sure what they meant by that. However, there is a way to clear a Queue by tapping into the `_reset' parameter, as shown below:
val my_queue = Module(new Queue(gen = new MyBundle,
entries = queue_sz,
pipe = false,
flow = true,
_reset = (kill_queue || reset.toBool)))
The flow
parameter specifies whether inputs can be consumed on the same cycle (the inputs "flow" through the queue immediately). The "valid" signals are coupled.
The pipe
parameter specifies whether the "ready" signals are combinationally coupled. This allows a one entry queue to run at full throughput (like a pipeline).