1
0

PriorityEncoder apply() no longer has recursive depth param

This commit is contained in:
Henry Cook 2012-03-08 01:04:26 -08:00
parent 941873bad1
commit 7f43dee0c9

View File

@ -259,10 +259,11 @@ class LockingArbiter[T <: Data](n: Int)(data: => T) extends Component {
object PriorityEncoder
{
def apply(in: Bits, n: Int = 0): UFix = {
def apply(in: Bits): UFix = doApply(in, 0)
def doApply(in: Bits, n: Int = 0): UFix = {
if (n >= in.getWidth-1)
UFix(n)
else
Mux(in(n), UFix(n), PriorityEncoder(in, n+1))
Mux(in(n), UFix(n), doApply(in, n+1))
}
}