1
0

Add grouped method to AugmentedUInt, like Seq.grouped

This commit is contained in:
Andrew Waterman 2017-06-21 01:35:41 -07:00
parent 8989f5654c
commit 9c78ac4d78

View File

@ -57,6 +57,9 @@ package object util {
else x(hi, lo)
}
def grouped(width: Int): Seq[UInt] =
(0 until x.getWidth by width).map(base => x(base + width - 1, base))
def inRange(base: UInt, bounds: UInt) = x >= base && x < bounds
}