1
0

TLBuffer: move TLBufferParams to diplomacy.BufferParams

This commit is contained in:
Wesley W. Terpstra
2017-03-16 15:19:36 -07:00
parent 778c8a5c97
commit ca2c709d29
5 changed files with 41 additions and 41 deletions

View File

@ -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)
}