From 121635ed26c8a9852c827d6c0729515337604d08 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Wed, 21 Nov 2018 14:08:32 -0800 Subject: Add asBools, deprecate toBools --- src/test/scala/chiselTests/UIntOps.scala | 4 ++-- src/test/scala/cookbook/UInt2VecOfBool.scala | 4 ++-- src/test/scala/examples/VendingMachineGenerator.scala | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/test') diff --git a/src/test/scala/chiselTests/UIntOps.scala b/src/test/scala/chiselTests/UIntOps.scala index 4bd9706d..dc4a9d63 100644 --- a/src/test/scala/chiselTests/UIntOps.scala +++ b/src/test/scala/chiselTests/UIntOps.scala @@ -140,13 +140,13 @@ class UIntOpsSpec extends ChiselPropSpec with Matchers { assertTesterPasses(new UIntLitExtractTester) } - property("toBools should support chained apply") { + property("asBools should support chained apply") { elaborate(new Module { val io = IO(new Bundle { val in = Input(UInt(8.W)) val out = Output(Bool()) }) - io.out := io.in.toBools()(2) + io.out := io.in.asBools()(2) }) } } diff --git a/src/test/scala/cookbook/UInt2VecOfBool.scala b/src/test/scala/cookbook/UInt2VecOfBool.scala index f69c483a..10250ad5 100644 --- a/src/test/scala/cookbook/UInt2VecOfBool.scala +++ b/src/test/scala/cookbook/UInt2VecOfBool.scala @@ -6,13 +6,13 @@ import chisel3._ /* ### How do I create a Vec of Bools from a UInt? * - * Use the builtin function [[chisel3.core.Bits.toBools]] to create a Scala Seq of Bool, + * Use the builtin function [[chisel3.core.Bits.asBools]] to create a Scala Seq of Bool, * then wrap the resulting Seq in Vec(...) */ class UInt2VecOfBool extends CookbookTester(1) { // Example val uint = 0xc.U - val vec = VecInit(uint.toBools) + val vec = VecInit(uint.asBools) printf(p"$vec") // Vec(0, 0, 1, 1) // Test diff --git a/src/test/scala/examples/VendingMachineGenerator.scala b/src/test/scala/examples/VendingMachineGenerator.scala index c222ca07..48dabacd 100644 --- a/src/test/scala/examples/VendingMachineGenerator.scala +++ b/src/test/scala/examples/VendingMachineGenerator.scala @@ -93,7 +93,7 @@ class ParameterizedVendingMachineTester( val (idx, done) = Counter(true.B, testLength + 1) when (done) { stop(); stop() } // Two stops for Verilator - dut.io.inputs := inputVec(idx).toBools + dut.io.inputs := inputVec(idx).asBools assert(dut.io.dispense === expectedVec(idx)) } -- cgit v1.2.3