diff options
| author | Schuyler Eldridge | 2020-06-22 20:34:46 -0400 |
|---|---|---|
| committer | GitHub | 2020-06-22 20:34:46 -0400 |
| commit | 9f44b593efe4830aeb56d17f5ed59277a74832f8 (patch) | |
| tree | ac43010dd7fc2a14303497f95e12f2a40bb16d0e /src/test/scala/chiselTests/util/random/PRNGSpec.scala | |
| parent | d099d01ae6b11d8befdf7b32ab74c3167a552984 (diff) | |
| parent | b5e59895e13550006fd8e951b7e9483de00f82dd (diff) | |
Merge pull request #1481 from freechipsproject/driver-deprecations
Remove Deprecated Usages of chisel3.Driver, CircuitForm
Diffstat (limited to 'src/test/scala/chiselTests/util/random/PRNGSpec.scala')
| -rw-r--r-- | src/test/scala/chiselTests/util/random/PRNGSpec.scala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/test/scala/chiselTests/util/random/PRNGSpec.scala b/src/test/scala/chiselTests/util/random/PRNGSpec.scala index 341fb685..bf10a1c0 100644 --- a/src/test/scala/chiselTests/util/random/PRNGSpec.scala +++ b/src/test/scala/chiselTests/util/random/PRNGSpec.scala @@ -3,11 +3,12 @@ package chiselTests.util.random import chisel3._ +import chisel3.stage.ChiselStage import chisel3.testers.BasicTester import chisel3.util.Counter import chisel3.util.random.PRNG -import chiselTests.ChiselFlatSpec +import chiselTests.{ChiselFlatSpec, Utils} class CyclePRNG(width: Int, seed: Option[BigInt], step: Int, updateSeed: Boolean) extends PRNG(width, seed, step, updateSeed) { @@ -61,18 +62,20 @@ class PRNGUpdateSeedTest(updateSeed: Boolean, seed: BigInt, expected: BigInt) ex } -class PRNGSpec extends ChiselFlatSpec { +class PRNGSpec extends ChiselFlatSpec with Utils { behavior of "PRNG" it should "throw an exception if the step size is < 1" in { - { the [IllegalArgumentException] thrownBy elaborate(new CyclePRNG(0, Some(1), 1, true)) } - .getMessage should include ("Width must be greater than zero!") + { the [IllegalArgumentException] thrownBy extractCause[IllegalArgumentException] { + ChiselStage.elaborate(new CyclePRNG(0, Some(1), 1, true)) } + }.getMessage should include ("Width must be greater than zero!") } it should "throw an exception if the step size is <= 0" in { - { the [IllegalArgumentException] thrownBy elaborate(new CyclePRNG(1, Some(1), 0, true)) } - .getMessage should include ("Step size must be greater than one!") + { the [IllegalArgumentException] thrownBy extractCause[IllegalArgumentException] { + ChiselStage.elaborate(new CyclePRNG(1, Some(1), 0, true)) } + }.getMessage should include ("Step size must be greater than one!") } it should "handle non-unary steps" in { |
