tilelink2: factor out the OH1ToOH function
This commit is contained in:
@ -7,7 +7,7 @@ import chisel3.internal.sourceinfo.SourceInfo
|
||||
import chisel3.util.IrrevocableIO
|
||||
import diplomacy._
|
||||
import scala.math.{min,max}
|
||||
import uncore.tilelink2.{leftOR, rightOR, UIntToOH1}
|
||||
import uncore.tilelink2.{leftOR, rightOR, UIntToOH1, OH1ToOH}
|
||||
|
||||
// lite: masters all use only one ID => reads will not be interleaved
|
||||
class AXI4Fragmenter(lite: Boolean = false, maxInFlight: Int = 32, combinational: Boolean = true) extends LazyModule
|
||||
@ -100,7 +100,7 @@ class AXI4Fragmenter(lite: Boolean = false, maxInFlight: Int = 32, combinational
|
||||
|
||||
// The number of beats-1 to execute
|
||||
val beats1 = Mux(bad, UInt(0), maxSupported1)
|
||||
val beats = ~(~(beats1 << 1 | UInt(1)) | beats1) // beats1 + 1
|
||||
val beats = OH1ToOH(beats1) // beats1 + 1
|
||||
|
||||
val inc_addr = addr + (beats << a.bits.size) // address after adding transfer
|
||||
val wrapMask = a.bits.bytes1() // only these bits may change, if wrapping
|
||||
|
Reference in New Issue
Block a user