diff options
Diffstat (limited to 'src/test/scala/chiselTests/UIntOps.scala')
| -rw-r--r-- | src/test/scala/chiselTests/UIntOps.scala | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/test/scala/chiselTests/UIntOps.scala b/src/test/scala/chiselTests/UIntOps.scala index 0c7e2dcd..a13077ba 100644 --- a/src/test/scala/chiselTests/UIntOps.scala +++ b/src/test/scala/chiselTests/UIntOps.scala @@ -4,6 +4,7 @@ package chiselTests import chisel3._ import org.scalatest._ +import chisel3.stage.ChiselStage import chisel3.testers.BasicTester import org.scalacheck.Shrink import org.scalatest.matchers.should.Matchers @@ -112,21 +113,21 @@ class UIntLitExtractTester extends BasicTester { stop() } -class UIntOpsSpec extends ChiselPropSpec with Matchers { +class UIntOpsSpec extends ChiselPropSpec with Matchers with Utils { // Disable shrinking on error. implicit val noShrinkListVal = Shrink[List[Int]](_ => Stream.empty) implicit val noShrinkInt = Shrink[Int](_ => Stream.empty) property("Bools can be created from 1 bit UInts") { - elaborate(new GoodBoolConversion) + ChiselStage.elaborate(new GoodBoolConversion) } property("Bools cannot be created from >1 bit UInts") { - a [Exception] should be thrownBy { elaborate(new BadBoolConversion) } + a [Exception] should be thrownBy extractCause[Exception] { ChiselStage.elaborate(new BadBoolConversion) } } property("UIntOps should elaborate") { - elaborate { new UIntOps } + ChiselStage.elaborate { new UIntOps } } property("UIntOpsTester should return the correct result") { @@ -134,7 +135,9 @@ class UIntOpsSpec extends ChiselPropSpec with Matchers { } property("Negative shift amounts are invalid") { - a [ChiselException] should be thrownBy { elaborate(new NegativeShift(UInt())) } + a [ChiselException] should be thrownBy extractCause[ChiselException] { + ChiselStage.elaborate(new NegativeShift(UInt())) + } } property("Bit extraction on literals should work for all non-negative indices") { @@ -142,7 +145,7 @@ class UIntOpsSpec extends ChiselPropSpec with Matchers { } property("asBools should support chained apply") { - elaborate(new Module { + ChiselStage.elaborate(new Module { val io = IO(new Bundle { val in = Input(UInt(8.W)) val out = Output(Bool()) @@ -151,4 +154,3 @@ class UIntOpsSpec extends ChiselPropSpec with Matchers { }) } } - |
