summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/UIntOps.scala
diff options
context:
space:
mode:
authorJack Koenig2022-01-10 10:39:52 -0800
committerJack Koenig2022-01-10 15:53:55 -0800
commit3131c0daad41dea78bede4517669e376c41a325a (patch)
tree55baed78a6a01f80ff3952a08233ca553a19964f /src/test/scala/chiselTests/UIntOps.scala
parentdd36f97a82746cec0b25b94651581fe799e24579 (diff)
Apply scalafmt
Command: sbt scalafmtAll
Diffstat (limited to 'src/test/scala/chiselTests/UIntOps.scala')
-rw-r--r--src/test/scala/chiselTests/UIntOps.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/test/scala/chiselTests/UIntOps.scala b/src/test/scala/chiselTests/UIntOps.scala
index bc6454b8..5fb86001 100644
--- a/src/test/scala/chiselTests/UIntOps.scala
+++ b/src/test/scala/chiselTests/UIntOps.scala
@@ -70,8 +70,8 @@ class UIntOpsTester(a: Long, b: Long) extends BasicTester {
assert(dut.io.addampout === (a + b).U(33.W))
assert(dut.io.subampout === (a - b).S(33.W).asUInt)
assert(dut.io.timesout === (a * b).U(32.W))
- assert(dut.io.divout === (a / (b max 1)).U(32.W))
- assert(dut.io.modout === (a % (b max 1)).U(32.W))
+ assert(dut.io.divout === (a / (b.max(1))).U(32.W))
+ assert(dut.io.modout === (a % (b.max(1))).U(32.W))
assert(dut.io.lshiftout === (a << (b % 16)).U(32.W))
assert(dut.io.rshiftout === (a >> b).U(32.W))
assert(
@@ -117,7 +117,6 @@ class BasicRotate extends BasicTester {
val shiftAmount = random.LFSR(4)
val ctr = RegInit(0.U(4.W))
-
val rotL = 1.U(3.W).rotateLeft(shiftAmount)
val rotR = 1.U(3.W).rotateRight(shiftAmount)
@@ -140,7 +139,7 @@ class BasicRotate extends BasicTester {
ctr := ctr + 1.U
- when (ctr === 15.U){
+ when(ctr === 15.U) {
stop()
}
}
@@ -197,7 +196,7 @@ class UIntOpsSpec extends ChiselPropSpec with Matchers with Utils {
}
property("Bools cannot be created from >1 bit UInts") {
- a [Exception] should be thrownBy extractCause[Exception] { ChiselStage.elaborate(new BadBoolConversion) }
+ a[Exception] should be thrownBy extractCause[Exception] { ChiselStage.elaborate(new BadBoolConversion) }
}
property("UIntOps should elaborate") {
@@ -209,7 +208,7 @@ class UIntOpsSpec extends ChiselPropSpec with Matchers with Utils {
}
property("Negative shift amounts are invalid") {
- a [ChiselException] should be thrownBy extractCause[ChiselException] {
+ a[ChiselException] should be thrownBy extractCause[ChiselException] {
ChiselStage.elaborate(new NegativeShift(UInt()))
}
}