summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/PopCount.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/PopCount.scala b/src/test/scala/chiselTests/PopCount.scala
index 2c144382..d9b3b837 100644
--- a/src/test/scala/chiselTests/PopCount.scala
+++ b/src/test/scala/chiselTests/PopCount.scala
@@ -16,6 +16,8 @@ class PopCountTester(n: Int) extends BasicTester {
val result = PopCount(x.asBools)
val expected = x.asBools.foldLeft(0.U)(_ +& _)
assert(result === expected)
+
+ require(result.getWidth == BigInt(n).bitLength)
}
class PopCountSpec extends ChiselPropSpec {