1
0

axi4 Fragmenter: optimize dynamic slave lookup

This commit is contained in:
Wesley W. Terpstra 2016-10-12 17:25:29 -07:00
parent 11169d155c
commit 958af132ba

View File

@ -76,9 +76,9 @@ class AXI4Fragmenter(lite: Boolean = false, maxInFlight: Int = 32, combinational
val hi = addr >> lgBytes
val alignment = hi(AXI4Parameters.lenBits-1,0)
val allSame = supportedSizes1.distinct.size == 1
val dynamic1 = Mux1H(slave.findFast(addr), supportedSizes1.map(s => UInt(s)))
val fixed1 = UInt(supportedSizes1(0))
val allSame = supportedSizes1.filter(_ >= 0).distinct.size <= 1
val dynamic1 = Mux1H(slave.findFast(addr), supportedSizes1.map(s => UInt(max(0, s))))
val fixed1 = UInt(supportedSizes1.filter(_ >= 0).headOption.getOrElse(0))
/* We need to compute the largest transfer allowed by the AXI len.
* len+1 is the number of beats to execute.