summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/util/random/PRNGSpec.scala
diff options
context:
space:
mode:
authorJack Koenig2022-01-10 16:32:51 -0800
committerGitHub2022-01-10 16:32:51 -0800
commit2b48fd15a7711dcd44334fbbc538667a102a581a (patch)
tree4b4766347c3943d65c13e5de2d139b14821eec61 /src/test/scala/chiselTests/util/random/PRNGSpec.scala
parent92e77a97af986629766ac9038f0ebc8ab9a48fa1 (diff)
parentbff8dc0738adafa1176f6959a33ad86f6373c558 (diff)
Merge pull request #2246 from chipsalliance/scalafmt
Add scalafmt configuration and apply it.
Diffstat (limited to 'src/test/scala/chiselTests/util/random/PRNGSpec.scala')
-rw-r--r--src/test/scala/chiselTests/util/random/PRNGSpec.scala28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/test/scala/chiselTests/util/random/PRNGSpec.scala b/src/test/scala/chiselTests/util/random/PRNGSpec.scala
index 71a8635c..36fdf9cb 100644
--- a/src/test/scala/chiselTests/util/random/PRNGSpec.scala
+++ b/src/test/scala/chiselTests/util/random/PRNGSpec.scala
@@ -28,15 +28,15 @@ class PRNGStepTest extends BasicTester {
val (_, done) = Counter(true.B, 16)
- when (count2 === 0.U) {
+ when(count2 === 0.U) {
assert(a === b, "1-step and 2-step PRNGs did not agree! (0b%b != 0b%b)", a, b)
}
- when (count4 === 0.U) {
+ when(count4 === 0.U) {
assert(a === c, "1-step and 4-step PRNGs did not agree!")
}
- when (done) {
+ when(done) {
stop()
}
@@ -52,11 +52,11 @@ class PRNGUpdateSeedTest(updateSeed: Boolean, seed: BigInt, expected: BigInt) ex
a.io.seed.valid := count === 2.U
a.io.seed.bits := seed.U(a.width.W).asBools
- when (count === 3.U) {
+ when(count === 3.U) {
assert(a.io.out.asUInt === expected.U, "Output didn't match!")
}
- when (done) {
+ when(done) {
stop()
}
@@ -64,18 +64,22 @@ class PRNGUpdateSeedTest(updateSeed: Boolean, seed: BigInt, expected: BigInt) ex
class PRNGSpec extends ChiselFlatSpec with Utils {
- behavior of "PRNG"
+ behavior.of("PRNG")
it should "throw an exception if the step size is < 1" in {
- { the [IllegalArgumentException] thrownBy extractCause[IllegalArgumentException] {
- ChiselStage.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 extractCause[IllegalArgumentException] {
- ChiselStage.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 {