diff options
| author | Jack Koenig | 2022-01-10 10:39:52 -0800 |
|---|---|---|
| committer | Jack Koenig | 2022-01-10 15:53:55 -0800 |
| commit | 3131c0daad41dea78bede4517669e376c41a325a (patch) | |
| tree | 55baed78a6a01f80ff3952a08233ca553a19964f /src/test/scala/cookbook | |
| parent | dd36f97a82746cec0b25b94651581fe799e24579 (diff) | |
Apply scalafmt
Command:
sbt scalafmtAll
Diffstat (limited to 'src/test/scala/cookbook')
| -rw-r--r-- | src/test/scala/cookbook/Bundle2UInt.scala | 2 | ||||
| -rw-r--r-- | src/test/scala/cookbook/CookbookSpec.scala | 2 | ||||
| -rw-r--r-- | src/test/scala/cookbook/FSM.scala | 19 | ||||
| -rw-r--r-- | src/test/scala/cookbook/RegOfVec.scala | 4 | ||||
| -rw-r--r-- | src/test/scala/cookbook/VecOfBool2UInt.scala | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/src/test/scala/cookbook/Bundle2UInt.scala b/src/test/scala/cookbook/Bundle2UInt.scala index 5bc1063a..21d06df7 100644 --- a/src/test/scala/cookbook/Bundle2UInt.scala +++ b/src/test/scala/cookbook/Bundle2UInt.scala @@ -24,7 +24,7 @@ class Bundle2UInt extends CookbookTester(1) { assert(uint === 0xc3.U) } -class Bundle2UIntSpec extends CookbookSpec { +class Bundle2UIntSpec extends CookbookSpec { "Bundle2UInt" should "work" in { assertTesterPasses { new Bundle2UInt } } diff --git a/src/test/scala/cookbook/CookbookSpec.scala b/src/test/scala/cookbook/CookbookSpec.scala index c1acc0de..7d6c9726 100644 --- a/src/test/scala/cookbook/CookbookSpec.scala +++ b/src/test/scala/cookbook/CookbookSpec.scala @@ -16,7 +16,7 @@ abstract class CookbookTester(length: Int) extends BasicTester { require(length >= 0, "Simulation length must be non-negative!") val (cycle, done) = Counter(true.B, length + 1) // + 1 cycle because done is actually wrap - when (done) { stop() } + when(done) { stop() } } abstract class CookbookSpec extends ChiselFlatSpec diff --git a/src/test/scala/cookbook/FSM.scala b/src/test/scala/cookbook/FSM.scala index 0c1173ec..66f3063f 100644 --- a/src/test/scala/cookbook/FSM.scala +++ b/src/test/scala/cookbook/FSM.scala @@ -26,21 +26,21 @@ class DetectTwoOnes extends Module { io.out := (state === State.sTwo1s) - switch (state) { - is (State.sNone) { - when (io.in) { + switch(state) { + is(State.sNone) { + when(io.in) { state := State.sOne1 } } - is (State.sOne1) { - when (io.in) { + is(State.sOne1) { + when(io.in) { state := State.sTwo1s - } .otherwise { + }.otherwise { state := State.sNone } } - is (State.sTwo1s) { - when (!io.in) { + is(State.sTwo1s) { + when(!io.in) { state := State.sNone } } @@ -53,7 +53,8 @@ class DetectTwoOnesTester extends CookbookTester(10) { // Inputs and expected results val inputs: Vec[Bool] = VecInit(false.B, true.B, false.B, true.B, true.B, true.B, false.B, true.B, true.B, false.B) - val expected: Vec[Bool] = VecInit(false.B, false.B, false.B, false.B, false.B, true.B, true.B, false.B, false.B, true.B) + val expected: Vec[Bool] = + VecInit(false.B, false.B, false.B, false.B, false.B, true.B, true.B, false.B, false.B, true.B) dut.io.in := inputs(cycle) assert(dut.io.out === expected(cycle)) diff --git a/src/test/scala/cookbook/RegOfVec.scala b/src/test/scala/cookbook/RegOfVec.scala index ba1ab359..ddb615c7 100644 --- a/src/test/scala/cookbook/RegOfVec.scala +++ b/src/test/scala/cookbook/RegOfVec.scala @@ -22,11 +22,11 @@ class RegOfVec extends CookbookTester(2) { val initRegOfVec = RegInit(VecInit(Seq.fill(4)(0.U(32.W)))) // Simple test (cycle comes from superclass) - when (cycle === 2.U) { assert(regOfVec(2) === 123.U) } + when(cycle === 2.U) { assert(regOfVec(2) === 123.U) } for (elt <- initRegOfVec) { assert(elt === 0.U) } } -class RegOfVecSpec extends CookbookSpec { +class RegOfVecSpec extends CookbookSpec { "RegOfVec" should "work" in { assertTesterPasses { new RegOfVec } } diff --git a/src/test/scala/cookbook/VecOfBool2UInt.scala b/src/test/scala/cookbook/VecOfBool2UInt.scala index 024eca89..ca1413dc 100644 --- a/src/test/scala/cookbook/VecOfBool2UInt.scala +++ b/src/test/scala/cookbook/VecOfBool2UInt.scala @@ -21,7 +21,7 @@ class VecOfBool2UInt extends CookbookTester(1) { assert(0xd.U === uint) } -class VecOfBool2UIntSpec extends CookbookSpec { +class VecOfBool2UIntSpec extends CookbookSpec { "VecOfBool2UInt" should "work" in { assertTesterPasses { new VecOfBool2UInt } } |
