Add performance counter facility
This commit is contained in:
@ -50,7 +50,7 @@ case class WideCounter(width: Int, inc: UInt = UInt(1), reset: Boolean = true)
|
||||
|
||||
private val large = if (isWide) {
|
||||
val r = if (reset) Reg(init=UInt(0, width - smallWidth)) else Reg(UInt(width = width - smallWidth))
|
||||
when (nextSmall(smallWidth)) { r := r +& UInt(1) }
|
||||
when (nextSmall(smallWidth)) { r := r + UInt(1) }
|
||||
r
|
||||
} else null
|
||||
|
||||
|
@ -43,6 +43,8 @@ package object util {
|
||||
if (hi == lo-1) UInt(0)
|
||||
else x(hi, lo)
|
||||
}
|
||||
|
||||
def inRange(base: UInt, bounds: UInt) = x >= base && x < bounds
|
||||
}
|
||||
|
||||
implicit class BooleanToAugmentedBoolean(val x: Boolean) extends AnyVal {
|
||||
|
Reference in New Issue
Block a user