tilelink2: relax max transfer size; the real requirement is not exceeding alignment
This commit is contained in:
parent
cf0291061d
commit
ded246fb95
@ -17,7 +17,6 @@ class TLFragmenter(minSize: Int, maxSize: Int, alwaysMin: Boolean = false) exten
|
|||||||
require (isPow2 (maxSize))
|
require (isPow2 (maxSize))
|
||||||
require (isPow2 (minSize))
|
require (isPow2 (minSize))
|
||||||
require (minSize < maxSize)
|
require (minSize < maxSize)
|
||||||
require (maxSize <= TransferSizes.maxAllowed)
|
|
||||||
|
|
||||||
val fragmentBits = log2Ceil(maxSize / minSize)
|
val fragmentBits = log2Ceil(maxSize / minSize)
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@ case class TransferSizes(min: Int, max: Int)
|
|||||||
require (min >= 0 && max >= 0)
|
require (min >= 0 && max >= 0)
|
||||||
require (max == 0 || isPow2(max))
|
require (max == 0 || isPow2(max))
|
||||||
require (min == 0 || isPow2(min))
|
require (min == 0 || isPow2(min))
|
||||||
require (max <= TransferSizes.maxAllowed)
|
|
||||||
|
|
||||||
def none = min == 0
|
def none = min == 0
|
||||||
def contains(x: Int) = isPow2(x) && min <= x && x <= max
|
def contains(x: Int) = isPow2(x) && min <= x && x <= max
|
||||||
@ -70,7 +69,6 @@ case class TransferSizes(min: Int, max: Int)
|
|||||||
object TransferSizes {
|
object TransferSizes {
|
||||||
def apply(x: Int) = new TransferSizes(x)
|
def apply(x: Int) = new TransferSizes(x)
|
||||||
val none = new TransferSizes(0)
|
val none = new TransferSizes(0)
|
||||||
val maxAllowed = 4096 // transfers larger than 4kB are forbidden in TL2
|
|
||||||
|
|
||||||
implicit def asBool(x: TransferSizes) = !x.none
|
implicit def asBool(x: TransferSizes) = !x.none
|
||||||
}
|
}
|
||||||
@ -130,6 +128,11 @@ case class TLManagerParameters(
|
|||||||
supportsGet.max,
|
supportsGet.max,
|
||||||
supportsPutFull.max,
|
supportsPutFull.max,
|
||||||
supportsPutPartial.max).max
|
supportsPutPartial.max).max
|
||||||
|
|
||||||
|
// The device had better not support a transfer larger than it's alignment
|
||||||
|
address.foreach({ case a =>
|
||||||
|
require (a.alignment1 >= maxTransfer-1)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
case class TLManagerPortParameters(managers: Seq[TLManagerParameters], beatBytes: Int)
|
case class TLManagerPortParameters(managers: Seq[TLManagerParameters], beatBytes: Int)
|
||||||
|
Loading…
Reference in New Issue
Block a user