1
0

tilelink2: fix a bug in UIntToOH1 triggered if the size was too big

This commit is contained in:
Wesley W. Terpstra
2016-09-04 21:54:23 -07:00
parent 9f45212c95
commit cf0291061d
3 changed files with 4 additions and 5 deletions

View File

@ -139,7 +139,7 @@ class TLFragmenter(minSize: Int, maxSize: Int, alwaysMin: Boolean = false) exten
val maxDownSize = if (alwaysMin) minSize else manager.maxTransfer
def OH1ToUInt(x: UInt) = OHToUInt((x << 1 | UInt(1)) ^ x)
def UIntToOH1(x: UInt, width: Int) = (UInt((1 << width) - 1) << x)(width*2-1, width)
def UIntToOH1(x: UInt, width: Int) = ~(SInt(-1, width=width).asUInt << x)(width-1, 0)
// First, handle the return path
val acknum = RegInit(UInt(0, width = counterBits))