diff options
| author | Henry Cook | 2015-08-13 21:47:27 -0700 |
|---|---|---|
| committer | Henry Cook | 2015-08-13 21:47:45 -0700 |
| commit | 31c5c92fa59cbd9aec00851fd722b9a6317179ef (patch) | |
| tree | 92a7a31e9c9d5c1eb5a72fc9e03eb6d6f4e5af25 /src/test/scala/chiselTests/ChiselSpec.scala | |
| parent | ac5bf6a4c953fe39fa97d77bc620c515dc9e1622 (diff) | |
Counter tests
Diffstat (limited to 'src/test/scala/chiselTests/ChiselSpec.scala')
| -rw-r--r-- | src/test/scala/chiselTests/ChiselSpec.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/ChiselSpec.scala b/src/test/scala/chiselTests/ChiselSpec.scala index f3dad3dc..e9ec2dae 100644 --- a/src/test/scala/chiselTests/ChiselSpec.scala +++ b/src/test/scala/chiselTests/ChiselSpec.scala @@ -38,6 +38,9 @@ import Chisel.testers._ class ChiselPropSpec extends PropSpec with PropertyChecks { def execute(t: => BasicTester): Boolean = TesterDriver.execute(t) + def popCount(n: Long) = n.toBinaryString.count(_=='1') + + val smallPosInts = Gen.choose(1, 16) val safeUIntWidth = Gen.choose(1, 31) val safeUInts = Gen.choose(0, (1 << 30)) val vecSizes = Gen.choose(0, 4) |
