How to flush a ChiselUtil Queue?

℡╲_俬逩灬. 提交于 2019-12-24 11:31:12

问题


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 ?


回答1:


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).



来源:https://stackoverflow.com/questions/32647523/how-to-flush-a-chiselutil-queue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!