1
0

Fix PopCountAtLeast, un-breaking BTB

This commit is contained in:
Andrew Waterman 2016-10-07 21:20:40 -07:00
parent 5392219d86
commit 4fd03ffdf1

View File

@ -44,7 +44,7 @@ package object util {
object PopCountAtLeast {
private def two(x: UInt): (Bool, Bool) = x.getWidth match {
case 1 => (Bool(true), Bool(false))
case 1 => (x.toBool, Bool(false))
case n =>
val half = x.getWidth / 2
val (leftOne, leftTwo) = two(x(half - 1, 0))