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

This commit is contained in:
Wesley W. Terpstra committed 2016-09-05 20:58:41 -07:00
1 parent 9f45212c95
commit cf0291061d
3 files changed
+4 -5

No files matched your search

@@ -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))