tilelink2 Filter: make transfer cap robust against large filters
This commit is contained in:
parent
4a2cf6431b
commit
9d77e34bee
@ -14,7 +14,10 @@ class TLFilter(select: AddressSet) extends LazyModule
|
|||||||
managerFn = { case Seq(mp) =>
|
managerFn = { case Seq(mp) =>
|
||||||
mp.copy(managers = mp.managers.map { m =>
|
mp.copy(managers = mp.managers.map { m =>
|
||||||
val filtered = m.address.map(_.intersect(select)).flatten
|
val filtered = m.address.map(_.intersect(select)).flatten
|
||||||
val cap = TransferSizes(1, select.alignment.toInt)
|
val alignment = select.alignment /* alignment 0 means 'select' selected everything */
|
||||||
|
val maxTransfer = 1 << 30
|
||||||
|
val capTransfer = if (alignment == 0 || alignment > maxTransfer) maxTransfer else alignment.toInt
|
||||||
|
val cap = TransferSizes(1, capTransfer)
|
||||||
if (filtered.isEmpty) { None } else {
|
if (filtered.isEmpty) { None } else {
|
||||||
Some(m.copy(
|
Some(m.copy(
|
||||||
address = filtered,
|
address = filtered,
|
||||||
|
Loading…
Reference in New Issue
Block a user