1
0

tilelink2: maxLgSize should be accurate (#332)

This commit is contained in:
Wesley W. Terpstra 2016-09-22 22:06:22 -07:00 committed by GitHub
parent 7ee79efc15
commit 47843d8ec1
2 changed files with 7 additions and 3 deletions

View File

@ -216,8 +216,12 @@ class TLEdge(
x match { x match {
case _: TLBundleE => UInt(0) case _: TLBundleE => UInt(0)
case bundle: TLDataChannel => { case bundle: TLDataChannel => {
val decode = UIntToOH1(size(bundle), maxLgSize) >> log2Ceil(manager.beatBytes) if (maxLgSize == 0) {
Mux(hasData(bundle), decode, UInt(0)) UInt(0)
} else {
val decode = UIntToOH1(size(bundle), maxLgSize) >> log2Ceil(manager.beatBytes)
Mux(hasData(bundle), decode, UInt(0))
}
} }
} }
} }

View File

@ -383,7 +383,7 @@ case class TLEdgeParameters(
manager: TLManagerPortParameters) manager: TLManagerPortParameters)
{ {
val maxTransfer = max(client.maxTransfer, manager.maxTransfer) val maxTransfer = max(client.maxTransfer, manager.maxTransfer)
val maxLgSize = log2Up(maxTransfer) val maxLgSize = log2Ceil(maxTransfer)
// Sanity check the link... // Sanity check the link...
require (maxTransfer >= manager.beatBytes) require (maxTransfer >= manager.beatBytes)