1
0

tilelink2 AddressDecoder: validate output of optimization

This commit is contained in:
Wesley W. Terpstra
2016-09-16 00:49:05 -07:00
parent 023a54f122
commit 2210e71f42
2 changed files with 16 additions and 2 deletions

View File

@ -98,6 +98,9 @@ case class AddressSet(base: BigInt, mask: BigInt) extends Ordered[AddressSet]
// A strided slave serves discontiguous ranges
def strided = alignment1 != mask
// Widen the match function to ignore all bits in imask
def widen(imask: BigInt) = AddressSet(base & ~imask, mask | imask)
// AddressSets have one natural Ordering (the containment order)
def compare(x: AddressSet) = {
val primary = (this.base - x.base).signum // smallest address first