1
0

[rocket] use more standard pattern for computing integer min

This commit is contained in:
Andrew Waterman
2016-07-29 15:19:09 -07:00
parent ffac86b041
commit c465120610
2 changed files with 1 additions and 7 deletions

View File

@ -44,12 +44,6 @@ object Util {
def toBits(): UInt = Cat(x.map(_.toBits).reverse)
}
def minUInt(values: Seq[UInt]): UInt =
values.reduce((a, b) => Mux(a < b, a, b))
def minUInt(first: UInt, rest: UInt*): UInt =
minUInt(first +: rest.toSeq)
implicit class UIntIsOneOf(val x: UInt) extends AnyVal {
def isOneOf(s: Seq[UInt]): Bool = s.map(x === _).reduce(_||_)