1
0

tilelink2 Edge: add a numBeats1 method for predecremented code

This commit is contained in:
Wesley W. Terpstra 2016-09-09 20:55:56 -07:00
parent 5604049927
commit d6261e8ce8

View File

@ -192,7 +192,17 @@ class TLEdge(
val cutoff = log2Ceil(manager.beatBytes) val cutoff = log2Ceil(manager.beatBytes)
val small = if (manager.maxTransfer <= manager.beatBytes) Bool(true) else size <= UInt(cutoff) val small = if (manager.maxTransfer <= manager.beatBytes) Bool(true) else size <= UInt(cutoff)
val decode = UIntToOH(size, maxLgSize+1) >> cutoff val decode = UIntToOH(size, maxLgSize+1) >> cutoff
Mux(!hasData || small, UInt(1), decode) Mux(hasData, decode | small.asUInt, UInt(1))
}
}
}
def numBeats1(x: TLChannel): UInt = {
x match {
case _: TLBundleE => UInt(0)
case bundle: TLDataChannel => {
val decode = UIntToOH1(size(bundle), maxLgSize) >> log2Ceil(manager.beatBytes)
Mux(hasData(bundle), decode, UInt(0))
} }
} }
} }