1
0

[rocket] only write badaddr on certain exceptions

This commit is contained in:
Andrew Waterman
2016-07-29 15:18:39 -07:00
parent 0d3d9fca25
commit ffac86b041
2 changed files with 12 additions and 2 deletions

View File

@ -49,6 +49,12 @@ object Util {
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(_||_)
def isOneOf(u1: UInt, u2: UInt*): Bool = isOneOf(u1 +: u2.toSeq)
}
}
import Util._