tilelink2: fix a bug in UIntToOH1 triggered if the size was too big
This commit is contained in:
1 parent
9f45212c95
commit
cf0291061d
3 files changed
+4
-5
No files matched your search
@@ -12,8 +12,7 @@ class TLEdge(
|
||||
{
|
||||
def isAligned(address: UInt, lgSize: UInt) =
|
||||
if (maxLgSize == 0) Bool(true) else {
|
||||
val ones = UInt((1 << maxLgSize) - 1)
|
||||
val mask = (ones << lgSize)(maxLgSize*2-1, maxLgSize)
|
||||
val mask = ~(SInt(-1, width=maxLgSize).asUInt << lgSize)(maxLgSize-1, 0)
|
||||
(address & mask) === UInt(0)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user