summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/ChiselSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/chiselTests/ChiselSpec.scala')
-rw-r--r--src/test/scala/chiselTests/ChiselSpec.scala11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/ChiselSpec.scala b/src/test/scala/chiselTests/ChiselSpec.scala
index 3485b398..3d98d0a2 100644
--- a/src/test/scala/chiselTests/ChiselSpec.scala
+++ b/src/test/scala/chiselTests/ChiselSpec.scala
@@ -41,7 +41,7 @@ class ChiselPropSpec extends PropSpec with PropertyChecks {
def popCount(n: Long) = n.toBinaryString.count(_=='1')
val smallPosInts = Gen.choose(1, 7)
- val safeUIntWidth = Gen.choose(1, 31)
+ val safeUIntWidth = Gen.choose(1, 30)
val safeUInts = Gen.choose(0, (1 << 30))
val vecSizes = Gen.choose(0, 4)
val binaryString = for(i <- Arbitrary.arbitrary[Int]) yield "b" + i.toBinaryString
@@ -51,10 +51,19 @@ class ChiselPropSpec extends PropSpec with PropertyChecks {
w <- smallPosInts
i <- Gen.containerOfN[List,Int](n, Gen.choose(0, (1 << w) - 1))
} yield (w, i)
+ val safeUInt = for {
+ w <- smallPosInts
+ i <- Gen.choose(0, (1 << w) - 1)
+ } yield (w, i)
def safeUIntPairN(n: Int) = for {
w <- smallPosInts
i <- Gen.containerOfN[List,Int](n, Gen.choose(0, (1 << w) - 1))
j <- Gen.containerOfN[List,Int](n, Gen.choose(0, (1 << w) - 1))
} yield (w, i zip j)
+ val safeUIntPair= for {
+ w <- smallPosInts
+ i <- Gen.choose(0, (1 << w) - 1)
+ j <- Gen.choose(0, (1 << w) - 1)
+ } yield (w, i, j)
}