TLBuffer: move TLBufferParams to diplomacy.BufferParams
This commit is contained in:
@ -219,3 +219,20 @@ object AddressSet
|
||||
if (out.size != n) unify(out) else out.toList
|
||||
}
|
||||
}
|
||||
|
||||
case class BufferParams(depth: Int, flow: Boolean, pipe: Boolean)
|
||||
{
|
||||
require (depth >= 0)
|
||||
def isDefined = depth > 0
|
||||
def latency = if (isDefined && !flow) 1 else 0
|
||||
}
|
||||
|
||||
object BufferParams
|
||||
{
|
||||
implicit def apply(depth: Int): BufferParams = BufferParams(depth, false, false)
|
||||
|
||||
val default = BufferParams(2)
|
||||
val none = BufferParams(0)
|
||||
val flow = BufferParams(1, true, false)
|
||||
val pipe = BufferParams(1, false, true)
|
||||
}
|
||||
|
Reference in New Issue
Block a user