1
0

diplomacy: BufferParams can now directly create a Queue

This commit is contained in:
Wesley W. Terpstra
2017-06-14 13:45:12 -07:00
parent 36562ce48e
commit 4a15d47061
2 changed files with 9 additions and 13 deletions

View File

@ -248,6 +248,10 @@ case class BufferParams(depth: Int, flow: Boolean, pipe: Boolean)
require (depth >= 0, "Buffer depth must be >= 0")
def isDefined = depth > 0
def latency = if (isDefined && !flow) 1 else 0
def apply[T <: Data](x: DecoupledIO[T]) =
if (isDefined) Queue(x, depth, flow=flow, pipe=pipe)
else x
}
object BufferParams